Search code examples
c++openglsdlhardware-acceleration

Cross platform hardware accelerated 2d C++ app?


I know a decent amount of C++, and now I wanted to explore making a game. I was wondering what the best approach would be in terms of writing a hardware accelerated game that's still cross-platform (Windows/OSX/Linux). It's going to be a 2d game, but intensive enough that a CPU renderer probably wouldn't cut it.

I know there's OpenGL, but I can't seem to find any tutorials on how to use it in a cross platform manner, they all focus on one platform.

Using SDL is also a possibility, but I'm afraid the game may not perform as well if I use it. Is this necessarily true?

Lastly, I've seen libraries like http://www.sfml-dev.org/ that supposedly make it easier, should I go down that route?

Thanks again.


Solution

  • That's nonsense guys

    OpenGL IS cross-platform. No need for Qt or such. Only a few part must be adapted : the windowing API and the input API, which are the only functions that depend on OS-specific routines.

    You have several possibilities :

    • roll your own. I don't recommend this, since you won't learn anything interesting (hardly)
    • SDL. It has a flag to be HW accelerated, so it's as good as any other
    • SFML. This seems good but not mature enough IMHO. The other parts (networking, ...) are wrappers for other libraries so I don't really see the advantage
    • GLUT. This one is evil.
    • GLFW. This one is great, really. I've been using it for years now. It's perfect from every point of view. The only limitation is that you can only have one openGL window, but since it's for a game it should be ok.