DISTRHO Plugin Framework
|
#include <Window.hpp>
Public Member Functions | |
ScopedGraphicsContext (Window &window) | |
ScopedGraphicsContext (Window &window, Window &transientParentWindow) | |
~ScopedGraphicsContext () | |
void | done () |
void | reinit () |
Window graphics context as a scoped struct. This class gives graphics context drawing time to a window's widgets. Typically used for allowing OpenGL drawing operations during a window + widget constructor.
Unless you are subclassing the Window or StandaloneWindow classes, you do not need to care. In such cases you will need to use this struct as a way to get a valid OpenGL context. For example in a standalone application:
This struct is necessary because we cannot automatically make the window leave the OpenGL context in custom code. And we must always cleanly enter and leave the OpenGL context. So in order to avoid messing up the global host context, this class is used around widget creation.
|
explicit |
Constructor that will make the window graphics context the current one
|
explicit |
Overloaded constructor, gives back context to its transient parent when done
Window::ScopedGraphicsContext::~ScopedGraphicsContext | ( | ) |
Desstructor for clearing current context, if not done yet
void Window::ScopedGraphicsContext::done | ( | ) |
Early context clearing, useful for standalone windows not created by you.
void Window::ScopedGraphicsContext::reinit | ( | ) |
Get a valid context back again.