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

ClassRole
Easy3D::Camera3DDrives View/Projection every frame, follows Blupi
Easy3D::TextureAtlasUnderlies GETileAtlas's UV-rect mapping
Easy3D::CubeMesh (BuildCubeMesh)CPU-side vertex/index builder — turns a CubeBatch into 24 vertices + 36 indices per cube
Easy3D::CubeMeshRendererUploads 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 typeUsed for
Microsoft::Xna::Framework::GameBase class for GalaxyEggbertCnaGame
GameTimeDelta time passed to Update/Draw
Graphics::Texture2DLoads object-m.png
Graphics::BasicEffectTextured, untextured-vertex-color-off shader for terrain draw
Input::Keyboard / KeysArrow keys + Space each frame
Color, Rectangle, MatrixStandard XNA-compatible math/graphics types
VertexBuffer / IndexBuffer / DrawIndexedPrimitivesUsed 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

AspectGalaxyEggbertSimple3DGalaxyEggbertCNA
Engine accessThrough Simple3D's Urho3D-shaped abstractionDirect CNA API calls, no abstraction layer
Helper libraryNone (Simple3D itself is the abstraction)Easy3D, explicitly small and non-hiding
RenderingScene-graph nodes with StaticModel/BillboardSetManual CubeMeshRenderer draw calls via BasicEffect
StatusOnly fully playable targetTerrain + collision-only movement only