Software Design Specification (SDS)
1. Overview
1.1 Purpose
본 문서는 **Ghost 라이브러리의 소프트웨어 설계(SDS, Software Design Specification)**를 정의한다.
Ghost는 Grap 시스템의 Platform Layer (P2) 로 동작하는 라이브러리이며,
운영체제 플랫폼과 직접 통신하여 다음 기능을 구현한다.
- Window 생성 및 관리
- OS 메시지 처리
- NativeEvent 생성
- CPU Writable Surface 제공
- 플랫폼 시간 측정
본 문서는 현재 코드 구현을 기반으로 설계를 설명한다.
추측 기반 기능이나 향후 기능은 포함하지 않는다.
1.2 Scope
Ghost 라이브러리는 다음 설계 영역을 포함한다.
| Component | Description |
|---|---|
| Window System | Window 생성 및 lifecycle 관리 |
| Native Event System | OS 이벤트 수집 |
| CPU Surface | Window backbuffer 접근 |
| Platform Integration | OS API 호출 |
| Time System | 플랫폼 시간 측정 |
Ghost는 플랫폼 추상화 계층으로 동작한다.
다음 기능은 설계 범위에 포함되지 않는다.
| Excluded Component | Description |
|---|---|
| Renderer | 그래픽 렌더링 |
| UI System | UI 레이아웃 |
| Input Mapping | NativeEvent → Engine Event 변환 |
| Asset System | 파일 또는 리소스 로딩 |
1.3 Design Goals
Ghost 설계의 주요 목표는 다음과 같다.
| Goal | Description |
|---|---|
| Platform Abstraction | OS API 추상화 |
| Lightweight API | 단순한 API 제공 |
| Handle Based System | 플랫폼 핸들 은닉 |
| Minimal Dependencies | 최소 의존성 유지 |
| Modular Architecture | 모듈 기반 구조 |
1.4 Module Structure
Ghost 라이브러리는 다음 모듈 구조로 구성된다.
ghost/
├── common/
├── id/
├── window/
├── time/
├── native_event/
├── platform/
└── tests/
각 모듈의 역할
| Module | Responsibility |
|---|---|
| common | 공통 타입 |
| id | 객체 식별 시스템 |
| window | Window API |
| time | 시간 측정 |
| native_event | 입력 이벤트 |
| platform | 플랫폼 구현 |
| tests | 테스트 코드 |
1.5 Design Principles
Ghost 설계는 다음 원칙을 따른다.
Platform Isolation
플랫폼 타입은 외부 API에 노출되지 않는다.
예시
HWND
이 타입은 Ghost API 외부에 노출되지 않는다.
Handle Based Object Model
Ghost 객체는 ID 기반 핸들 시스템을 사용한다.
예시
GhostWindowId
이 ID를 통해 내부 플랫폼 상태를 조회한다.
Module Separation
각 모듈은 명확히 분리되어 있다.
| Layer | Module |
|---|---|
| Core Types | common |
| Object Identity | id |
| Public API | window |
| Input System | native_event |
| Time System | time |
| Platform Implementation | platform |
1.6 External Dependencies
현재 Ghost 구현은 다음 플랫폼 API를 사용한다.
| Dependency | Description |
|---|---|
| Win32 API | Window 생성 및 메시지 처리 |
| GDI | Backbuffer 생성 |
| QueryPerformanceCounter | 고해상도 타이머 |
1.7 Document Structure
본 SDS 문서는 다음 구조로 구성된다.
| Section | Description |
|---|---|
| Architecture | 전체 시스템 구조 |
| Module Design | 모듈 설계 |
| Data Structures | 핵심 구조체 |
| API Design | 주요 API 설계 |
| Platform Implementation | 플랫폼 구현 |
이 문서는 Ghost 라이브러리의 현재 설계를 설명하는 기술 문서이다.