Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm trying to make a platform game in 2D and I want to know what tool should I use to make it happen. I understand that I can use SDL with openGL. However, if I want to make a solid 2D platform game, should I use SDL? Or, openGL?

share|improve this question

closed as off topic by Josh Petrie, Kylotan, Maik Semder, Byte56, Sean Middleditch Jan 3 '13 at 18:53

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
OpenGL is low-level enough that when in doubt, just use SDL. –  Cardin Jan 3 '13 at 16:10
2  
Hello, and welcome to GDSE. This is a "which technology to use" question, which is considered off-topic for the site. Please see the FAQ for more details. –  Josh Petrie Jan 3 '13 at 16:27

2 Answers 2

up vote 2 down vote accepted

If you want a lot of fancy effects and sprites on the screen at once, use OpenGL because it supports shaders and is hardware accelerated. If your game is simple and doesn't need a lot of effects or sprites, stick with SDL, especially if it's your first game. SDL isn't hardware accelerated, but it's much easier to use.

Note that if you are going to use OpenGL, you can actually use SDL for everything but graphics at the same time. Other cross-platform windowing libraries that support OpenGL include:

  • FreeGLUT - a free implementation of GLUT, which is older and well-documented
  • GLFW - similar to FreeGLUT, but more modern (I use this one)
  • SFML - this one is a bit more heavyweight, but it's also object-oriented
share|improve this answer
    
Thank you! I started a doing openGL tutorial weeks ago at lazy foo's website. Good thing I asked today because I stumbled upon SDL and was confused which will be suitable for me. –  cyberspace009 Jan 3 '13 at 16:34

OpenGL is for rendering polygons on the screen and SDL provides low level access to hardware like joysticks and mice. SDL also provides access to the video frame buffer.

I would suggest you use SDL for hardware stuff and OpenGL for drawing and stay away from the video frame buffer. It's easy enough to create an orthographic projection and position the camera so it's always pointing down at your scene. If you don't want to use polygons you can always use a textured quad as a sprite. This gives you all the power of OpenGL(rotate, while maintaining your 2d platform game feel.

You might also take a look at love2d.org

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.