A binding and backend of ImGui to make it render and work correctly with the raylib framework/Library. This is C++ but links with raylib.

#c++ #cpp #raylib #wrapper #binding #imgui #gamedev #ui #gui #dear-imgui #library

Jeffery Myers 3267217cd5 updates il y a 4 ans
examples 5d6eb837d1 reorg code for separate module use il y a 4 ans
extras 3267217cd5 updates il y a 4 ans
imgui @ dde31030e9 5d6eb837d1 reorg code for separate module use il y a 4 ans
raylib @ 8d6f9b3baa 3267217cd5 updates il y a 4 ans
.gitignore 5d6eb837d1 reorg code for separate module use il y a 4 ans
.gitmodules 5d6eb837d1 reorg code for separate module use il y a 4 ans
README.md 5d6eb837d1 reorg code for separate module use il y a 4 ans
premake-2019.bat 5d6eb837d1 reorg code for separate module use il y a 4 ans
premake5.lua 5d6eb837d1 reorg code for separate module use il y a 4 ans
rlImGui.cpp 5d6eb837d1 reorg code for separate module use il y a 4 ans
rlImGui.h 5d6eb837d1 reorg code for separate module use il y a 4 ans
rlImGuiColors.h 5d6eb837d1 reorg code for separate module use il y a 4 ans

README.md

rlImGui

A Raylib integration with DearImGui

rlImgui provides a backend for Dear ImGui using Raylib.

Setup

Using rlImGui in your code is very easy. Once you have included the library, or source files for rlImGui and ImGui in your project, simply do the following.

#include "rlImGui.h" // include the API header

// before your game loop rlImGuiSetup(true); // sets up ImGui with ether a dark or light default theme

// inside your game loop, between BeginDrawing() and EndDrawing() rlImGuiBegin(); // starts the ImGui content mode. Make all ImGui calls after this

rlImGuiEnd(); // ends the ImGui content mode. Make all ImGui calls before this

// after your game loop is over, before you close the window

rlImGuiShutdown(); // cleans up ImGui

Examples

There are two example programs in the examples folder.

Simple

This is the most simple use of ImGui in raylib, it just shows the ImGui demo window.

Editor

This is a more complex example of ImGui, showing how to use raylib 2d and 3d cameras to draw into ImGui windows using render textures.

C vs C++

ImGui is a C++ library, so rlImGui uses C++ to create the backend and integration with Raylib. The rlImGui.h API only uses features that are common to C and C++, so rlImGui can be built as a static library and used by pure C code. Users of ImGui who wish to use pure C must use an ImGui wrapper, such as [https://github.com/cimgui/cimgui].