Engine Integration
How Galaxy Eggbert uses CNA directly, with Easy3D as a small helper beside it.
Direct CNA — Not an Abstraction Layer
Unlike the older Simple3D direction (which wrapped Urho3D behind an abstraction so the engine
could theoretically be swapped), GalaxyEggbertCNA calls CNA directly.
CNA is an XNA-compatible, SDL3-based C++ game framework — game code uses its
Microsoft::Xna::Framework::* namespaces and types with no engine-selection
indirection layer.
Easy3D's Role — a Helper, Not a Hiding Layer
Easy3D lives beside CNA, not above it. Game code is expected to call CNA directly for anything Easy3D doesn't specifically help with. Easy3D's job is narrow: cameras, texture atlas, and CPU-side batching/mesh-building for cubes and (eventually) billboards. It must never grow into a scene graph, ECS, or general engine.
What Easy3D provides today, used by GalaxyEggbertCNA
| Class | Role |
|---|---|
Easy3D::Camera3D | Drives View/Projection every frame, follows Blupi |
Easy3D::TextureAtlas | Underlies GETileAtlas's UV-rect mapping |
Easy3D::CubeMesh (BuildCubeMesh) | CPU-side vertex/index builder — turns a CubeBatch into 24 vertices + 36 indices per cube |
Easy3D::CubeMeshRenderer | Uploads that data to CNA VertexBuffer/IndexBuffer, issues DrawIndexedPrimitives via a caller-supplied BasicEffect |
What Easy3D does not have yet
Easy3D::BillboardBatch and DebugDraw exist as CPU-side item queues but
have no vertex builder or CNA renderer adapter yet — this is the main blocker
for rendering Blupi's sprite and mobile-eggbert objects as billboards (E3D-MIG-061/062 in
plan.md).
CNA APIs Used Directly by GalaxyEggbertCnaGame
| CNA type | Used for |
|---|---|
Microsoft::Xna::Framework::Game | Base class for GalaxyEggbertCnaGame |
GameTime | Delta time passed to Update/Draw |
Graphics::Texture2D | Loads object-m.png |
Graphics::BasicEffect | Textured, untextured-vertex-color-off shader for terrain draw |
Input::Keyboard / Keys | Arrow keys + Space each frame |
Color, Rectangle, Matrix | Standard XNA-compatible math/graphics types |
VertexBuffer / IndexBuffer / DrawIndexedPrimitives | Used inside GETerrainRenderer, matching CNA's own examples/house3d_demo.cpp draw pattern |
Entry Point
// src/GalaxyEggbertCNA/main.cpp
int main() {
auto* game = new GalaxyEggbert::CNA::GalaxyEggbertCnaGame();
game->Run();
delete game;
}
Lifecycle Overrides
class GalaxyEggbertCnaGame : public Microsoft::Xna::Framework::Game {
void LoadContent() override; // load world, texture, build terrain renderer
void Update(GameTime& gameTime) override; // advance anim phase, read input, step Blupi, update camera
void Draw(const GameTime& gameTime) override; // clear, set effect matrices, draw terrain
};
Comparison: Simple3D vs. CNA Integration Style
| Aspect | GalaxyEggbertSimple3D | GalaxyEggbertCNA |
|---|---|---|
| Engine access | Through Simple3D's Urho3D-shaped abstraction | Direct CNA API calls, no abstraction layer |
| Helper library | None (Simple3D itself is the abstraction) | Easy3D, explicitly small and non-hiding |
| Rendering | Scene-graph nodes with StaticModel/BillboardSet | Manual CubeMeshRenderer draw calls via BasicEffect |
| Status | Only fully playable target | Terrain + collision-only movement only |