Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dear Imgui
#1
One of my students has been using this on their project I must say it looks rather nice now that I've seen it in action.
Its not massively hard to set up but it does need a bit of effort... Once done though, it gives a very cool input system you can use to set up values/variables in game via a very nice usable menu, scroll bar system

https://github.com/ocornut/imgui
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply
#2
To get it working you only need the base imgui files, and the imgui_imp_opengl3.h version header, to get ES2.0 you need to uncomment the IMGUI_IMP_OPENGL_ES2 value which is in imgui_imp_opengl3.h

You will need to provide key and mouse data to it, in its frame update, be sure to set your mouse pos info correctly depending on screen/window size. Since our keys and mouse are on a thread its not a problem to feed it the mouse and key data from an input handler as normal. I wouldn't give it its own input handler though, try to only use 1

Then there is 1 final problem where it has a slight issue with some GL3 flags not supported by ES2 but you can hard code them to allow it to compile.
last_blend_equation_rgb and last_blendequation_alpha, expect to be set by an interrogation of the API, but it will never return a valid value (we don't have opengl3), so just set them to GL_FUNC_ADD (or NULL???) For sure they are supposed to do something but so far I've not found out what .

If you are doing an engine or need a lot of menu/setup input its excellent, but for general gui use in game be careful, its not especially fast, and can drag your frame rate down quite a bit.
There's plenty of examples in the github to show you how to use it. Have fun!

props to my student David van Scheppingen for introducing this to me and doing the groundwork to get it working on Rpi
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)