raylib-extras / rlimgui Goto Github PK
View Code? Open in Web Editor NEWA Raylib integration with DearImGui
License: zlib License
A Raylib integration with DearImGui
License: zlib License
Hi. I was experimenting docking made possible by Dear ImGui using RayGui widgets. I think I may have found a problem when rendering 2 windows. One with a GuiListViewEx in it and the other rendering a GuiButton. For some reason I can't make the second window (with the GuiButton) render the widgets I want.
Here is the minimal reproducible example:
#include "raylib.h"
#define RAYGUI_IMPLEMENTATION
#include "raygui.h"
#include "imgui/imgui.h"
#include "rlImGui.h"
#include <string>
#include <vector>
// Variables
int listViewExScrollIndex = 0;
int listViewExActive = 0;
int listViewExFocus = 0;
std::vector<char*> listViewExList;
bool canAddEntity = false;
std::vector<std::string> entityNames;
// Widgets
void EntitiesList()
{
ImGui::BeginChild("listViewExChild", ImVec2(140, 700), true);
// Translate the rectangles coordinates to ImGui coordinates
ImVec2 pos = ImGui::GetCursorScreenPos();
ImVec2 size = ImGui::GetContentRegionAvail();
Rectangle rec = { pos.x, pos.y, size.x, size.y };
listViewExActive = GuiListViewEx(rec, listViewExList.data(), entityNames.size(), &listViewExFocus, &listViewExScrollIndex, listViewExActive);
ImGui::EndChild();
}
int main(int argc, char* argv[])
{
int screenWidth1 = 1900;
int screenHeight1 = 900;
SetConfigFlags(FLAG_MSAA_4X_HINT | FLAG_VSYNC_HINT | FLAG_WINDOW_RESIZABLE);
InitWindow(screenWidth1, screenHeight1, "raylib [ImGui] example - ImGui Demo");
SetTargetFPS(144);
rlImGuiSetup(true);
// Init Docking
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking
// Main game loop
while (!WindowShouldClose())
{
BeginDrawing();
ClearBackground(DARKGRAY);
// start the GUI
rlImGuiBegin();
ImGuiIO& io = ImGui::GetIO();
if (io.ConfigFlags & ImGuiConfigFlags_DockingEnable)
{
ImGui::DockSpaceOverViewport(ImGui::GetMainViewport());
ImGui::Begin("My Window");
// Render other ImGui elements here
ImVec2 pos = ImGui::GetCursorScreenPos();
if (GuiButton(Rectangle{ pos.x, pos.y, 120, 30 }, "My Button"))
{
// Do something when the button is clicked
}
ImGui::End();
ImGui::Begin("Entities List Window", NULL);
EntitiesList();
ImGui::End();
}
// end ImGui
rlImGuiEnd();
// Finish drawing
EndDrawing();
}
rlImGuiShutdown();
CloseWindow();
return 0;
}
Per this C++ core guideline: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-guards
#pragma once is dissuaded as it is a nonstandard extension with no guarantee of cross-compiler compatibility. The preferred method is still include guards for standard C++. I've created a pull request with the necessary changes!
In testing out the example projects on my machine, if the FLAG_RESIZABLE raylib config flag is set, ImGui windows have a split about a third of the way from the top, and only seem to render within the bounds of a smaller size that the actual window size, starting from the bottom left of the screen.
This is the compiled from the "imgui_style_example.cpp", using the master branch of ImGui.
Maximized window
Window at starting resolution.
I'm compiling with MingW on Windows 11.
See screenshots. Running the provided editor and simple examples exhibit a bug that looks scissor or viewport related, where part of the imgui render is cropped off. This cropping is related to where the imgui boxes are in the application window - if I move the box all the way to the top left corner, nothing is cropped.
This appears related to the fix for this issue:
#50
If I checkout 5c49511, the issue does not occur and both the editor and simple examples display correctly.
The screenshots show the correct rendering with hash 5c49511 and the bug in the latest version.
Hello,
I am using rlImGui in a web app which is compiled using emscripten. I noticed that on mobile devices (my iphone and ipad), touch events are sent to the main raylib app and not Dear ImGui. On desktop devices with a real mouse I don't see any problems. I am not very familiar with the ImGui internals so any advice would be appreciated.
Thank you.
Hi! While trying to use rlImGui on a hotreloadable enviroment, where the game code is loaded dynamically, the following line triggers an assert in glfw on call to glGetFramebufferSize
.
Line 94 in d890830
Assertion failed: window != NULL, file ${LOCAL_PATH}/glfw/src/window.c, line 694
The solution was replacing the call to glfwGetFramebufferSize
with:
width = rlGetFramebufferWidth();
height = rlGetFramebufferHeight();
Currently is working fine on my specific project, so I don't know if this is an actual issue or not.
Keep the good work. ❤️
Since 2018 ImGui has had support for viewports and docking.
Currently rlImGui, supports docking if you enable it like so:
ImGuiIO& io = ImGui::GetIO();
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
However multiple viewports would be a challenge to implement:
#define ENABLE_VIEWPORTS
?FLAG_WINDOW_UNDECORATED
flag for SetConfigFlags
we can remove the title bar of the new windows (for the full effect).Finally, we will have full support of the docking branch. It won't be as simple as it looks, but it would be useful for many rlImGui users.
Maybe rlImGui can have its own docking
branch which is used to experiment with viewports?
Hi, as Imgui can be used to make tools, It would be good to get the possibility to config in multiple viewports, like this: https://github.com/ocornut/imgui/wiki/multi-viewports
Is there any chance to get this?
Whether to add the multi-viewport function.
Hi authors,
can you please help what is the supposed way to load any other .ttf font to ImGui so that it works with rlImgui ?
In standalone ImGui fonts just loaded during init, and then album is built during init,
isn't it hidden somehow under rlImGuiSetup(true);
?
Is it possible to share the same font albums with void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint);
?
Here is the call stack:
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x0000000000000000
frame #1: 0x0000000100036bdc MyRaylibProject`rlLoadTexture(data=0x00000001483a0000, width=512, height=1024, format=7, mipmapCount=1) at rlgl.h:3015:5
frame #2: 0x000000010009164c MyRaylibProject`LoadTextureFromImage(image=(data = 0x00000001483a0000, width = 512, height = 1024, mipmaps = 1, format = 7)) at rtextures.c:3782:22
frame #3: 0x00000001000230dc MyRaylibProject`ReloadFonts() at rlImGui.cpp:83:17
frame #4: 0x0000000100023330 MyRaylibProject`::rlImGuiEndInitImGui() at rlImGui.cpp:295:5
frame #5: 0x00000001000241d8 MyRaylibProject`rlImGuiSetup(dark=true) at rlImGui.cpp:440:5
* frame #6: 0x0000000100007e80 MyRaylibProject`main at main.cpp:859:5
frame #7: 0x000000018850d0e0 dyld`start + 2360
Attempting to copy/paste text into InputText() widgets with any shortcuts does not work.
the imgui demo window text input crashes the whole app.
even if i make a text input my self the whole thing crashes.
Your example "editor.cpp" uses rlImGuiImageRenderTextureFit although this function seems to be missing from rlImGui.h.
Line 65 in 4fab916
When the image editor window is dragged around it results into the image getting move as well. This fix is better to prevent that.
Focused = ImGui::IsItemHovered() == false && ImGui::IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows);
Running premake-mingw.bat
generates .make files, but it's not possible to import them. Running make
shows an error: unable to find raudio.c
. Including raw rlImGui.h
shows a lot of errors when compiling. How to build static library and include file (like include/raylib.h, lib/raylib.a)?
Hello.
I use rlImGui
in my C project(also with raylib
and cimgui
). I use commit 16db43e
AddressSanitizer showing a direct memory leak:
Direct leak of 20 byte(s) in 1 object(s) allocated from:
#0 0x7f969b8e0cc1 in __interceptor_calloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:77
#1 0x556aded52c34 in MemAlloc /home/nagolove/caustic/3rd_party/raylib/src/utils.c:165
#2 0x556adee88261 in ReloadFonts() (/home/nagolove/proekt80/t80+0x724261) (BuildId: 08d4b93d2575458a72636d1b4d463d8c1b0a88f8)
#3 0x556adee88b1f in rlImGuiEndInitImGui (/home/nagolove/proekt80/t80+0x724b1f) (BuildId: 08d4b93d2575458a72636d1b4d463d8c1b0a88f8)
#4 0x556adee89b9f in rlImGuiSetup (/home/nagolove/proekt80/t80+0x725b9f) (BuildId: 08d4b93d2575458a72636d1b4d463d8c1b0a88f8)
#5 0x556adea6df17 in main /home/nagolove/proekt80/src/t80_main.c:480
#6 0x7f969b245ccf in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
There is no MemFree()
call for io.Fonts->TexID
I suggest next patch for shutdown function:
void rlImGuiShutdown()
{
ImGui::SetCurrentContext(GlobalContext);
ImGuiIO& io = ImGui::GetIO();
if (io.Fonts->TexID) {
MemFree(io.Fonts->TexID);
io.Fonts->TexID = NULL;
}
ImGui_ImplRaylib_Shutdown();
ImGui::DestroyContext();
}
Line 170 in de2c361
I am creating a tool using Raylib + rlImGui, but I would like to be able to draw a ImGui window outside the main window of Raylib so the users can use multiple monitors, is it possible to do that? I thought about creating a new window on another thread using OpenGL + ImGui just to draw one window and interfacing with it somehow from the Raylib main window for communication but I wonder if there is a better way.
Could you mind adding PLATFORM_DRM support on Linux in raylib_premake5.lua ?
When closing the application the terminal reads:
INFO: Window closed successfully
Process finished with exit code 139 (interrupted by signal 11:SIGSEGV)
The app runs just fine apart from this.
Debugging I discovered that the error is thrown at line 475 of rlImGui.cpp: ImGui::DestroyContext();
, so ImGui_ImplRaylib_Shutdown();
executes without problems
I have a simulator for point charges and I have implemented a function that allows charges to be dragged while holding mouse left button. I want to block dragging charges function under the ImGui windows.
I have succeeded to block all other functions under ImGui windows like (Add Charge, Remove Charge, Select Charge), but all these functions have in common IsMouseButtonPressed function.
For the dragging charges function I used IsMouseButtonDown and I observed that the dragging is still working under the ImGui windows, and after a bit of debugging I found out that the io.WantCaptureMouse variable is not changed If I hold the left button, and I think that these lines are the reason, because they are taking into consideration only the Pressed function, but the Down function has a different behavior.
auto setMouseEvent = [&io](int rayMouse, int imGuiMouse) { if (IsMouseButtonPressed(rayMouse)) io.AddMouseButtonEvent(imGuiMouse, true); else if (IsMouseButtonReleased(rayMouse)) io.AddMouseButtonEvent(imGuiMouse, false); };
How could I fix the problem?
Changing the approach maybe, or is there an alternative for the rllImGui Process Event function that would fix the problem?
Maybe I am missing something.
Thank you.
In commit: c71a025
This got commited:
io.Fonts->AddFontFromFileTTF("resources/fa-solid-900.ttf", FONT_AWESOME_ICON_SIZE, &icons_config, nullptr);
//io.Fonts->AddFontFromMemoryCompressedTTF((void*)fa_solid_900_compressed_data, fa_solid_900_compressed_size, FONT_AWESOME_ICON_SIZE, &icons_config, icons_ranges);
it should probably be just the commented row and delete the other one:
io.Fonts->AddFontFromMemoryCompressedTTF((void*)fa_solid_900_compressed_data, fa_solid_900_compressed_size, FONT_AWESOME_ICON_SIZE, &icons_config, icons_ranges);
The asset browser and editor examples fail to compile on osx.
The editor example is due to deprecated functions on dear imgui 1.9.1
The asset browser fails due to stricmp not being available on osx (and possibly other posix systems)
I have created PR #71 to fix these issues.
Hi. I would like to let you know that after this commit 'Use texture ID with ImGui so that the calling texture pointer can go …' I can't see the images. Both Image and ImageButton were affected. Only the black square image place. Linux/Ubuntu.
Hi, tested on Mac Os X (probably same issue for Linux). This is used to work (I do not remember which old SHA1 but > 6 months)
if (ImGui::BeginMainMenuBar()) {
if (ImGui::BeginMenu("File")) {
if (ImGui::MenuItem("New", nullptr, false)) {
Here screenshots:
While following
Using both PollInputEvents()
and SwapScreenBuffer()
And using rlImgui's simple.cpp
example
I believe both issues are due to io.DeltaTime
being 0 since GetFrameTime()
is invalidated and cannot be used anymore when SUPPORT_CUSTOM_FRAME_CONTROL
is on.
Using raylib's GetTime()
and checking how other imgui's backends do it should be enough to fix it, I will experiment later.
Here is the full code:
#include "raylib.h"
#include "raymath.h"
#include "imgui.h"
#include "rlImGui.h"
int main(int argc, char* argv[])
{
// Initialization
//--------------------------------------------------------------------------------------
int screenWidth = 1280;
int screenHeight = 800;
SetConfigFlags(FLAG_MSAA_4X_HINT | FLAG_VSYNC_HINT);
InitWindow(screenWidth, screenHeight, "raylib-Extras [ImGui] example - simple ImGui Demo");
rlImGuiSetup(true);
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
PollInputEvents(); // SUPPORT_CUSTOM_FRAME_CONTROL
BeginDrawing();
ClearBackground(DARKGRAY);
// start ImGui Conent
rlImGuiBegin();
// show ImGui Content
bool open = true;
ImGui::ShowDemoWindow(&open);
// end ImGui Content
rlImGuiEnd();
EndDrawing();
SwapScreenBuffer(); // SUPPORT_CUSTOM_FRAME_CONTROL
//----------------------------------------------------------------------------------
}
rlImGuiShutdown();
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}
The code here:
Line 165 in fcb5486
and here:
Line 175 in fcb5486
clearly contains a copy/paste issue:
// line 163
bool shiftDown = rlImGuiIsShiftDown();
if (shiftDown != LastShiftPressed)
io.AddKeyEvent(ImGuiMod_Shift, ctrlDown); // COPY/PASTE ISSUE
LastShiftPressed = shiftDown;
// line 173
bool superDown = rlImGuiIsSuperDown();
if (superDown != LastSuperPressed)
io.AddKeyEvent(ImGuiMod_Super, ctrlDown); // COPY/PASTE ISSUE
LastSuperPressed = superDown;
I may be missing something, but I get this error when using AddFontFromFileTFF();
Assertion failed: g.IO.Fonts->IsBuilt() && "Font Atlas not built! Make sure you called ImGui_ImplXXXX_NewFrame() function for renderer backend, which should call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8()", file C:\Users\Electro\Documents\Visual Studio Projects\RelicEngine\includes\imgui\imgui.cpp, line 9645
Here is my code:
int main(void)
{
windowState = MainWin;
SetConfigFlags(FLAG_WINDOW_HIGHDPI);
InitWindow(windowSize.x, windowSize.y, "RelicEngine - v0.1-ALPHA");
// Setup Dear ImGui context
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
// Setup Dear ImGui style
ImGui::StyleColorsDark();
InitStyle();
// Setup Platform/Renderer backends
ImGui_ImplRaylib_Init();
markerBoldFont = io.Fonts->AddFontFromFileTTF("resources/fonts/BoldMarker.ttf", 30);
while (!WindowShouldClose())
{
// Poll and handle events (inputs, window resize, etc.)
ImGui_ImplRaylib_ProcessEvents();
// Start the Dear ImGui frame
ImGui_ImplRaylib_NewFrame();
ImGui::NewFrame();
switch (windowState)
{
case MainWin:
RenderMainWin();
break;
case ProjectCreationWin:
RenderCreationWin();
break;
}
// Rendering
ImGui::Render();
BeginDrawing();
ImGui_ImplRaylib_RenderDrawData(ImGui::GetDrawData());
EndDrawing();
}
Whenever I move the mouse over the resize grip of a window, I get the following warning:
WARNING: GLFW: Error: 65547 Description: X11: Standard cursor shape unavailable
Note that I am using ImGui v1.90.1 WIP (docking branch). Is there an easy fix for this?
Hi!
ImGui::IsMouseReleased(ImGuiMouseButton_Middle)
is not working. I think in static void ImGuiNewFrame(float deltaTime)
missing code:
io.MouseReleased[0] = IsMouseButtonReleased(MOUSE_LEFT_BUTTON);
io.MouseReleased[1] = IsMouseButtonReleased(MOUSE_RIGHT_BUTTON);
io.MouseReleased[2] = IsMouseButtonReleased(MOUSE_MIDDLE_BUTTON);
While this patch seems not fixing for me.
Can an example be provided on how to use docking + rendering things with Raylib? For some reason when docking is enabled it erases things in the background so the Raylib rendered stuff does not appear in the screen (same as https://gist.github.com/JeffM2501/4c3a7e8a85302f743f8bd9dc1aae00ae?permalink_comment_id=5060959#gistcomment-5060959).
Sprite& sprite = registry.get(editor.selected);
Texture texture = sprite.texture;
ImGuiIO& io = ImGui::GetIO();
ImTextureID my_tex_id = (void*)&texture;
float my_tex_w = texture.width;
float my_tex_h = texture.height;
{
ImGui::Text("%.0fx%.0f", my_tex_w, my_tex_h);
ImVec2 uv_min = ImVec2(0.0f, 0.0f); // Top-left
ImVec2 uv_max = ImVec2(1.0f, 1.0f); // Lower-right
ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); // No tint
ImVec4 border_col = ImVec4(1.0f, 1.0f, 1.0f, 0.5f); // 50% opaque white
ImGui::Image(my_tex_id, ImVec2(my_tex_w, my_tex_h), uv_min, uv_max, tint_col, border_col);
rlImGuiImageSize(&texture, 400, 400);
}
Imguis font atlas will work and render in the demo just fine. Why won't this work??
Hello. I encountered a nasty problem. When I run on a DRM platform, the console is flooded with the message:
WARNING: SetMouseCursor() not implemented on target platform
WARNING: SetMouseCursor() not implemented on target platform
WARNING: SetMouseCursor() not implemented on target platform
WARNING: SetMouseCursor() not implemented on target platform
WARNING: SetMouseCursor() not implemented on target platform
WARNING: SetMouseCursor() not implemented on target platform
WARNING: SetMouseCursor() not implemented on target platform
It happens because of this line
Line 104 in bd69c9b
I solved it for myself like this:
I removed the line
Line 104 in bd69c9b
Next, I declared a variable at the beginning of the file
static int monitor = 0;
and finally I added this line to the function
Line 270 in bd69c9b
monitor = GetCurrentMonitor();
After this modification, the notification is printed only when the program is started. I don't see how it will behave in the case of multiple monitors. I only have one monitor so I can't test it and that's why there is no RP either.
When I tried to draw some text on the 3D View window using DrawText, it did not draw the text on the 3D View window but on the main window.
e.g.
At the end of the update() in the editor example, I added a text like the following.
EndTextureMode();
DrawText("x", (int)x_label_pos.x, (int)x_label_pos.y, 20, WHITE);
It should have appeared on the 3D View window but wasn't.
Does anyone have a similar problem?
To add flags and title to window in ImGui, you can use: ImGui::Begin("Window", 0, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize);
, but there is no any arguments to do it in rlImGui.
I was trying to make some point-picking example code using GetMouseRay but it acted weirdly.
I just ported the following raylib example to the editor example to see if I can use a mouse click to pick a cube.
https://github.com/raysan5/raylib/blob/master/examples/core/core_3d_picking.c
It works somehow but there is some sort of mismatch between the clicked point that causes the trigger and the cube location on the screen. Probably, GetMousePosition() is not working properly.
It looks simple to fix though.
Just wondering if anyone already solved this problem.
Hey, any consideration on making this library available on vcpkg?
Prefer to keep my libraries easily accessible and simple to update than have to manually include and deal with downloads and files, especially when its unknown when there is a new release.
I'm not sure really were to post an issue about this but maybe someone here can point me in the right direction?
Basically, when I try to get the MousePos from the ImGuiIO object, I get nan
after building and static linking everything with a C compiler. However, if I get the MousePos inside rlImGui, compile that with C++ before statically linking, I get the right float value from MousePos.
i.e.
This issue seems to only effect these mouse properties too (like MousePos, MouseClickedPos, etc)
#include <stdio.h>
#include "raylib.h"
#define CIMGUI_DEFINE_ENUMS_AND_STRUCTS
#include "cimgui.h"
#include "rlImGui.h"
#define GAME_WIDTH 320
#define GAME_HEIGHT 180
int main(int argc, char **argv) {
(void)argc;
(void)argv;
InitWindow(800, 600, "Bug");
SetTargetFPS(60);
rlImGuiSetup(true);
while (true) {
if (WindowShouldClose()) break;
BeginDrawing(); {
ClearBackground(GetColor(0x181818FF));
rlImGuiBegin(); {
igShowDemoWindow(NULL);
ImGuiIO* io = igGetIO();
TraceLog(LOG_INFO, "MousePos: %f, %f\n", io->MousePos.x, io->MousePos.y);
} rlImGuiEnd();
} EndDrawing();
}
rlImGuiShutdown();
CloseWindow();
return 0;
}
It's pretty weird because if I write a simple layer like this in rlImGui.h and rlImGui.cpp:
void rlGetMousePos(float* x, float* y) { *x = ImGui::GetIO().MousePos.x; *y = ImGui::GetIO().MousePos.y; }
And then use this instead of getting the MousePos from the struct, then this returns the right mouse positions!
It's really weird.
Again, this only happens with these mouse related float values, all other float values in the struct seem fine?
Any ideas? And if this is not the right place to post this, where is?
Would this be helpful for the raylib integration? https://github.com/dearimgui/dear_bindings
When you click inside an ImGui window, that click should be "consumed" by ImGUI and not delivered to the app (ie: IsMouseButtonPressed()
should return false
after that).
ImGUI uses the flag WantCaptureMouse
to signal it wants to capture mouse movement and clicks, but rlImGui doesn't currently read this flag. This is explained in ImGUI's FAQ.
Same goes for keystrokes and the flag WantCaptureKeyboard
.
Note: This doesn't seem possible to implement on top of the current Raylib API, new API methods might be needed.
It is currently not possible to specify at which size the FontAwesome font is loaded.
In general, the way in which font loading is currently handled is somewhat unflexible, as the default font is always loaded (at the end of rlImGuiBeginInitImGui
), and the fontawesome font is also always loaded (at the start of rlImGuiEndInitImGui
). Maybe there should be flags which disable this default loading, so the user can load everything themself if they want to?
why not use cmake since raylib use it?
Description:
When switching the rlImGui backend, I've encountered a rendering issue where ImGui elements are not rendered beyond an invisible boundary or region which located bottom left of the screen as can be seen in below screenshoots. I've used minimal example that I took from simple.cpp also this issue persist across different setups such as editor.cpp or my own implementation, while still doesn't sure about root of the problem I suspect from underlying OpenGL implementation.
Reproductable Code:
#include "raylib.h"
#include "raymath.h"
#include "imgui.h"
#include "rlImGui.h"
int main(int argc, char* argv[])
{
// Initialization
//--------------------------------------------------------------------------------------
int screenWidth = 1280;
int screenHeight = 800;
SetConfigFlags(FLAG_MSAA_4X_HINT | FLAG_VSYNC_HINT);
InitWindow(screenWidth, screenHeight, "raylib-Extras [ImGui] example - simple ImGui Demo");
SetTargetFPS(144);
rlImGuiSetup(true);
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
BeginDrawing();
ClearBackground(DARKGRAY);
// start ImGui Conent
rlImGuiBegin();
// show ImGui Content
bool open = true;
ImGui::ShowDemoWindow(&open);
// end ImGui Content
rlImGuiEnd();
EndDrawing();
//----------------------------------------------------------------------------------
}
rlImGuiShutdown();
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}
Screenshots:
as the position changes rendered area/elements of the imgui window changes as well
Context:
OS: MacOS Ventura 13.5.2
Hardware: M1 Mac
Compiler: Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: arm64-apple-darwin22.6.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.