I was messing around with SDL and found out that you cannot rotate images with SDL. Everywhere the question was asked, people said to use OpenGL to do rotation. I always thought that SDL was completely separate from OpenGL, am I wrong in thinking this? I even found tutorials for using OpenGL within SDL, which confused me even further. What exactly is the relationship between SDL and OpenGL? Why not just use OpenGL if its more powerful and allows you to do more (this is from what I've read)?
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.
Also note that the SDL renderer does not have to rely on OpenGL (it may use Direct3D on Windows).
SDL supports directx 11 and directx 9/10 renderers.
If you only want input and use raw opengl calls, glfw is the smallest option of the 3 (it also handles window/context creation for you if you want to). SDL and sfml are bigger packages that have more features available (sound, fonts, texture imports, some rendering abstractions).
SDL is a layer above OpenGL; in fact it uses GDI on Windows by default and also has a DirectX backend. People are probably saying you can use OpenGL to get around limitations of SDL on platforms that by default use OpenGL (ahem, Linux) because the higher level abstraction doesn't expose that functionality. However, then your code is "less" portable to Windows (or at least Windows using the GDI backend).
Also, SDL does a lot of other things besides graphics - audio, input, etc. that OpenGL doesn't do.
SDL is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, etc. It also supports 3D hardware via OpenGL.
OpenGL is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex three-dimensional scenes from simple primitives. OpenGL was developed by Silicon Graphics Inc. (SGI) in 1992[4] and is widely used in CAD, virtual reality, scientific visualization, information visualization, and flight simulation. It is also used in video games, where it competes with Direct3D on Microsoft Windows platforms (see OpenGL vs. Direct3D).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With