- C++ 47.9%
- C 42.7%
- Odin 9.1%
- Shell 0.2%
| .vscode | ||
| data | ||
| docs/images | ||
| sokol | ||
| src | ||
| .gitignore | ||
| Makefile | ||
| ols.json | ||
| README.md | ||
The Frame
An attempt to do something with Sokol and Odin.
Structure
/ shaders # all sokol shaders, compiled with sokol-shdc
/ sokol # the C code and object libraries to use Sokol in Odin
/ c # vendored sokol headers + Dear ImGui sources (sokol/c/imgui/)
/ imgui # Dear ImGui integration (debug builds only)
/ src # the odin code
/ shaders # generated shaders (see section #shaders)
Platforms
Linux systems, and macOS.
Build
Shaders
make build_shaders
Applications
make build_imgui_libs # Dear ImGui + sokol_imgui libs (debug builds only)
make build_app_debug # output: the-frame-debug
make build_app_release # output: the-frame-release
Debug Interface
The debug build (the-frame-debug) ships with a Dear ImGui overlay rendered via sokol_imgui.h.
- F1 toggles the overlay visibility.
- The overlay exposes a few controls (show/hide triangle, clear color picker,
backend/FPS readouts) — extend the
draw_debug_uiproc insrc/main.odinto add more debug widgets. - Dear ImGui is compiled into the debug binary only; the release binary
(
the-frame-release) is built without any ImGui code path thanks towhen ODIN_DEBUG { ... }gates around every call site.
Dear ImGui versions
sokol_imgui.h: pinned to the samemastercommit as the other vendored sokol headers insokol/c/.ocornut/imguivendored undersokol/c/imgui/(currently v1.92.9 from the master branch).
Setting up ImGui as a git submodule
The ImGui sources are from the master branch. To set up as a proper git submodule:
# Remove existing sources (if present)
rm -rf sokol/c/imgui
# Add as submodule pointing to master branch
git submodule add -b master https://github.com/ocornut/imgui.git sokol/c/imgui
git submodule update --init --remote
# Rebuild ImGui libraries
make build_imgui_libs
Extended ImGui Bindings
The debug UI layer (sokol/imgui/imgui.odin) provides bindings for:
Widgets:
- Radio buttons:
radio_button_bool,radio_button_int - Combo boxes:
begin_combo,end_combo - List boxes:
begin_list_box,end_list_box - Selectables:
selectable,selectable_ptr - Input fields:
input_text,input_float,input_int - Color editors:
color_edit3,color_edit4 - Progress bars:
progress_bar - Text:
separator_text,bullet - Layout:
same_line,new_line,spacing - Disabling:
begin_disabled,end_disabled
Hover/Input Detection (for camera control):
is_item_hovered,is_window_hovered,is_any_item_hoveredis_item_active,is_item_clicked,is_item_focused,is_item_editedis_any_item_activeis_mouse_down,is_mouse_clicked,is_mouse_releasedget_io- accesswant_capture_mouse,want_capture_keyboard,config_flags
Usage Example (in src/debug.odin):
// Check if ImGui wants mouse input (for camera control)
io: simgui.IO_Simplified
simgui.get_io(&io)
if !io.want_capture_mouse {
// Process camera input
}
Note: Docking is not supported because sokol_imgui.h is not compatible with the ImGui docking branch.
Screenshots
TODO
[x] OBJ parser [x] Extended ImGui bindings (widgets, hover detection) [x] 3D objects handling (cube, ball) [x] Apply a transform per object [x] Improve loading models CPU time (reduce GPU buffer creation to one single function) [x] Raycasting to "ping" a scene object using the mouse [x] Load each texture in a thread to improve engine loading time [ ] Fix GLTF parser, and texture / material integration [ ] Serialize a level and its resources in a document format [ ] Display, and improve the debug UI (save a scene, load a scene) [ ] Lua integration [ ] Internal console integration (like Quake console), and lua execution engine [ ] Level editor integrated, with basic object like Player, Enemy (enum), Wall, Input, Output

