- work in progress.
- prototype code.
- raylib 5.5
- cimgui 1.92.1 ( imgui )
- lua 5.4
- OpenGL 3.3 ( raylib and local OS if driver pacakge exist )
- glfw ( raylib )
- CMake
-
msys64
-
CMake
Current config for windows with msys64 for small compiler. For later use for cross platform OS for desktop tests.
imgui.end()
This does not work due to match end for if statement conflict due how lua api table work. To follow imgui format for easy to read and port to c/c++ to be use later.
Some change to keep it simple since c does not work on lua script. It will handle in c lua state side code.
This is sample project that use cimgui (c language programing) convert from imgui (c++ language programing ) to run with raylib but in abstraction low level by rlgl.h. Due to raylib.h can't be access to set up window and graphic.
By using the CMake for easy compile and fetch content to get those repo download to build the application. Reason is that there raylib have different type build compiler.
Currently using the simple lua script to run imgui widgets.
-- set up local or theme
imgui.StyleColorsDark()
function draw()-- this get call from c main loop.
imgui.Begin("Lua UI")
imgui.Text("Hello from Lua!")
imgui.End()
end
function cleanup()-- not work on yet
print("Lua cleanup called")
end- This is place holder code still need to make sure it coded and tested.
- flags
- Begin
- End
- Text
- Textf
- SliderFloat
- Button
- CheckBox
- StyleColorsDark
- StyleColorsLight
- StyleColorsClassic
- GetVersion
- BeginMenuBar
- EndMenuBar
- BeginMainMenuBar
- EndMainMenuBar
- BeginMenu
- EndMenu
- MenuItem
- BeginTooltip
- EndTooltip
- SetTooltip
- ColorEdit3
- ColorEdit4
- ColorPicker3
- ColorPicker4
- ColorButton
- BeginTabBar
- EndTabBar
- BeginTabItem
- EndTabItem
- IsItemHovered
- IsItemActive
- IsItemClicked
- SameLine
- Separator
- Spacing
- BeginTable
- EndTable
- TableNextRow
- TableNextColumn
- TableSetColumnIndex
- InputText
- InputTextMultiline
- RadioButton
- ProgressBar
- TreeNode
- TreePop
- Bullet
- TextColored
- Combo
- ListBox
- PlotLines
- PlotHistogram
- VSliderFloat
- BeginChild
- EndChild
- IsWindowAppearing
- IsWindowCollapsed
- IsWindowFocused
- IsWindowHovered
- GetWindowPos
- GetWindowSize
- GetWindowWidth
- GetWindowHeight
- CollapsingHeader
- imgui.GetStyleCustom(imgui.Col.Text)
- imgui.SetStyleCustom(imgui.Col.Text, {0.0, 0.0, 1.0, 1.0}) -- Set blue text
- imgui.SetStyleCustoms({ }) -- Table-based, not working
-
imgui.WindowFlags.NoTitleBar
-
imgui.WindowFlags.NoResize
-
imgui.WindowFlags.NoMove
-
imgui.WindowFlags.NoScrollbar
-
imgui.WindowFlags.NoCollapse
-
imgui.WindowFlags.AlwaysAutoResize
-
imgui.WindowFlags.NoBackground
-
imgui.WindowFlags.NoSavedSettings
-
imgui.WindowFlags.NoMouseInputs
-
imgui.WindowFlags.MenuBar
-
imgui.WindowFlags.HorizontalScrollbar
-
imgui.WindowFlags.NoFocusOnAppearing
-
imgui.WindowFlags.NoBringToFrontOnFocus
-
imgui.WindowFlags.AlwaysVerticalScrollbar
-
imgui.WindowFlags.AlwaysHorizontalScrollbar
-
imgui.WindowFlags.NoNavInputs
-
imgui.WindowFlags.NoNavFocus
-
imgui.WindowFlags.NoDecoration
-
imgui.WindowFlags.NoInputs
-
imgui.WindowFlags.NoNav
-
imgui.ColorEditFlags.NoAlpha
-
imgui.ColorEditFlags.'Name'
-
imgui.Col.Text
-
imgui.Col.WindowBg
-
imgui.Col.Button
-
imgui.Col.ButtonHovered
-
imgui.Col.'Name'
Work in progres.
work in progress.
work in progress.
Using the Enet https://github.com/zpl-c/enet without secure for learning.
This work in progress. As been rework and need relearn how code works.
main.c
setup window
setup graphic
setup cimgui
setup lua
loop
input
graphic start
imgui start frame
imgui render ui stuff
imgui end frame
camera
render mesh
rlDrawRenderBatchActive();
glUseProgram(0);
imgui render draw data
glfwSwapBuffers(window);
clean up
There are four stage for imgui to handle imgui start, render ui, imgui end and imgui draw graphic. Well there is input to count as well. It all process under the hood.
Lua is added after imgui reason that script need to setup theme style else it would crashed.
- https://github.com/Lightnet/raylib_abstraction_cimgui
- https://github.com/raysan5/raylib
- https://github.com/cimgui/cimgui/blob/docking_inter/backend_test/example_glfw_opengl3/main.c
- https://github.com/WEREMSOFT/c99-raylib-cimgui-template
- https://github.com/alfredbaudisch/raylib-cimgui
- Grok AI Agent on https://x.com/i/grok