Page 1 of 1
API - SDL or OpenGL?
Posted: Sat Feb 27, 2010 12:06 am
by Bullet Pulse
Hi, I've recently finished a book on C++, and I feel that it's time to gain knowledge in an API. I am a pretty hardcore programmer, so it's not like I'm just doing it as a hobby, but more like whenever I have time to. So obviously, I'm looking for the better API to learn. Yes, I have looked at the specifications of the APIs, but I want to know others' opinions on the subject, specifically those who have some experience with both APIs.
Re: API - SDL or OpenGL?
Posted: Sat Feb 27, 2010 1:42 am
by davidthefat
Bullet Pulse wrote:Hi, I've recently finished a book on C++, and I feel that it's time to gain knowledge in an API. I am a pretty hardcore programmer, so it's not like I'm just doing it as a hobby, but more like whenever I have time to. So obviously, I'm looking for the better API to learn. Yes, I have looked at the specifications of the APIs, but I want to know others' opinions on the subject, specifically those who have some experience with both APIs.
both, try OpenGL on rendering and SDL with all the other stuff that opengl cant do
Re: API - SDL or OpenGL?
Posted: Sat Feb 27, 2010 2:49 am
by K-Bal
I recommend to use SFML. You will gain the benefits of OpenGL with a nice and easy OOP interface, plus you can still use OpenGL directly. Also you get all the Network, Audio and Windowing stuff on top.
Re: API - SDL or OpenGL?
Posted: Sat Feb 27, 2010 4:37 am
by Busy_V
Before jumping into OpenGL I would recommend you to learn SDL first. Why? OpenGL is, or so I think, a lot harder to learn than SDL. Thus, it is also a lot more powerful than SDL. So, I would suggest you to learn first SDL and then continue with OpenGL. You don't just jump into the game development, you need to have patience to learn all the things, from ground up.
Some links that you may find useful (or not):
SFML
Guides & resources
Re: API - SDL or OpenGL?
Posted: Sat Feb 27, 2010 8:31 am
by Lord Pingas
Learn SDL first then use OpenGL's rendering with SDL as you get more advanced in 2D games.
SDL is great for beginners in game development, and has quite a good amount of tutorials dedicated to it, like Lazyfoo.
When you want to move into 3d use OpenGL and GLUT.
GLUT handles windowing, input, and all the other stuff OpenGL can't do. I'm not to sure if GLUT has a sound library though.
Re: API - SDL or OpenGL?
Posted: Sun Feb 28, 2010 12:40 am
by TheBuzzSaw
OpenGL and SDL are not mutually exclusive of one another. SDL is a windowing API that handles device input, timers, threads, system signals, etc. OpenGL is nothing more than a 3D graphics API.
When using SDL, you have two choices for rendering. You can either use SDL's built-in 2D rendering system (all based on OpenGL anyway, though it supposedly can use DirectX's system too), or you can open a 3D rendering context and hand all control over to OpenGL itself.
SDL is a great choice in that it provides all the tools you need to build cross-platform games. The SDL_image module will load virtually any image format (great for loading textures in 3D). The SDL_ttf module will convert text to graphics. The SDL_net module will enable network communications. The SDL_mixer module will give you sound.
If you are going to make a really simple and straightforward 2D game, stick with SDL's basic 2D rendering model (surface blitting). If you want to make a 2D game more along the line of Elysian Shadows (complete with zoom, rotation, etc.), use OpenGL.
Either way, use SDL as your base. It is a solid library.
Re: API - SDL or OpenGL?
Posted: Sun Feb 28, 2010 9:16 pm
by eatcomics
TheBuzzSaw wrote:OpenGL and SDL are not mutually exclusive of one another. SDL is a windowing API that handles device input, timers, threads, system signals, etc. OpenGL is nothing more than a 3D graphics API.
When using SDL, you have two choices for rendering. You can either use SDL's built-in 2D rendering system (all based on OpenGL anyway, though it supposedly can use DirectX's system too), or you can open a 3D rendering context and hand all control over to OpenGL itself.
SDL is a great choice in that it provides all the tools you need to build cross-platform games. The SDL_image module will load virtually any image format (great for loading textures in 3D). The SDL_ttf module will convert text to graphics. The SDL_net module will enable network communications. The SDL_mixer module will give you sound.
If you are going to make a really simple and straightforward 2D game, stick with SDL's basic 2D rendering model (surface blitting). If you want to make a 2D game more along the line of Elysian Shadows (complete with zoom, rotation, etc.), use OpenGL.
Either way, use SDL as your base. It is a solid library.
I've been meaning to ask, would anyone be able to tell me whether I'd be better off with SDL for networking and sound and input, or SFML?
I've been trying to decide for a few days now, and this is the perfect place to ask I would imagine... Because Bullet Pulse might also be interested in this question :D
Re: API - SDL or OpenGL?
Posted: Sun Feb 28, 2010 9:59 pm
by TheBuzzSaw
My needs are generally very simple, so I just stick with all SDL components. SDL_net is a separate module, so it is harmless to use a different networking API.
As for the input, I do not recommend mixing APIs unless you have some tutorial explaining how to do so. Having SDL run the window but not manage input... I'm not sure if that's even possible, but Google may know otherwise.
I've heard of others using OpenAL instead SDL_mixer and using Boost threads instead of SDL threads.
Re: API - SDL or OpenGL?
Posted: Sun Feb 28, 2010 10:55 pm
by eatcomics
TheBuzzSaw wrote:My needs are generally very simple, so I just stick with all SDL components. SDL_net is a separate module, so it is harmless to use a different networking API.
As for the input, I do not recommend mixing APIs unless you have some tutorial explaining how to do so. Having SDL run the window but not manage input... I'm not sure if that's even possible, but Google may know otherwise.
I've heard of others using OpenAL instead SDL_mixer and using Boost threads instead of SDL threads.
That wasn't directed at me was it? I'm not talking about mixing APIs, just whether I should use OGL with SDL, or OGL with SFML...