How about now? Any new SDL2 Gui kits around!?

Hello!
I’m sure this comes up now and then but I’m really struggling to find something that works well for my project so just wanted to throw this out here and hear if anyone was aware of any newer Gui projects for SDL!?

The things I need:

  • Compatible with kmsdrm rendering. (which I why glfw is not an option)

Things I’m hoping for:

  • Light weight.
  • C++
  • OpenGL/GLES2

Iv’e recently been taking Nanogui-sdl pretty far in in my project but only now realising that it doesn’t actually use the opengl contexts for HW rendering. It uses SW rendering so my Raspberry Pi4b gets stuck at intervals of 100% cpu use.

I wanted to go with SDL2 since I’m already using that for game gontrollers and sound and I knew it worked doing kmsdrm with it.

Is anyone aware of new good projects that might fit?

Cheers!

There’s Dear ImGui, which has an OpenGL backend (dunno if it does GLES2). You just include a couple of files in your project and off you go.

Oh yeah Iv’e seen that one but Iv’e been a bit put off by the ‘technical’ look of it. My program is a game related one so I want to try to make the look and feel a bit fun.

But maybe its possible to tweak imgui enough to get that more fun softer feel.

I’ll take another look at this as the nanogui road seems to have run out.
Thank you!

I can suggest Dear ImGui. We are using it in AAA game titles at my workplace for everything debug related. It’s fast and easy to use.

Oh yeah, Dear ImGui isn’t meant for the user-facing UI in your game. It’s meant for in-game tools, debugging utilities, that sort of thing. Though it can be highly customized (change font, change colors, use rounded window corners, etc). It definitely looks better without that… minimalist default monospace font.

NanoGUI (not NanoGUI-SDL) seems to have an OpenGL 3.3 backend, so maybe you could use that?

Unfortunatly Nanogui-sdl seems to be overriding the OpenGL with some other software rendering.
You can read about that in my thread here,

My program is a small one so I think I have a go and see how far I can push the look it might be enough.
Then the most important thing is the kmsdrm render so I’ll try that first.

It’s probably rendering in software to a texture or something because before 2.0.17 SDL didn’t have the capacity to render arbitrary polygons, and most of these kind of libraries work by building a list of vertices which can then be handed to whatever backend.

You should also take a look at Nuklear, which is another immediate-mode GUI library, and it has demo code for using it with SDL and OpenGL ES 2

For in-game GUI you could also look at MyGUI - its used as GUI lib in OpenMW and seems have SDL backend.

Iv’e played a bit with the Imgui example setting round corners and adding a more playful comic book style Font so I think if nothing else sticks I’ll go with that and add some fun colors or an image background.

Nuklear I have briefly checked out but I found it confusing and couldn’t figure out how I would do things like add Gamecontroller navigation. Or anything else for that matter. :smiley:

MyGui looks nice and seems pretty professional. I’ll have to try that one too. Though I see that its tied to Ogre so I’ll have to see if it can do just SDL2.
UPDATE: Yup there’s a setting in the CMakeList where you specify backend and I just got it to build without Ogre.