O'Reilly logo

SFML Essentials by Milcho G. Milchev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using OpenGL inside SFML

Before we start using any of the OpenGL calls, we need to make sure that the graphics context is initialized. The context holds the data (states, default framebuffer, and so on) which allows OpenGL to function. This is done automatically when we create a window instance:

Using OpenGL inside SFML

To use any OpenGL calls, we need to include <SFML/OpenGL.hpp>. This is the common header file that SFML provides for us to use on all platforms. It is also important to mention that we do not need to use the familiar RenderWindow class if we are going to render everything using only OpenGL. The Window class will suite us just fine. On the other hand, if we ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required