Coldzer0 / ImGui-Pascal

ImGui Binding for FreePascal / Delphi with the latest version & docking
MIT License
63 stars 13 forks source link

Looks promising, though concerned about CPU usage with software rendering #3

Open bogen85 opened 1 month ago

bogen85 commented 1 month ago

I've not played with the code yet. Just ran the ImGui_SDL2_OpenGL3_Demo on Linux64.

I'm inexperienced with ImGui in general. I played with it some C++ and had high CPU usage, but that was also with software rendering, and I put a significant delay in the event loop so it was only 4 FPS to get the CPU down.

Looking at your example though give me hope, for a few reasons.

Hardware rendering GPU: Intel CoffeeLake-S GT2 [UHD Graphics 630] image image

Software rendering CPU: Intel i9-9900K (16) @ 5.000GHz image image

Coldzer0 commented 1 month ago

Hello @bogen85

I have yet to test the CPU rendering on Linux, but I remember talking to one of my friends on Discord about that. Someone also talked about it in the official imgui repo, and they solved it.

I'll test it on Windows first, see how it performs, and maybe add an FPS limiter.

I hope this repo helps you learn more and lets people know that Pascal is not a dead language.

Regards.

bogen85 commented 1 month ago

Yeah, 30 FPS rate limiting would be great!

# for software
LIBGL_ALWAYS_SOFTWARE=1 ./ImGui_SDL2_OpenGL3_Demo

# for hardware
./ImGui_SDL2_OpenGL3_Demo
bogen85 commented 1 month ago

FPC targets WASM https://wiki.freepascal.org/WebAssembly/Compiler

And Android https://wiki.freepascal.org/Android#Android_target

And ImGui is making progress on both those targets, which is another reason why ImGui-Pascal gives me hope for some upcoming personal projects, and I was really wanting to use modern and free Object Pascal instead of C++ (yes, also, modern and free...)