23 class GLWindow :
public QWindow,
protected QOpenGLFunctions
28 explicit GLWindow(QWindow *parent =
nullptr);
87 bool event(QEvent *event)
override;
89 void exposeEvent(QExposeEvent *event)
override;
115 bool m_update_pending,m_animating,m_initializing;
void initializeFailed(const QString &error)
This signal is sent when the context creation has failed, or the initialize function returned an erro...
QOpenGLContext * m_context
The OpenGL context used for this window.
Definition: glwindow.h:112
bool isAnimating() const
Gets if the window is currently in animation mode.
Definition: glwindow.h:45
void renderNow()
Makes sure everything is correctly initialized, calls render and does buffer-swapping afterwards...
Definition: glwindow.cpp:42
QWidget * createWindowContainer(QWidget *parent=nullptr, Qt::WindowFlags flags=nullptr)
Creates a window container from this GLWindow.
Definition: glwindow.cpp:124
void renderLater()
Queues a render request using the Qt event queue, to be executed at a later time. ...
Definition: glwindow.cpp:33
void setAnimating(bool animating)
Enables/disables animation mode.
Definition: glwindow.h:68
bool m_error
Set to true if error occured making rendering impossible.
Definition: glwindow.h:85
QSurfaceFormat format() const override
Returns the currently used surface format.
Definition: glwindow.h:50
virtual bool initialize()
Provides a convenient point for subclasses to initialize.
Definition: glwindow.cpp:20
virtual void render()
Subclasses should implement this to render the window content.
Definition: glwindow.cpp:26
A QWindow derivative capable of OpenGL drawing.
Definition: glwindow.h:23