Base class for OpenGL widgets, compatble with Qt and globjects/glbindings.
More...
#include <Gui/Viewer/WindowQt.hpp>
|
void | dpiChanged () |
| Emitted when physical device changes. Useful for tracking devicePixelRatio() change.
|
|
Base class for OpenGL widgets, compatble with Qt and globjects/glbindings.
- Note
- This class has been extracted from globjects example https://github.com/cginternals/globjects/blob/master/source/examples/qtexample/WindowQt.h
Definition at line 27 of file WindowQt.hpp.
◆ WindowQt()
Ra::Gui::WindowQt::WindowQt |
( |
QScreen * | screen | ) |
|
|
explicit |
◆ ~WindowQt()
Ra::Gui::WindowQt::~WindowQt |
( |
| ) |
|
|
virtual |
◆ activateScopedContext()
WindowQt::ScopedGLContext Ra::Gui::WindowQt::activateScopedContext |
( |
| ) |
|
|
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
if(test){
auto context = viewer->activateScopedContext();
Texture tex;
tex->initializeGL();
}
QOpenGLContext * context()
Definition at line 154 of file WindowQt.hpp.
◆ cleanupGL
void Ra::Gui::WindowQt::cleanupGL |
( |
| ) |
|
|
slot |
call deinitializeGL if needed, with context activated
Definition at line 160 of file WindowQt.cpp.
◆ context()
QOpenGLContext * Ra::Gui::WindowQt::context |
( |
| ) |
|
◆ deinitializeGL()
void Ra::Gui::WindowQt::deinitializeGL |
( |
| ) |
|
|
protectedvirtual |
◆ doneCurrent()
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.
- See also
- makeCurrent()
-
activateScopedContext() as an alternative
Definition at line 89 of file WindowQt.cpp.
◆ enterEvent()
void Ra::Gui::WindowQt::enterEvent |
( |
QEvent * | event | ) |
|
|
virtual |
paintgl is done by main rendering loop
Definition at line 176 of file WindowQt.cpp.
◆ exposeEvent()
void Ra::Gui::WindowQt::exposeEvent |
( |
QExposeEvent * | event | ) |
|
|
override |
◆ getProcAddress()
glbinding::ProcAddress Ra::Gui::WindowQt::getProcAddress |
( |
const char * | name | ) |
|
|
staticprotected |
◆ initialize()
void Ra::Gui::WindowQt::initialize |
( |
| ) |
|
|
protected |
◆ initializeGL()
bool Ra::Gui::WindowQt::initializeGL |
( |
| ) |
|
|
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.
◆ isOpenGlInitialized()
bool Ra::Gui::WindowQt::isOpenGlInitialized |
( |
| ) |
const |
|
inline |
◆ leaveEvent()
void Ra::Gui::WindowQt::leaveEvent |
( |
QEvent * | event | ) |
|
|
virtual |
◆ makeCurrent()
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.
- See also
- activateScopedContext() as an alternative
Definition at line 80 of file WindowQt.cpp.
◆ resizeEvent()
void Ra::Gui::WindowQt::resizeEvent |
( |
QResizeEvent * | event | ) |
|
|
override |
◆ resizeGL()
void Ra::Gui::WindowQt::resizeGL |
( |
QResizeEvent * | event | ) |
|
|
protectedvirtual |
◆ resizeInternal()
void Ra::Gui::WindowQt::resizeInternal |
( |
QResizeEvent * | event | ) |
|
|
protected |
◆ screenChanged
void Ra::Gui::WindowQt::screenChanged |
( |
| ) |
|
|
slot |
◆ showEvent()
void Ra::Gui::WindowQt::showEvent |
( |
QShowEvent * | event | ) |
|
|
override |
◆ m_context
◆ m_glInitialized
std::atomic_bool Ra::Gui::WindowQt::m_glInitialized |
|
protected |
◆ m_updatePending
bool Ra::Gui::WindowQt::m_updatePending |
|
protected |
The documentation for this class was generated from the following files:
- /home/runner/work/Radium-Engine/Radium-Engine/src/Radium-Engine/src/Gui/Viewer/WindowQt.hpp
- /home/runner/work/Radium-Engine/Radium-Engine/src/Radium-Engine/src/Gui/Viewer/WindowQt.cpp