When using OpenGl with SDL, rendering is done by the hardware, not in software. I never tried SFML, but SDL is very simple and it is a mature library. Having wrote some OpenGl with SDL, the only problem I faced is that it is not possible to have multiple windows with SDL. Regarding portability, my program worked on Linux, MacOS and Windows. For the moment, I don't have any reason to switch to another library.
SFML is a more mature library. It works well, probably even better than SDL on Windows, Linux, Mac OS:
SFML compiles on standard platforms like Windows (98, 2000, XP, Vista) and Unix systems (Linux, Mac OS X). As the library grows up, support for more operating systems will be added.
Also, SFML has been supporting hardware acceleration from the start, whereas with SDL there are some doubts about that.
However, SDL works on more platforms right now, including mobile ones.
And using C language you may not benefit from all the object-oriented goodness of SFML.
So you should use SDL with C (or for mobile platforms) and SFML with C++.
So you want to do 2D stuff? Don't break your head with OpenGL, just use SFML! It uses OpenGL and hardware acceleration internally for 2D.
SDL 非常便于移植,SDL 1.3(来自 svn 或主页上的存档)也可以针对使用 OpenGL ES 的 Android 进行编译。
Since you say that you have to use C I would suggest you go with SDL. When using OpenGL with SDL it will be hardware accelerated. Only the SDL 2D graphics functions will be in software but since you use OpenGL you won't use them to draw anything on the screen.
SDL is pretty portable and SDL 1.3 (from svn or archive on the homepage) can also be compiled for Android where you use OpenGL ES.
发布评论
评论(3)
当将 OpenGl 与 SDL 结合使用时,渲染由硬件完成,而不是由软件完成。我从未尝试过SFML,但SDL非常简单,而且是一个成熟的库。使用 SDL 编写了一些 OpenGl 后,我面临的唯一问题是不可能使用 SDL 拥有多个窗口。关于可移植性,我的程序可以在 Linux、MacOS 和 Windows 上运行。目前,我没有任何理由切换到另一个库。
When using OpenGl with SDL, rendering is done by the hardware, not in software. I never tried SFML, but SDL is very simple and it is a mature library. Having wrote some OpenGl with SDL, the only problem I faced is that it is not possible to have multiple windows with SDL. Regarding portability, my program worked on Linux, MacOS and Windows. For the moment, I don't have any reason to switch to another library.
SFML 是一个更成熟的库。它运行良好,甚至可能比 Windows、Linux、Mac OS 上的 SDL 更好:
此外,SFML 从一开始就支持硬件加速,而 SDL 对此存在一些疑问。
不过,SDL 目前可在更多平台上运行,包括移动平台。
使用 C 语言,您可能无法从 SFML 的所有面向对象优点中受益。
因此,您应该将 SDL 与 C(或移动平台)结合使用,将 SFML 与 C++ 结合使用。
那么你想做 2D 的东西吗?不要因为 OpenGL 而伤透脑筋,只需使用 SFML!它在内部使用 OpenGL 和硬件加速进行 2D。
SFML is a more mature library. It works well, probably even better than SDL on Windows, Linux, Mac OS:
Also, SFML has been supporting hardware acceleration from the start, whereas with SDL there are some doubts about that.
However, SDL works on more platforms right now, including mobile ones.
And using C language you may not benefit from all the object-oriented goodness of SFML.
So you should use SDL with C (or for mobile platforms) and SFML with C++.
So you want to do 2D stuff? Don't break your head with OpenGL, just use SFML! It uses OpenGL and hardware acceleration internally for 2D.
既然你说你必须使用 CI,那么建议你使用 SDL。当将 OpenGL 与 SDL 结合使用时,它将进行硬件加速。只有 SDL 2D 图形函数会出现在软件中,但由于您使用 OpenGL,因此您不会使用它们在屏幕上绘制任何内容。
SDL 非常便于移植,SDL 1.3(来自 svn 或主页上的存档)也可以针对使用 OpenGL ES 的 Android 进行编译。
Since you say that you have to use C I would suggest you go with SDL. When using OpenGL with SDL it will be hardware accelerated. Only the SDL 2D graphics functions will be in software but since you use OpenGL you won't use them to draw anything on the screen.
SDL is pretty portable and SDL 1.3 (from svn or archive on the homepage) can also be compiled for Android where you use OpenGL ES.