Game Development Reference
Should you use OpenGL?
To be fair, SFML supports a lot of the functionality that OpenGL provides. In fact, SFML
uses OpenGL internally to implement that functionality. However, since SFML is a high-
level library, there will always be a performance hit associated with using it. In most cases,
the hit isn't a huge problem, since the benefit of such a high-level library is that it is ex-
tremely quick to write with. However, some circumstances just need that extra performance
to achieve the target FPS. In that case, SFML provides an easy integration of OpenGL code
without having to worry about too many things.
Perhaps you want to render tens of thousands of sprites on the screen at once, or maybe,
you want to add a feature on top of the Window class. OpenGL is then the place to turn to.
Another reason to use OpenGL is to create 3D games. SFML provides some tools, which
can be used in a 3D environment, but ultimately they are not enough to create a fully fea-
tured 3D experience (3D models, lighting, shadows, and so on). Therefore, we have to use
As mentioned at the beginning of this chapter, OpenGL is a huge API, and this chapter
does not teach you how to use any of its features. It only gives you a general guideline of
how to use it alongside SFML.