How samu64d/openpkw works
Openpkw is an Electron-hosted 3D Pokémon-world application. The visible workflow starts in the Electron renderer, initializes the application and its drivers, creates a WebGL renderer, loads model and shader assets, then draws the map while keyboard input moves the camera. The README is sparse, so the map/rendering workflow is grounded in sampled source; other engine capabilities are represented only where the source index supports them. Unsampled internals and their connections are omitted.
Main entry points: Renderer.ts Scene renderer · Openpkw.ts Openpkw app · FileHandler.ts File access · ByteBuffer.ts Byte buffers
Components 23
Application
- Application bootstrap
src/Bootstrap.ts - Window lifecycle
src/engine/application/Application.ts - Openpkw app
src/Openpkw.ts - World map data
src/app/MapData.ts
Rendering
- Scene renderer
src/app/Renderer.ts - Camera and transforms
src/engine/core/rendering - WebGL context manager
src/engine/drivers/graphic/gl/GLContextManager.ts - WebGL resources
src/engine/drivers/graphic/gl - OBJ model decoder
src/engine/core/format/obj/OBJDecoder.ts - Image decoding
src/engine/core/format/png/PNGDecoder.ts
Engine I/O
- File access
src/engine/core/io/file/FileHandler.ts - Byte buffers
src/engine/core/io/buffer/ByteBuffer.ts - Text decoding
src/engine/core/codec/StringByteDecoder.ts - Text encoding types
src/engine/core/codec/TextEncoding.ts - Exceptions and validation
src/engine/core/exception - Reflection and disposal
src/engine/core/reflection
Platform and drivers
- Filesystem driver API
src/engine/core/interop/FileSystemDriver.ts - Node filesystem
src/engine/drivers/filesystem/node/NodeFileSystemDriver.ts - Memory driver
src/engine/core/interop/MemoryDriver.ts - Pooled memory driver
src/engine/drivers/memory/PoolMemoryDriver.ts - Driver registry
src/engine/core/interop/DriverRegistry.ts
Other components
- User
- Electron runtime
Connections 28
- Electron runtime → Application bootstrap: starts
src/Bootstrap.ts - Application bootstrap → Electron runtime: reads runtime
src/Bootstrap.ts - User → Openpkw app: keyboard input
src/Openpkw.ts - Window lifecycle → Openpkw app: dispatches lifecycle
src/engine/application/Application.ts - Openpkw app → Window lifecycle: extends
src/Openpkw.ts - Openpkw app → Scene renderer: creates and updates
src/Openpkw.ts - Scene renderer → World map data: reads map
src/app/Renderer.ts - Scene renderer → Camera and transforms: uses transforms
src/app/Renderer.ts - Scene renderer → WebGL context manager: configures and clears
src/app/Renderer.ts - Scene renderer → WebGL resources: builds draw resources
src/app/Renderer.ts - Scene renderer → File access: reads assets
src/app/Renderer.ts - Scene renderer → OBJ model decoder: decodes models
src/app/Renderer.ts - Scene renderer → Image decoding: uses image decoder
src/app/Renderer.ts - Scene renderer → Text decoding: decodes shader text
src/app/Renderer.ts - File access → Filesystem driver API: reads and writes
src/engine/core/io/file/FileHandler.ts - File access → Byte buffers: allocates and transfers
src/engine/core/io/file/FileHandler.ts - Byte buffers → Text decoding: encodes strings
src/engine/core/io/buffer/ByteBuffer.ts - Text decoding → Text encoding types: uses encoding type
src/engine/core/codec/StringByteDecoder.ts - Node filesystem → Filesystem driver API: implements
src/engine/drivers/filesystem/node/NodeFileSystemDriver.ts - Openpkw app → Driver registry: registers drivers
src/Openpkw.ts - Driver registry → Filesystem driver API: stores driver
src/engine/core/interop/FileSystemDriver.ts - Openpkw app → Node filesystem: instantiates
src/Openpkw.ts - Openpkw app → Pooled memory driver: instantiates
src/Openpkw.ts - Pooled memory driver → Memory driver: implements
src/engine/drivers/memory/PoolMemoryDriver.ts - Driver registry → Memory driver: registers by type
- File access → Reflection and disposal: uses disposal decorator
src/engine/core/io/file/FileHandler.ts - File access → Exceptions and validation: throws I/O errors
src/engine/core/io/file/FileHandler.ts - Byte buffers → Exceptions and validation: throws buffer errors
src/engine/core/io/buffer/ByteBuffer.ts