SDL and UI

Started by
17 comments, last by let_bound 16 years, 10 months ago
Hi all! I would like to make a 3d editor like application with menus, dialog boxes, etc. im currently using SLD... is there any cross platform UI solution? why not include UI features into sdl? thx [Edited by - golgoth13 on June 7, 2007 3:57:28 PM]
Advertisement
Quote:why not include UI features into sdl?


SDL is a layer that abstracts system window management, input and graphics. Given this, it wouldn't be of much sense to put effort into making an UI, instead of focusing on the really important stuff.
not important? SDL_UI will do just fine... extend the possibilities... one library to develop application on any platform... cant you see it?!
Quote:Original post by golgoth13
not important? SDL_UI will do just fine... extend the possibilities... one library to develop application on any platform... cant you see it?!


There are quite a lot of GUI toolkits built on top of SDL. Guichan and ParaGUI are apparently popular.

If you want something that'll make use of a 3D API, you'll probably want to go with something like CEGUI or some engine with a toolkit (like, eg, Irrlicht). They aren't related to SDL though.

Finally, if what you want is to get SDL to render to a 3rd party toolkit's windows like you would with, say, DirectDraw and MFC, you're going to have a hard time. It's possible with the SDL_WINDOWID hack, sometimes. Such portable libraries include Qt, wxWidgets, FLTK, the FOX toolkit, Ultimate++ and Gtk+, for example.
Oh... that is good information... I can almost see the light... must choose one lib now... I ll look at them closely... any advantage of using one lib in particular? window, mac and linux would be fine.

Quote:
If you want something that'll make use of a 3D API


im not sure what u meant there... I do have a 3d engine using opengl in a sdl framework... I don’t need any 3d ui if this is what you are saying... but all other 2d widgets are what I need...

im going to look at SDL_WINDOWID hack... interesting... but still hard to believe we have to hack such thing...
Quote:Original post by golgoth13
Oh... that is good information... I can almost see the light... must choose one lib now... I ll look at them closely... any advantage of using one lib in particular? window, mac and linux would be fine.


I think Guichan is the most popular of them all, but it largely depends on your needs. I don't think any of them will be able to handle CJK or RTL languages. Most of them probably don't handle Unicode either.


Quote:
Quote:
If you want something that'll make use of a 3D API


im not sure what u meant there... I do have a 3d engine using opengl in a sdl framework... I don’t need any 3d ui if this is what you are saying... but all other 2d widgets are what I need...


If you want a GUI that'll be 2D but rendered by OpenGL, then CEGUI is probably what you're looking for. If, OTOH, you want something that looks like regular Win32 controls (on Windows, anyway), then Qt, wxWidgets, etc, are what you're looking for.


Quote:im going to look at SDL_WINDOWID hack... interesting... but still hard to believe we have to hack such thing...


I think SDL 1.3 will fix that, but it's not production-ready yet. It's a problem for many people, but then again SDL wasn't meant for tools, and I suspect it's victim of its success. [smile]
There's one written in C that works with OpenGL under SDL or SDL native for that matter. It's AGAR and it seems to be very powerful... if you can get it to build from the source using the autoconf-based configure scripts.
thx for your inputs guys... I really appreciate it.

then again... im a little confused... I did compile wxWidgets successfully and implement it into my project... my framework being sdl... let say I want a standard File->Open menu... can I expect it to work in or on top of my SDL window? or do I need to embed the SDL window within a wxWidgets context?

or like samuraicrow mentioned, use something like Agar being SDL native would be much easier? can anyone help me clear this up?
I ve been looking at Agar Lib and it seams interesting indeed... the only problem is I ve been in the dark for a long time regarding the make file technique... even though I see this all over... I have no idea how it works... here is what the install note looks like:

Quote:
Build and install the Agar library:

$ ./configure [--help]
$ make depend && make
# make install
$ agar-config --version
1.0-beta
$ cat config.log | mail -s "compiles ok" report@agar.csoft.org

…SNIP

In the Agar root directory we have the files:

configure
configure.in
Makefile
Makefile.config

Have tried to execute them via cmd… didn’t do anything… there is no VS project to build... honestly, I have no clue what to do with this... seams like everyone on the planet knows how to but me... if it is not too much trouble, any help would be greatly appreciated.

thx again
Quote:Original post by golgoth13
let say I want a standard File->Open menu... can I expect it to work in or on top of my SDL window? or do I need to embed the SDL window within a wxWidgets context?


You'll have to tell SDL to render to a wxWidgets widget, which is exactly what the aforementioned SDL_WINDOWID hack is meant to do. I wish you good luck with it though, as it's quite tricky.


Quote:or like samuraicrow mentioned, use something like Agar being SDL native would be much easier? can anyone help me clear this up?


I suspect it would be easier to set it up. I don't know if it'd be easier to use in a large project though (I've never used Agar). Since you're using OpenGL, I'd go with CEGUI and be done with it, although the learning curve is probably steeper. A lot of people here seem to use it, so I'm sure it has Visual Studio project files.


Quote:Have tried to execute them via cmd… didn’t do anything… there is no VS project to build... honestly, I have no clue what to do with this... seams like everyone on the planet knows how to but me... if it is not too much trouble, any help would be greatly appreciated.


There is apparently no support for VS out of the box. I suppose it's meant to be using with MinGW or the Cygwin version of GCC in either MSYS or the Cygwin shell.

Maybe is it as simple as creating a new DLL project, adding all the source files to it and linking against SDL, SDL_image, etc. Maybe not. The only moment I use Windows is to make sure my software ports correctly, and I usually don't work with C++ (and when I do, I use the MinGW or Cygwin port of GCC), so I can't be of much help there.

This topic is closed to new replies.

Advertisement