author | sheepluva |
Sat, 06 Jan 2018 03:05:14 +0100 | |
branch | qmlfrontend |
changeset 12886 | 07a267d72fce |
parent 12881 | b544bbbd0696 |
child 12888 | adb1fccc706a |
permissions | -rw-r--r-- |
12881
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
1 |
#ifndef GAMEVIEW_H |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
2 |
#define GAMEVIEW_H |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
3 |
|
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
4 |
#include <QQuickItem> |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
5 |
|
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
6 |
#include <QtGui/QOpenGLFunctions> |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
7 |
#include <QtGui/QOpenGLShaderProgram> |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
8 |
|
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
9 |
class GameViewRenderer : public QObject, protected QOpenGLFunctions { |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
10 |
Q_OBJECT |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
11 |
public: |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
12 |
GameViewRenderer() |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
13 |
: m_delta(0) |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
14 |
{ |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
15 |
} |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
16 |
~GameViewRenderer(); |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
17 |
|
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
18 |
void tick(quint32 delta) { m_delta = delta; } |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
19 |
void setViewportSize(const QSize& size) { m_viewportSize = size; } |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
20 |
void setWindow(QQuickWindow* window) { m_window = window; } |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
21 |
|
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
22 |
public slots: |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
23 |
void paint(); |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
24 |
|
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
25 |
private: |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
26 |
QSize m_viewportSize; |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
27 |
quint32 m_delta; |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
28 |
QQuickWindow* m_window; |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
29 |
}; |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
30 |
|
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
31 |
class GameView : public QQuickItem { |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
32 |
Q_OBJECT |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
33 |
|
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
34 |
public: |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
35 |
GameView(); |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
36 |
|
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
37 |
Q_INVOKABLE void tick(quint32 delta); |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
38 |
|
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
39 |
signals: |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
40 |
void tChanged(); |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
41 |
|
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
42 |
public slots: |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
43 |
void sync(); |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
44 |
void cleanup(); |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
45 |
|
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
46 |
private slots: |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
47 |
void handleWindowChanged(QQuickWindow* win); |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
48 |
|
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
49 |
private: |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
50 |
quint32 m_delta; |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
51 |
GameViewRenderer* m_renderer; |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
52 |
}; |
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
53 |
|
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
diff
changeset
|
54 |
#endif // GAMEVIEW_H |