ginter Architecture
1. Layer Position
ginter는 Grap 엔진에서 이벤트 브릿지 계층(Event Bridge Layer) 을 제공하는 라이브러리이다.
이 모듈은 ghost 시스템에서 생성되는 Native Event를
gcore 이벤트 시스템에서 사용하는 Engine Event로 변환하고 전달한다.
ginter는 플랫폼 이벤트 시스템과 엔진 이벤트 시스템 사이의 이벤트 해석 계층이다.
이 모듈은 다음 기능을 수행한다.
- Native Event 해석
- Keycode 매핑
- Engine Event 생성
- EventBus 전달
플랫폼 이벤트 수집은 ghost에서 수행되며
엔진 이벤트 처리는 gcore에서 수행된다.
ginter는 이 두 시스템 사이에서 이벤트 의미 변환(Event Interpretation) 을 담당한다.
2. System Layer Structure
Grap 엔진 입력 시스템의 계층 구조
Application
▲
│
gcore
(Event System)
▲
│
ginter
(Event Interpretation)
▲
│
ghost
(Platform Layer)
▲
│
Operating System
레이어 역할
| Layer | Responsibility |
|---|---|
| Application | 애플리케이션 로직 |
| gcore | 엔진 이벤트 시스템 |
| ginter | NativeEvent → EngineEvent 변환 |
| ghost | 플랫폼 이벤트 수집 |
| OS | 운영체제 API |
3. Internal Modules
ginter는 다음 서브시스템으로 구성된다.
ginter
├─ convert
└─ pump
각 모듈의 역할은 다음과 같다.
convert
convert 모듈은 Native Event → Engine Event 변환을 담당한다.
주요 책임
- Native Event 해석
- Keycode 매핑 수행
- gcore::Event 생성
convert 모듈은 이벤트 변환 로직만을 포함하며
이벤트 수집 기능은 포함하지 않는다.
pump
pump 모듈은 이벤트 처리 루프(Event Pump) 를 담당한다.
주요 책임
- Window에서 Native Event 수집
- Native Event 순회
- convert 호출
- EventBus 전달
pump 모듈은 이벤트 변환을 직접 수행하지 않으며
convert 모듈을 사용하여 변환을 수행한다.
4. Dependency Structure
ginter 내부 모듈 의존 구조
convert
▲
│
pump
외부 모듈 의존성
gcore
▲
│
ginter
▲
│
ghost
의존 규칙
- convert는
gcore::Event타입을 사용한다 - pump는 convert 모 듈을 사용한다
- pump는
ghost::Window에 의존한다 - ginter는 OS API를 직접 호출하지 않는다
- 순환 의존성은 허용되지 않는다
5. Header Architecture
ginter는 Public Header 구조를 제공한다.
모든 Public API는 <ginter/...> 경로로 접근한다.
예
#include <ginter/convert/keycode_map.hpp>
#include <ginter/convert/native_to_gcore_event.hpp>
#include <ginter/pump/event_pump.hpp>
ginter는 umbrella header를 제공한다.
#include <ginter/ginter.hpp>
이 헤더는 ginter Public API 전체를 포함한다.
6. Directory Layout
ginter 디렉토리 구조
ginter/
├─ ginter.hpp
│
├─ convert/
│ ├─ keycode_map.hpp
│ ├─ native_to_gcore_event.hpp
│ └─ native_to_gcore_event.cpp
│
├─ pump/
│ └─ event_pump.hpp
│
└─ tests/
└─ smoke.cpp
7. Design Principles
ginter 시스템은 다음 설계 원칙을 따른다.
Event Translation Layer
ginter는 플랫폼 이벤트를 엔진 이벤트로 변환 하는
이벤트 해석 계층이다.
Platform Independence
ginter는 OS API를 직접 호출하지 않는다.
플랫폼 이벤트 수집은 ghost에서 수행된다.
Separation of Concerns
이벤트 수집과 이벤트 변환은 분리되어 있다.
| Module | Responsibility |
|---|---|
| ghost | 이벤트 수집 |
| convert | 이벤트 변환 |
| pump | 이벤트 전달 |
Raw Event Interpretation
ghost는 raw 이벤트만 제공한다.
예
- keycode_raw
- button_raw
이 값의 의미 해석은 ginter에서 수행된다.
8. Event Processing Flow
이벤트 처리 흐름
Win32 Message
│
▼
ghost platform
│
▼
ghost::NativeEvent
│
▼
ginter::EventPump
│
▼
native_to_gcore_event
│
▼
gcore::Event
│
▼
EventBus
9. Summary
ginter는 Grap 엔진에서 이벤트 브릿지 계층(Event Bridge Layer) 을 제공하는 모듈이다.
주요 기능
- Native Event 해석
- Engine Event 생성
- EventBus 전달
ginter는 플랫폼 이벤트 시스템과 엔진 이벤트 시스템 사이의
이벤트 변환 계층으로 설계되었다.