Using SDL for window Creation?

Started by
12 comments, last by Icefox 18 years, 10 months ago
I am wondering if there is any disadvantage to using SDL for window Creation even if my game uses directX for all the graphics rendering. Right now I am creating my window using all that windows api garbage. it seems rather convoluted just to create a window. Can you easily make a GUI with SDL?
These tears..leave scars...as they run down my face.
Advertisement
I made 3 sdl windows with a thomson book on sdl and all 3 wouldn't work for me
I know sdl prolly works for most people
I just had bad experiance with it
----------------------------------------------------------feed a man a fish and you feed him everydayfeed a man a poisened fish and you never have to feed that man again
SDL generally expects to have one window and only one window. It may be possible to make more, but I haven't tried, and it would probably be rather strange to do.

You can NOT mix SDL and DirectX. It's not a situation of one handles the drawing and the other handles the windows, it's a situation of each trying to do everything itself; drawing, window-management, sound, the whole shebang.

There are GUI packages for SDL out there, but they aren't wrappers for the Windows API, they're entirely new GUI's, meant to be drawn as part of a game. If you want a Windows-ish GUI without the Windows API, look at other GUI toolkits like GTK, wxWindows, TK, things like that.
-----http://alopex.liLet's Program: http://youtube.com/user/icefox192
Both the original poster and Icefox might want to read this.

Direct3D 9.0 with SDL
Quote:Original post by Kylotan
Both the original poster and Icefox might want to read this.

Direct3D 9.0 with SDL


The whole purpose of SDL is to have a portable application.
If you use DX and SDL, you are kind of.. well, defy the purpose of SDL.
Why not just use OpenGL with it?
Quote:Original post by Raduprv
Quote:Original post by Kylotan
Both the original poster and Icefox might want to read this.

Direct3D 9.0 with SDL


The whole purpose of SDL is to have a portable application.
If you use DX and SDL, you are kind of.. well, defy the purpose of SDL.
Why not just use OpenGL with it?


Because some people prefer DirectX over OpenGL, but they despise the Win32 API, so they look for easier solutions (SDL, or they write their own wrappers (however this is time-consuming, and why not just use something that's already there?)). Also, just because SDL is cross-platform doesn't mean you HAVE to use it's crossplatform capabilities, and somebody who preferes DirectX obviously isn't too interested in cross-platform work.

SDL's API is pretty similar with the Win32 API (it's procedural, for example). I can't see how you can hate Win32 but like SDL.
^^^^^^^^^^^
I have heard that with sdl you can create a window with just one or two commands
These tears..leave scars...as they run down my face.
Quote:Original post by Raduprv
SDL's API is pretty similar with the Win32 API (it's procedural, for example). I can't see how you can hate Win32 but like SDL.


Well, mostly it's because SDL only takes about 2 lines of code to get a window up on the screen (well, 3 if you count declaring an SDL_Surface), wheras with the Win32 API it takes a couple of hundred lines to do the same thing (unless you're using MessageBox, but you can't use that with DirectX). Sure, they're both procedural, but one looks nicer and takes less code, and the other one takes up lots more space and looks rather cryptic to the majority of people.
Yes, but most of the programmers already have a copy and apste ready code to create the basic stuff (set up an window, get the surface, etc.)
And, unless it's a quick prototype, your init code is far, far smaller than the rest of your code.

This topic is closed to new replies.

Advertisement