annotate edview.h @ 391:28a74940f2b6

More work on the editor.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 19 Oct 2012 04:30:24 +0300
parents eb5b793c8867
children 8660c6005032
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
385
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 #ifndef EDVIEW_H
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 #define EDVIEW_H
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 #include <QtOpenGL>
391
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
5 #include <QImage>
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
6 #include "dmengine.h"
385
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7
391
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
8
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
9 class GLDemoView : public QGLWidget
385
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 {
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 Q_OBJECT
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 public:
391
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
14 GLDemoView(QWidget *parent);
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
15 ~GLDemoView();
385
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16
391
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
17 virtual void setEngineData(DMEngineData *mengine);
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
18 virtual void render(int frameTime);
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
19 void paintEvent(QPaintEvent *);
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
20
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
21 private:
385
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 void saveGLState();
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 void restoreGLState();
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24
391
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
25 protected:
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
26 DMEngineData *engine;
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
27 };
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
28
385
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29
391
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
30 class SWDemoView : public GLDemoView
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
31 {
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
32 Q_OBJECT
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
33
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
34 public:
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
35 SWDemoView(QWidget *parent);
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
36 ~SWDemoView();
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
37
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
38 void setEngineData(DMEngineData *mengine);
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
39 void render(int frameTime);
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
40 void paintEvent(QPaintEvent *);
385
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 private:
391
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
43 QImage *img;
385
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 };
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45
391
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
46
385
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 #endif