SDL better for beginner ?

Goomba
Unregistered
 
Post: #1
I am trying to find tutorials that use C with Opengl, but no luck. If someone knows a site that would be good. I read that SDL handles the graphics, so you do not need to know opengl, it is already done for you, just have to write some code.

Is it better to use for a game or is it better to use OpenGl. I want to start 2d games first then make a 3d one.

And has anyone had success using SDL? What is the pros and cons.

thanks for you thoughts, if you have a brain in your head that is.Wink
Quote this message in a reply
Member
Posts: 254
Joined: 2005.10
Post: #2
SDL is fairly easy to use, although I haven't tried its 2D graphics engine. If you have the time you should learn to use Open GL, its good to know and basic stuff isn't too difficult. SDL will provide the 'window management' part of that so once you figure out how to set up SDL for Open GL you can concentrate on the game itself. Some helpful links for SDL and Open GL:

http://www.libsdl.org/opengl/index.php
http://www.meandmark.com/sdlopenglpart1.html
Quote this message in a reply
Moderator
Posts: 680
Joined: 2002.11
Post: #3
4th or 5th result on Google for "opengl c tutorial" is http://nehe.gamedev.net/, which has an excellent set of OpenGL C tutorials, in case you wanted to try to get back to your original objective. Otherwise, Blacktiger's information is good.

My web site - Games, music, Python stuff
Quote this message in a reply
Moderator
Posts: 698
Joined: 2002.04
Post: #4
Quote:I read that SDL handles the graphics, so you do not need to know opengl, it is already done for you, just have to write some code.

This is incorrect/a misrepresentation of how SDL works with OpenGL; you either use the graphics routines of SDL, or you use SDL to create an OpenGL context and then use OpenGL calls; SDL does not provide a layer over OpenGL. In either case, you can use SDL for user input, audio, etc.

The graphics routines of SDL are incapable of 3D, and are quite limited when it comes to 2D - they're incapable of FX such as rotation or scaling, for example, unless you code it yourself or use a library like SDL_gfx - but they are fast enough for 2D.

Mark Bishop
--
Student and freelance OS X & iOS developer
Quote this message in a reply
Post Reply