How eujandergois/oxid works
Oxid is a CLI-first game engine: users create a JavaScript project, write game logic against built-in modules, then run it in a native Rust runtime. The runtime loads the project, executes lifecycle hooks through QuickJS, and renders queued drawing commands. The README also documents templates and generated editor typings. Some implementation files are listed but not sampled, so links among those components are limited to the documented workflow and explicit runtime entry points.
Main entry points: quickjs/mod.rs QuickJS backend · game.rs Game lifecycle · cli/mod.rs CLI commands · main.rs CLI entry
Components 18
Project CLI
- CLI entry
src/main.rs - CLI commands
src/cli/mod.rs - Project creation
src/cli/new.rs - Project templates
src/cli/templates.rs - Project runner
src/cli/run.rs
JavaScript Scripting
- Runtime interface
src/scripting/runtime.rs - QuickJS backend
src/scripting/quickjs/mod.rs - Script module loader
src/scripting/quickjs/loader.rs - Module resolution
src/scripting/resolver.rs - Built-in JS API
src/scripting/plugins/registry.rs - Type definitions
src/scripting/generator.rs
Native Engine
- Project loading
src/runtime/project.rs - Game lifecycle
src/runtime/game.rs
Rendering
- Render queue
src/renderer/queue.rs - Active draw context
src/renderer/context.rs - Macroquad renderer
src/renderer/mq_renderer.rs - Game window
Other components
- Game developer
Connections 18
- Game developer → CLI entry: runs CLI
- CLI entry → CLI commands: dispatches
- CLI commands → Project creation: creates project
- Project creation → Project templates: uses templates
- CLI commands → Project runner: runs project
- Project runner → Project loading: loads project
- Project loading → Game lifecycle: launches game
- Game lifecycle → Runtime interface: calls lifecycle
- QuickJS backend → Runtime interface: implements
- QuickJS backend → Script module loader: configures loader
- Script module loader → Module resolution: resolves imports
- QuickJS backend → Built-in JS API: registers modules
- Built-in JS API → Type definitions: provides metadata
- QuickJS backend → Active draw context: sets draw context
- Active draw context → Render queue: accesses queue
- Macroquad renderer → Render queue: renders commands
- Game lifecycle → Macroquad renderer: drives frames
- Game lifecycle → Game window: opens window