-
Notifications
You must be signed in to change notification settings - Fork 0
/
gamewindow.h
64 lines (50 loc) · 1.63 KB
/
gamewindow.h
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef GAMEWINDOW_H
#define GAMEWINDOW_H
#include <QOpenGLWindow>
#include "shared.h"
#include "al/all.h"
#include "gl/all.h"
#include "state.h"
#include "gamemode.h"
#include "link.h"
class StartupWindow;
class GameWindow : public QOpenGLWindow, public GL_t
{
Q_OBJECT
public:
explicit GameWindow(QWindow* parent, GameMode gamemode, StartupWindow* startupWindow);
~GameWindow();
std::string DataPath() const;
protected:
void initializeGL() override;
void resizeGL(int w, int h) override;
void paintGL() override;
void paintUnderGL() override;
void paintOverGL() override;
void focusInEvent(QFocusEvent *) override;
void focusOutEvent(QFocusEvent *) override;
void hideEvent(QHideEvent *) override;
void exposeEvent(QExposeEvent *) override;
void keyPressEvent(QKeyEvent *) override;
void keyReleaseEvent(QKeyEvent *) override;
void mouseMoveEvent(QMouseEvent *) override;
void mousePressEvent(QMouseEvent *) override;
void mouseReleaseEvent(QMouseEvent *) override;
void wheelEvent(QWheelEvent *) override;
void printContextInformations();
bool registerLuaFunctions();
void CloseToStartupWindow();
void CloseToDesktop();
void SetRequireCPath(std::string const&);
void SetRequirePath(std::string const&);
void FatalError(QString const& title, QString const& description);
private:
bool preCallLuaFunction(char const*);
bool callLuaFunction(char const*, int =0);
Lua::State state;
GameMode m_gamemode;
StartupWindow* m_startupWindow;
LuaApi::Link m_link;
QString m_basePath;
};
#endif // GAMEWINDOW_H