Anti-SFML SDL using C, when portability is important?

I read a lot on SDL and SFML, and, without a doubt, missed some information or do not understand. Here is what I learned:

  • SDL is currently standard (most popular)
  • SDL uses C and software rendering (which is slow?)
  • Does SDL fit into everything?
  • SFML is becoming more popular
  • SFML uses C ++ (but has C bindings) and uses hardware accelerated rendering (fast)
  • SFML will not be embedded in everything?

I need to use C and OpenGL for what I want to do. I also need to make sure that the program is as portable as possible. However, it cannot be slow.

What should I do?

+4
source share
3 answers

When using OpenGl with SDL, rendering is done by hardware, not software. I have never tried SFML, but the SDL is very simple and it is a mature library. Having written some OpenGl with SDL, the only problem I encountered is that it is not possible to have multiple windows with SDL. As for portability, my program ran on Linux, MacOS, and Windows. At the moment, I have no reason to switch to another library.

+5
source

SFML is a more mature library. It works well, perhaps even better than the SDL for Windows, Linux, Mac OS:

SFML is compiled on standard platforms such as Windows (98, 2000, XP, Vista) and Unix systems (Linux, Mac OS X). As the library grows, support for more operating systems will be added.

In addition, SFML supports hardware acceleration from the very beginning, while with SDL there are some doubts about it.

However, SDL now works on larger platforms, including mobile.

And using the C language, you cannot take advantage of all the object-oriented qualities of SFML.

So you should use SDL with C (or for mobile platforms) and SFML with C ++.


So you want to do 2D material? Do not rack your brains with OpenGL, just use SFML! It uses OpenGL and hardware acceleration inside for 2D.

+5
source

Since you are saying that you need to use C, I suggest you go with the SDL. When using OpenGL with SDL, it will be hardware accelerated. Only the software features of SDL 2D graphics will be in the software, but since you use OpenGL, you will not use them to draw on the screen.

SDL is quite portable, and SDL 1.3 (from svn or the archive on the main page) can also be compiled for Android, where you use OpenGL ES.

+2
source

All Articles