-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopenglwindow.h
More file actions
47 lines (32 loc) · 836 Bytes
/
openglwindow.h
File metadata and controls
47 lines (32 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef OPENGLWINDOW_H
#define OPENGLWINDOW_H
#include <QtGui/QWindow>
#include <QtGui/QOpenGLFunctions_3_2_Core>
class QPainter;
class QOpenGLContext;
class QOpenGLPaintDevice;
//! [1]
class OpenGLWindow : public QWindow, protected QOpenGLFunctions_3_2_Core
{
Q_OBJECT
public:
explicit OpenGLWindow(QWindow *parent = 0);
~OpenGLWindow();
virtual void render(QPainter *painter);
virtual void render();
virtual void initialize();
void setAnimating(bool animating);
public slots:
void renderLater();
void renderNow();
protected:
bool event(QEvent *event) Q_DECL_OVERRIDE;
void exposeEvent(QExposeEvent *event) Q_DECL_OVERRIDE;
private:
bool m_update_pending;
bool m_animating;
QOpenGLContext *m_context;
QOpenGLPaintDevice *m_paint_device;
};
//! [1]
#endif // OPENGLWINDOW_H