Hi,
Thanks for this great job. I cloned the repository and compiled the opengl2 example on my Fedora 25 distribution. Compilation went with no issues but when I run the application I have my processor usage witch jumps to nearly 100%.
Have you experienced this before? What can be the problem and what is remedy/solution?
Regards;
Alexis.
The app must be running at maximum possible framerate. What's your framerate?
The GL/GLFW example do not attempt to setup vsync so the vsync behavior would depends on GLFW and/or system and/or drivers default. It's fine for measuring imgui perfs to run unthrolled (you should get very high framerate here). In your real OpenGL application you are more likely to limit your rendering to e.g. 60 FPS.
Hi,
Thanks for your prompt reply. The application is running around 63 FPS (please check screenshot here attached). Assuming that the frame rate or vsync are not set properly set, how can I fix this within the source files (and which file)?
I find that dear imgui is very efficient way to quickly create GUIs and I intend to use your library in my projects, I appreciate your help to fix this issue.

Either way unless you are running on a machine from 1992 or some weird VM, that output from the demo window would never take 16 ms with imgui.
The issue is rather in the example code and/or how GLFW handle swapping buffer and/or the underlying OpenGL driver. Something may be doing a polling loop. It could also be that your CPU measurement don't measure correctly for that sort of usage. Try to get basic OpenGL app running on your system and see if you get similar resolutions.
Hi Sir,
Thanks again for your help, hope that this discussion will serve to other users facing the same case. Regarding your message above, I am not running any virtual machine.
I am compiling the sources on a physical machine. My system is Linux Fedora 25 running on an AMD A8-5500 APU (4 cores) with 3 gigabytes of memory. All my system is up to date as per Fedora official repositories. I think my system specs are fine.
I compiled a simple opengl example as you suggested, and effectively I ran into the same high CPU resources issues.
The problem is not linked to dear Imgui library, and don't know how to fault find / debug this behavior. Its somehow sad cause I cannot use your great library which drastically simplifies c++ coding of GUIs. I attached below some info of my system which might help. Can you help or do you have a clue? (by the way I have the same behavior when compiling your opengl2 examples on a windows machine using Mingw compiler).
Here is the output of glxinfo | grep OpenGL:
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.9, 128 bits)
OpenGL version string: 2.1 Mesa 17.0.5
OpenGL shading language version string: 1.30
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 17.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
OpenGL ES profile extensions:
Here is the glfw library installed on my system:
Installed Packages
glfw.x86_64 1:3.2.1-1.fc25 @updates
The behavior when compiling and running a simple opengl example:

Haha, that system monitor app IS the cause of the high cpu usage. Try using the command line "top" or "htop".
It is clearly written in the glxinfo log file.
llvmpipe is the software renderer of mesa3d.
Hi,
Just to answer paulsapps, no its definitely not the system monitor which is causing the high CPU usage, because simply CPU goes back to normal when I close the Imgui window.
Regarding phicore, what is the drawback of software renderer? And what is the best workaround in Linux systems?
Last, I have introduced a delay for 100 ms in the endless loop of the main program given in the opengl2 examples. This has reduced the FPS down to 8 frames/sec and though the CPU usage was cut by half (almost 50%). Is this a good way to decrease the FPS? Can you consider this as a workaround? Any suggestions please?
Alexis.
try a profiler to see where the most cpu is being used.
Alexis, in this day and age using a software renderer on a PC is rather unusual. You may be missing drivers for your graphics card.
Thanks anyway, for my linux machine I will check the drivers on Fedora site for my GPU. On Windows (Mingw compiler), I added a delay of 20ms in your while loop, the frame rate decreased from 520 to 60 FPS and CPU load is back to normal.
Closing this, looking good :)