Skip to content

Instantly share code, notes, and snippets.

@ClearlyKyle
Last active June 14, 2026 15:07
Show Gist options
  • Select an option

  • Save ClearlyKyle/13cffacde4af921340982046805cebde to your computer and use it in GitHub Desktop.

Select an option

Save ClearlyKyle/13cffacde4af921340982046805cebde to your computer and use it in GitHub Desktop.
Build rlImGui with cimgui
@echo off
set IMGUI_DIR=deps\include\imgui
set CIMGUI_DIR=deps\include\cimgui
set RLIMGUI_DIR=deps\include\rlImGui
set RAYLIB_DIR=deps\include
set INCLUDES=/I"%RAYLIB_DIR%" /I"%IMGUI_DIR%" /I"%CIMGUI_DIR%" /I"%RLIMGUI_DIR%"
:: Set which backends will be used
set DEFINES=/DCIMGUI_USE_OPENGL3 ^
/DIMGUI_IMPL_API="extern ""C"" __declspec(dllexport)" ^
/DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1
:: Compile imgui + backends (matching define above)
cl /nologo /c /Z7 /MD %DEFINES% %INCLUDES% %IMGUI_DIR%\*.cpp %IMGUI_DIR%\backends\imgui_impl_opengl3.cpp
:: Compile rlimgui
cl /nologo /c /Z7 /MD %DEFINES% /DNO_FONT_AWESOME %INCLUDES% %RLIMGUI_DIR%\rlImGui.cpp
:: Compile cimgui
cl /nologo /c /Z7 /MD %DEFINES% %INCLUDES% /I%IMGUI_DIR%\backends %CIMGUI_DIR%\*.cpp
:: Create raylib_cimgui library
lib /nologo /OUT:deps/libs/raylib_cimgui.lib *.obj
project/
│
├── build_rlimgui.bat
│
└── deps/
    ├── include/
    │   ├── raylib.h
    │   │
    │   ├── imgui/
    │   │   ├── imgui.h
    │   │   ├── ...
    │   │   └── backends/
    │   │       ├── imgui_impl_opengl3.cpp
    │   │       └── imgui_impl_opengl3.h
    │   │
    │   ├── cimgui/
    │   │   ├── cimgui_impl.cpp
    │   │   ├── cimgui_impl.h
    │   │   ├── cimgui.cpp
    │   │   └── cimgui.h
    │   │
    │   └── rlImGui/
    │       ├── imgui_impl_raylib.cpp
    │       ├── rlImGui.cpp
    │       └── rlImGui.h
    │
    └── libs/
        └── raylib_cimgui.lib  <-- The output library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment