Menu bar, buttons, dialog boxes with SDL?

Hi,
I am currently working on a project, which is a Snake game written in c++ using SDL. Here's the link : http://sourceforge.net/projects/snake-hbios/

My problem is that I want to add a menu bar, buttons (real buttons, not made with SDL events), and also a text dialog box (to get player's name). I can't figure out what library to use, as it's impossible to do that with SDL. I found wxWidgets, and other libraries by scouting the net, but there are no real tutorials showing how to link them to an existing SDL project.

Can anyone who's been confronted with this issue tell me what's the best library to use, and maybe give out some code?

Thanks!
Last edited on
That's one of the issues I have with SDL -- it doesn't play nice with widgetry libs. Especially not OOP ones, since SDL only gives you one render context.

I found this [old] article which seems to illustrate how to get SDL+wxWidgets working together:
http://code.technoplaza.net/wx-sdl/part1/

I found this forum post asking about how to get SDL+Qt working together:
http://stackoverflow.com/questions/118659/how-do-i-use-qt-and-sdl-together
As you can see, they basically say "don't". He advises running Qt and SDL in totally separate processes and doing interprocess communication, which is extreme and difficult to do in a crossplatform way (kind of defeating half the point of using these crossplatform libs).



Personally, I would ditch SDL and switch to SFML. While a little more difficult to initially install and set up, is not only easier to use, but also plays very nice with other libs. In fact there are already existing classes you can use to bind SFML to both wx and Qt:

http://www.sfml-dev.org/tutorials/1.6/graphics-qt.php <- QSFMLCanvas

http://www.sfml-dev.org/tutorials/1.6/graphics-wxwidgets.php <- wxSFMLCanvas
Thanks for your answer!
Firstly, I had found the first article you're talking about, and as you say, it seemed a bit old, and didn't strike me.

I didn't know SFML, but I think I am going to use, if it is easier. And it seems to have all the features available with SDL, and more.

So thanks for the tip, it's very useful !
Topic archived. No new replies allowed.