Radium Engine
1.5.0
|
Base class for OpenGL widgets, compatble with Qt and globjects/glbindings. More...
#include <Gui/Viewer/WindowQt.hpp>
Public Slots | |
void | cleanupGL () |
call deinitializeGL if needed, with context activated | |
void | screenChanged () |
Signals | |
void | dpiChanged () |
Emitted when physical device changes. Useful for tracking devicePixelRatio() change. | |
Public Member Functions | |
WindowQt (QScreen *screen) | |
void | resizeEvent (QResizeEvent *event) override |
void | showEvent (QShowEvent *event) override |
void | exposeEvent (QExposeEvent *event) override |
virtual void | enterEvent (QEvent *event) |
paintgl is done by main rendering loop | |
virtual void | leaveEvent (QEvent *event) |
void | makeCurrent () |
void | doneCurrent () |
ScopedGLContext | activateScopedContext () |
QOpenGLContext * | context () |
bool | isOpenGlInitialized () const |
Protected Member Functions | |
void | initialize () |
void | resizeInternal (QResizeEvent *event) |
virtual bool | initializeGL () |
Initialize the openGL related part of the Window. More... | |
virtual void | deinitializeGL () |
DeInitialize the OpenGL. | |
virtual void | resizeGL (QResizeEvent *event) |
Resize the OpenGL related part of the Window. | |
Static Protected Member Functions | |
static glbinding::ProcAddress | getProcAddress (const char *name) |
Protected Attributes | |
std::unique_ptr< QOpenGLContext > | m_context |
bool | m_updatePending |
std::atomic_bool | m_glInitialized |
Base class for OpenGL widgets, compatble with Qt and globjects/glbindings.
Definition at line 27 of file WindowQt.hpp.
|
inline |
Make this->context() the current context for current block. The context is released when the return variable is destroyed. The "context object" uses this->makeCurrent() and this->doneCurrent(), hence it's compatible with enclosed scopes, and only the first created context object dtor eventually release OpenGL context.
Example
Definition at line 154 of file WindowQt.hpp.
QOpenGLContext * Ra::Gui::WindowQt::context | ( | ) |
Definition at line 76 of file WindowQt.cpp.
void Ra::Gui::WindowQt::doneCurrent | ( | ) |
Release this->context(). This results in no context being current in the current thread. In case a context has been made current multiple times, this function just deacrease the internal counter by one.
Definition at line 89 of file WindowQt.cpp.
|
protectedvirtual |
Initialize the openGL related part of the Window.
paint is done by main rendering loop, initialize instead
Reimplemented in Ra::Gui::Viewer.
Definition at line 154 of file WindowQt.cpp.
void Ra::Gui::WindowQt::makeCurrent | ( | ) |
Make this->context() the current context. This function is made reentrant thanks to an internal counter that count how many time the context has been asked to be activated. If the context have already been made current with a previous call to makeCurrent, this function increase an internal counter by one so that doneCurrent do not release the context.
Definition at line 80 of file WindowQt.cpp.