Skip to main content
GameDev.net gamedev.net
🔒 Locked

SDL & wxWindows?

Started by JPGargoyle Feb 21, 2005 at 10:24 AM 9 replies 2.7k views
Original Post
JPGargoyle
JPGargoyle
Hi! I'm starting a small game just for learning purposes and, since its a 2D game, I wanto to use SDL. The problem is that since I need some menus and other stuff, I started created them with wxWindows (included with the MinGW Developer Studio version I'm using). The problem is that I can find tutorials on wxWindows, and lots of tutorials on SDL, but I cannot find a single tutorial that teaches how to use SDL with wxWindows. Is it possible to do? And if so how? And how am I going to manage the events? using wxWindows or SDL? Thank you very much. Best regards
Rob Loach
Rob Loach
I don't have any experience using wxWindows. I've been looking for a GUI system for a while now as well. I've attempted to get some of these working, but had no success. You could have a go at using one of them. If you find one that works, give me a shout.
Rob Loach [Website] [Projects] [
JPGargoyle
JPGargoyle
Thank you Rob.

But since I am spending my (very limited) spare time to learn something new, its more useful to me to learn wxWindows, since it will allow me to develop other kind of applications and can be easily ported to linux.

Mabe I should try using the wxWindows opengl capabilities, but what I really am interested is in using/learning SDL and wxWindows. OpenGL will be a future step I'll take after getting some experience first in 2D and game loops and stuff like that.

I really am a noob in gamedevelopping, I'm still a begginer in c++, so I have to take a step at a time he he he.


Best regards.
Rob Loach
Rob Loach
I'm guessing to use the wxWindow OpenGL capabilities with SDL, you'd have to have OpenGL supported in the SDL project you're working on (...duh). I haven't really even experimented with doing stuff with the SDL/OpenGL combo so I'll have to try it out one day.

For the simple menu system in the engine I'm working on I'm just using a vector of strings along with a CurrentlySelected integer. I also have a state machine that I wrote to handle what code should be executed. It's looking pretty good.

... But I'd really like to get a GUI system working.
Rob Loach [Website] [Projects] [
JPGargoyle
JPGargoyle
Hi Rob!

What I want is to use wxWindows with SDL OR, since I cannot find how to do it, wxWindows with SDL, not SDL with OpenGl :P

I guess I'll end up by using SDL and will have to battle through "normal" windows programming to get my menus, or even have to quit the menus idea at all :(


Best regards
Ilici
Ilici
Tell us what you want to do. Here's a couple of ideas i have about what you'd want:

1. A game running in a window, with Windows style menus, toolbars, scrollbars, etc. and a central game window where you draw stuff with SDL.
2. A fullscreen SDL game with some Windows buttons, etc for a GUI

Now, what do you want to do with SDL? 2D graphics, 3D graphics?

Personally I use wxWindows with OpenGL in my game editor and SDL with OpenGL in my main game application.
JPGargoyle
JPGargoyle
Hi Ilici!

What I want is a window, with a menu, a status bar and (mabe) a toolbar, in wxWindows, and I want to draw the game content in that window using SDL.

I know I can use OpenGl with wxWindows, but since my game is 2D, I think it would be better to use SDL.

The main objective of me writing this game is to learn wxWindows and SDL.


Best regards
Rob Loach
Rob Loach
Quote:
Original post by JPGargoyle
The main objective of me writing this game is to learn wxWindows and SDL.

I'd suggest taking them on one at a time. SDL is a breeze, I haven't tried wxWindows.
Rob Loach [Website] [Projects] [
Kwizatz
Kwizatz
@JPGargoyle

Well, I know there is a OpenGL wxWidget, called GLCanvas, I've used it before, furthermore I know there is a gtk SDL widget, but my google searches for a SDL wxWidget turned nothing useful, I think you will have to go with some sort of game GUI, which brings me to:

@Rob Loach

Still looking for a GUI? I am working in mine, it's already LGPL, though there is still lots ahead, and I am the only one working in it, so progress is going slow, if you want, you can check it out.

Info on how to get it from CVS is in the front page of my site (Read "Site Hiccups") once you got it you can either compile with VC.NET 2003 or autotools, if going with autotools (MSYS or Linux) here is how it goes:

$ sh autogen.sh
$ ./configure --enable-sdlinterface --enable-sdlsample --enable-oglinterface --enable-oglsample --enable-d3dinterface --enable-d3dsample
$ make
$ sh sdlsample.sh
$ sh oglsample.sh
$ sh d3dsample.sh

the shell scripts at the bottom add the libraries path to the sample executables and then execute the samples so you dont have to copy stuff around.

anyway, if you're actually interested, contact me [smile], goes to anyone reading by the way [wink]
Toadhead
Toadhead
I wanted the same, and also searched for wxWindows tutorials etc. and use them with SDL. However I stepped out of it.

The reason? I think that if I spend a little longer learning SDL I should be able to make my own GUI.

I mean a textbox: (use SDL_TTF for this one), if you click on a specific field (rect), than GuiWriting = true; , if this is true and you press on buttons like g or y etc. than you will write (draw) the letters on the textbox field using some functions of SDL_TTF and all stuff will also be saved in a string called "TBstring" etc. Radiobuttons: if you click on the radiobutton area (also a rect) Rbutton will be set to "true" and the image of a emtpy radio button will be changed with an clicked one.

You should be able to write a simple GUI like this, only a drop-down menu will be difficult I guess.
Toadhead
Toadhead
Ow, this might be useful:
http://www.newimage.com/~rhk/SDL_gui/

Or some others of thse list:

http://www.libsdl.org/libraries.php?order=name&category=any&completed=0&os=any&match_name=gui&perpage=50

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.