annotate edview.h @ 398:8660c6005032

More work.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 19 Oct 2012 09:46:05 +0300
parents 28a74940f2b6
children d34922e6a244
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
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 391
diff changeset
17 QSize minimumSizeHint() const;
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 391
diff changeset
18 QSize sizeHint() const;
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 391
diff changeset
19
391
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
20 virtual void setEngineData(DMEngineData *mengine);
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
21 virtual void render(int frameTime);
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
22 void paintEvent(QPaintEvent *);
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
23
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
24 private:
385
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 void saveGLState();
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 void restoreGLState();
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27
391
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
28 protected:
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
29 DMEngineData *engine;
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
30 };
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
31
385
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32
391
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
33 class SWDemoView : public GLDemoView
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
34 {
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
35 Q_OBJECT
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
36
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
37 public:
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
38 SWDemoView(QWidget *parent);
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
39 ~SWDemoView();
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
40
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
41 void setEngineData(DMEngineData *mengine);
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
42 void render(int frameTime);
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
43 void paintEvent(QPaintEvent *);
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 private:
391
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
46 QImage *img;
385
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 };
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48
391
28a74940f2b6 More work on the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 385
diff changeset
49
385
eb5b793c8867 GL display widget skeleton.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50 #endif