Class SFML::Context
In: window/main.cpp
Parent: Object

If you need to make OpenGL / graphics calls without having an active window (like in a thread), you can use an instance of this class to get a valid context.

Having a valid context is necessary for every OpenGL call, and for most of the classes from the Graphics package.

Note that a context is only active in its current thread, if you create a new thread it will have no valid context by default.

To use a sf::Context instance, just construct it and let it live as long as you need a valid context. No explicit activation is needed, all it has to do is to exist. Its destructor will take care of deactivating and freeing all the attached resources.

Methods

Public Class methods

The constructor creates and activates the context

This function is meant to be called internally; it is used to deactivate the current context by activating another one (so that we still have an active context on the current thread).

Public Instance methods

active=(p1)

Alias for setActive

Activate or deactivate explicitely the context.

set_active(p1)

Alias for setActive

[Validate]