How dante-leoncini/whisk3d-editor works
Purpose and entry points
Whisk3D is a pre-alpha, native cross-platform retro 2D/3D creation environment: modeling, animation, rendering, and game development on constrained hardware. The desktop/native application starts in main/app/main.cpp, with application construction and UI initialization split through main/app/constructor.cpp and main/app/W3dInitUI.cpp. The root build graph is CMake-driven (CMakeLists.txt).
Application shell and scene state
The app layer owns startup, global interaction wiring, docking, controls, and editor state. main/W3dEscena.h / main/W3dEscena.cpp appear to define the central scene/editor context, while main/app/W3dDock.cpp manages dockable workspace structure. This is the boundary between platform event delivery and the editor/runtime subsystems.
Scene, object, and editing model
main/objects/Scene.cpp and main/objects/Collection.cpp organize scene content; concrete object capabilities include cameras, curves, instances, LOD, particles, mirrors, primitives, and 2D UI elements. Editing is mode-specific: mesh edits are in main/edit/MeshEdit.cpp, skeletal work in main/edit/BoneEdit.cpp, and painting in main/edit/WeightPaint.cpp. Undo is a separate cross-cutting command/history layer in main/undo/Undo.cpp.
Editor workspace and input flow
The editor is composed of specialized viewports/panels rather than a web UI. main/ui/ViewPorts/ViewPorts.cpp coordinates workspace views, main/ui/ViewPorts/ViewPort3D.cpp provides the 3D editing surface, and main/ui/ViewPorts/Outliner.cpp exposes scene hierarchy. Input and picking pass from application controls into viewport interaction (main/app/controles.cpp, main/ui/ViewPorts/Pick3D.cpp), then mutate the scene/edit model, typically under undo control.
Rendering and asset presentation
The render subsystem consumes scene/object state and draws the 3D workspace plus editor overlays. Its main boundary is main/render/render.cpp, with render settings in main/render/OpcionesRender.cpp and UI composition in main/render/UIOverlay.cpp. Texture, font, skin-atlas, and video resources are handled as asset-format/runtime services under main/io/Textura2D.cpp, main/io/Fuente2D.cpp, and main/io/SkinAtlas.cpp; shipped UI skin resources reside in res/Skins/Whisk3D/.
Project I/O, interchange, and game output
Whisk3D has a native project/container format plus import/export boundaries. Native loading/saving is centered on main/importers/import_w3d.cpp, main/io/GuardarW3D.cpp, and main/io/W3dContenedor.cpp. Interchange supports OBJ, glTF, and FBX through main/importers/import_obj.cpp, main/importers/import_gltf.cpp, and main/importers/import_fbx.cpp, with glTF export at main/importers/export_gltf.cpp. Game compilation is a distinct output path in main/io/CompilarJuego.cpp.
Scripting and runtime simulation
Embedded Lua supports game behavior and compilation. main/script/W3dScript.cpp hosts scripting, main/script/BindsJuego.cpp exposes game bindings, and main/script/SimJuego.cpp runs game simulation. Lua is vendored in thirdparty/lua/; this separates authoring-time scene editing from executable game logic.
Platforms and infrastructure
The core is C++/CMake with SDL2 (thirdparty/SDL2) and OpenGL-family platform shims. Platform packaging/adaptation lives under platform/: Android uses Gradle plus JNI (platform/android/app/build.gradle, platform/android/jni/Android.mk); Web uses a WebGL-oriented build script (platform/web/build_web.sh); Linux, Windows, and macOS have dedicated build/package paths. No backend, account, or network service is indicated; projects and assets are local files.
Components 22
Application Shell
- Native app entry
main/app/main.cpp - App construction & UI init
main/app/constructor.cpp - Scene editor context · Central scene and editor context.
main/W3dEscena.cpp - Dockable workspace
main/app/W3dDock.cpp - Controls & input
main/app/controles.cpp
Editor & Scene
- Scene & collections
main/objects/Scene.cpp - Mesh editing · Mode-specific editing also includes bones and weight painting.
main/edit/MeshEdit.cpp - Undo history
main/undo/Undo.cpp - Viewport workspace
main/ui/ViewPorts/ViewPorts.cpp - 3D picking
main/ui/ViewPorts/Pick3D.cpp
Rendering & Assets
- Renderer · Draws the 3D workspace and editor overlays.
main/render/render.cpp - Render settings & overlay
main/render/UIOverlay.cpp - 2D assets & skins · Textures, fonts, atlases, and shipped UI skins.
main/io/Textura2D.cpp
Project I/O & Output
- Native project I/O · Loads and saves the native W3D container.
main/importers/import_w3d.cpp - OBJ / glTF / FBX interchange
main/importers/import_gltf.cpp - Game compilation
main/io/CompilarJuego.cpp
Game Runtime
- Lua scripting host
main/script/W3dScript.cpp - Game simulation & bindings
main/script/SimJuego.cpp - Vendored Lua
Build & Platforms
- CMake build graph
CMakeLists.txt - Android JNI package
platform/android/jni/Android.mk - Web build target
platform/web/build_web.sh
Connections 22
- CMake build graph → Native app entry: builds
- Native app entry → App construction & UI init: initializes
- App construction & UI init → Scene editor context: creates
- App construction & UI init → Dockable workspace: sets up
- Scene editor context → Scene & collections: owns editor state
- Controls & input → 3D picking: routes input
- 3D picking → Mesh editing: drives selection and edits
- Mesh editing → Scene & collections: mutates
- Mesh editing → Undo history: records commands
- Viewport workspace → Scene & collections: presents
- Viewport workspace → Renderer: requests drawing
- Renderer → Scene & collections: renders
- Renderer → Render settings & overlay: composes
- Renderer → 2D assets & skins: uses
- Native project I/O → Scene & collections: loads and saves
- OBJ / glTF / FBX interchange → Scene & collections: imports and exports
- Game compilation → Scene & collections: packages authored content
- Lua scripting host → Vendored Lua: embeds
- Game simulation & bindings → Lua scripting host: executes behavior through
- Game compilation → Game simulation & bindings: produces runtime output
- Android JNI package → CMake build graph: adapts native build
- Web build target → CMake build graph: builds for WebGL