Search code examples
c++user-interfacesdlmultiplatform

What library to choose to build a user interface for a C++ software that uses SDL


I have a simulation software (C++) that runs on the command line. It is platform independent (currently compiling and running on Windows, MacOS X and Linux). When the simulation ends, I visualize the result with SDL; it is a very basic 2d view, mainly color squares next to each other.

I would like to have a user interface on top of the simulation so that I can start and pause the simulation, and change the parameters on the fly. Something pretty simple I guess. Well, ideally I will also add a grapher somewhere to see the evolution over time of some parameters.

Now, I am wondering what direction I should go. Should I try to use one of the UI libraries for SDL ? Or maybe wxwidget in conjunction with SDL ? Or simply wxwidget and get rid of SDL ?

Do you have any experience with this ?

Thanks in advance Barth

PS: I tried to use AGAR, a SDL UI library. It seemed very promising but I couldn't get it working. Not even the helloworld.


Solution

  • Probably using wxWidgets without SDL would be the easiest way to go. SDL is a media layer -- it's supposed to allow cross-platform media application development. As you only need graphical display, you only need wxWidgets -- and it will be a lot easier too!

    You would benefit from SDL if:

    1. you'd need very fast blitting of very large amount of surfaces (we're talking the 60fps range here)
    2. you'd use RLE, color keying or other graphics operations
    3. you'd use other media (sound, advanced real-time input, etc)
    4. you'd need to run the software on embedded systems (handheld consoles, etc)

    If the answer to all 4 is "no", then you won't benefit from SDL, and using wx alone will be much easier.