ginter
ginter는 Grap 엔진에서 플랫폼 이벤트 시스템과 엔진 이벤트 시스템 사이의 브릿지 레이어(Event Bridge Layer) 를 제공하는 라이브러리이다.
이 모듈은 ghost에서 생성되는 Native Event를
gcore 이벤트 시스템에서 사용하는 Engine Event로 변환하고 전달한다.
ginter는 플랫폼 이벤트를 직접 생성하지 않으며
이벤트 의미 해석과 이벤트 변환 기능만 제공한다.
System Context
Grap 엔진 입력 시스템의 계층 구조
Application
▲
│
gcore
(Event System)
▲
│
ginter
(Event Interpretation)
▲
│
ghost
(Platform Layer)
▲
│
Operating System
각 계층의 역할
| Layer | Responsibility |
|---|---|
| Application | 애플리케이션 로직 |
| gcore | 엔진 이벤트 시스템 |
| ginter | NativeEvent → EngineEvent 변환 |
| ghost | 플랫폼 이벤트 수집 |
| OS | 운영체제 API |
Responsibilities
ginter는 다음 기능을 제공한다.
| Function | Description |
|---|---|
| Event Translation | Native Event → Engine Event 변환 |
| Keycode Mapping | 플랫폼 키코드를 엔진 키코드로 변환 |
| Event Construction | gcore::Event 생성 |
| Event Dispatch | EventBus 전달 |
ginter는 다음 기능을 수행하지 않는다.
- OS API 호출
- Window 생성
- Rendering 처리
- UI 처리
- Application 로직
Module Structure
ginter는 다음 서브모듈로 구성된다.
ginter
├─ convert
└─ pump
각 모듈의 역할
| Module | Responsibility |
|---|---|
| convert | Native Event → Engine Event 변환 |
| pump | Native Event 수집 및 EventBus 전달 |
Event Flow
입력 이벤트 처리 흐름
Win32 Message
│
▼
ghost platform
│
▼
ghost::NativeEvent
│
▼
ginter::EventPump
│
▼
native_to_gcore_event
│
▼
gcore::Event
│
▼
EventBus
│
▼
Application
Public Interface
ginter는 다음 Public API를 제공한다.
#include <ginter/ginter.hpp>
이 헤더는 다음 구성 요소를 포함한다.
| Component | Description |
|---|---|
| KeycodeMap | Native Keycode → Engine KeyCode 변환 |
| native_to_gcore_event | Native Event 변환 |
| EventPump | Native Event 처리 루프 |
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
Design Goals
ginter 모듈은 다음 설계 목표를 가진다.
Event System Decoupling
플랫폼 이벤트 시스템(ghost)과
엔진 이벤트 시스템(gcore)을 분리한다.
Platform Independence
엔진 이벤트 시스템이 OS API에 의존하지 않도록 한다.
Input Interpretation Layer
플랫폼 Raw Event를 엔진 이벤트 의미로 변환한다.
예
platform keycode
↓
engine keycode
Modular Architecture
이벤트 변환 로직과 이벤트 처리 루프를 분리한다.
| Module | Role |
|---|---|
| convert | 이벤트 변환 |
| pump | 이벤트 처리 |
Summary
ginter는 Grap 엔진에서 플랫폼 이벤트와 엔진 이벤트 사이의 브릿지 역할을 수행하는 모듈이다.
주요 기능
- Native Event 해석
- Engine Event 생성
- EventBus 전달
이 모듈은 플랫폼 코드와 엔진 코드를 분리하여
입력 시스템의 확장성과 유지보수성을 향상시키는 것을 목표로 한다.