SDL vs. Plain OpenGL..

Started by
8 comments, last by kaysik 19 years, 2 months ago
Hey all, I have next to no experience with 3D programming, and now trying to get into it. I intent to create simple 3D games (for start), just for fun of learning something new, but later on, I'd like to get into Game development business.. My question is: Is it better to start off with plain OpenGL learn as much as possible or with a library such as SDL? I already have good programming experience. Thanks for advice.
You were born an ORIGINAL don't die a COPY...ASCENT SYSTEMS
Advertisement
try http://nehe.gamedev.net for OpenGL
and
try http://cone3d.gamedev.net for SDL

then make a decision [smile]

if you have decent programming experience then neither should be a big problem for you.

Beginner in Game Development?  Read here. And read here.

 

gl and sdl are mostly compliments to each other. use them both.
You need code to set up the window OpenGL renders to. There is no such thing as "plain OpenGL".

Use SDL to set up your window, it's easy and automatically works on multiple platforms. The alternatives are: GLUT or system API calls.
Quote:Original post by Trap
You need code to set up the window OpenGL renders to. There is no such thing as "plain OpenGL".

Use SDL to set up your window, it's easy and automatically works on multiple platforms. The alternatives are: GLUT or system API calls.


Or you can take a look at GLFW. It is more advanced than glut and takes care of all the basics more than SDL does. If you are going to do all of your programming in OpenGL, you might as well use a OpenGL library rather than do it through SDL. It would be much faster and more efficient and is cross platform as well. If you want to get a look at a simple GLFW framework, take a look at my post here.

To answer your question, you cannot use SDL, GLFW, or GLUT to learn OpenGL for they are just librarys that set it up for you. All Opengl code will work in either library and then through using Win32. It is just a matter for you to decide how fast you want to get up and running. From experience, I know that you will be able to get up and running with SDL in no time. ALl you do is download, install, and your ready. With GLUT it is the same way, but it has a different design model for making games. GLFW will give you troubles setting up, but once you get it built and start using it, it really is a breeze compared to Win32.

These are just my opinions on the matter. Hope it helps.

- Drew
Than all of you for your opinions and suggestions..
I've tried NeHe's site and it's indeed briliant.
At the moment I'm trying to collect as much information as posiible about "realm of 3D development", before jumping into programming itself. I want to uderstand the background.
And what do you think about OpenSceneGraph (OSG)? It seems to be powerfull framework, but I'm afraid it might be a bit confusing for a beginner, who needs to understand the essence of 3d programming..

Thank you again for your opinions.
Yanco
You were born an ORIGINAL don't die a COPY...ASCENT SYSTEMS
I have never really used OSG but once when I helped someone set it up. From what I saw, you should stay away from it. I do not think you could possible learn 3D from it. That opinion is very biased, I know, but from my own experience, using a graphics library that sets up the graphics framework, such as glut, glfw, sdl, is much better because you still have to do all of the 3D drawing yourself.

Overall I say go for the 3D from Nehe as well as UGP. I think that would be in your best intrestes.

- Drew
Quote:Original post by Drew_Benton
Or you can take a look at GLFW ... If you are going to do all of your programming in OpenGL, you might as well use a OpenGL library rather than do it through SDL. It would be much faster and more efficient and is cross platform as well.


Have you ever used SDL? SDL is simply a window lib when used with hardware acceleration. You still use OpenGL directly when running an SDL app, all SDL does it setup the window so you don't have to muck round with that stuff. SDL will NOT slow down OpenGL at all (because its not a wrapper for it), and SDL is also crossplatform so both your statements against it are incorrect.

So I would suggest useing SDL because its a really nice and easy way to setup a window on almost any system (windows, *nix and mac are all supported I believe) then you use OpenGL for your actual graphics. My current project uses SDL and the exact same code with no #ifdefs or anything compiles on Windows and Linux - its great! SDL has also been used in comercial games (some of the Ureal Tournament's used it for their linux port) so its profeshinal quality.

SDL does have some 2D drawing functiosn in-built, but don't get that confused with useing OpenGL ... I've never used any of SDL's native drawing stuff but I use it for OpenGL all the time and its great. SDL opens a window, opengl draws stuff two it - the two are complimentary not overlapping. I have used glut but I mich prefer SDL. If you don't use SDL (or glut or something) you'll have to write native code to setup windows which is a huge pain in the ass and is a big distraction from actually coding up your games!
If you aren't using SDL for drawing and you really are using OpenGL, then I would recommend GLFW over SDL. It is small, light, and very crossplatform.

On my computer libSDL.so ~ 500 kb whereas libglfw.a ~ 60 kb, this doesn't really matter on *nix but it does on windows. GLFW is also realized under the zlib license which gives you more freedom. But SDL is more widespread, this is more a problem on *nix because the user should have the library installed, but on windows you usually statically link with or distribute a DLL with your package anyway. I still would choose a GL framework over SDL if you weren't using SDL's drawing routines. But SDL has a lot of supporting libraries for image loading, sound, network.Also might check out OpenGL Window Framework (OGLWFW) and you can ask _the_phantom_ if you have any questions. Please don't use GLUT.
I'll have to check out GLFW someday ... just went and had a little look at the docs and it looks nice. Personally I think i'll stick with SDL in the long run though because i [a] know it, use some of the SDL extension libs and [c] don't feel like porting all my code over :D

This topic is closed to new replies.

Advertisement