I've been working on a 2D game using SDL. I've noticed the objects look blurry and glitchy when they're moving, so I was thinking about using OpenGL to render the graphics. Would this help? What are the pros and cons of using OpenGL for a 2D game?
If you're having slowdowns and glitches with SDL software rendering in a 2D game, chances are very slim that OpenGL is going to do anything for you. SDL can run 2D games quickly on a Pentium II or even lower spec machine. In other words, there are problems inherent to how you are making your draw calls. I've had no problems with speed in SDL rendering, and I've written a pure scanline renderer, which is far more intensive than working with sprites.
Two approaches I suggest:
Pull out bits of your rendering code, methodically, until you see a speed increase. If you pull out one section and see a drastic speed increase, then pull out smaller pieces within that code section (where possible). If you pull out all of your rendering code (i.e. it's rendering nothing), and it's still slow, then you have problems with your game loop timing. In that case, see Fix Your Timestep.
Profile your code. If you are running under Linux, you can happily take advantage of the Valgrind suite of profiling and debugging tools. If you're under Windoze with MinGW or Cygwin, and you really want to profile, you can run your app with gdb and interrupt it, to manually take stack samples (leading you to see in which functions most of your time is being spent) -- see this for more info. This is because gprof, the profiler that comes with gcc/g++, is not very good... at least for real-time games it's next to useless.
SDL uses OpenGL for its rendering, they just wrap there code in methods / free functions, so using "OpenGL" vs SDL will give you ultimately the same result, the only difference being that using OpenGL directly will give you more control over your rendering, sometimes this can be helpful as many older libraries use older OpenGL functions for rendering instead of newer standards e.g. ( a older library might use glBegin and glEnd instead of glDrawArrys or glDrawElements ), so in theory i would say yes, using OpenGL directly might improve performance, but in reality i highly doubt its the SDL rendering pipeline getting too much overhead and more possibly the way you are iterating over object in your scene, especially if you aren't optimizing your use of matrices depending on how many object you have in a scene at a time,
I hope this helps see, sorry this answer is so late (=