Huge cleanups and added open gl window

This commit is contained in:
feedc0de committed 2022-01-15 01:52:55 +01:00
1 parent a477581f6f
commit ffd4c821ef
525 files changed
+1320 -35862

No files matched your search

+45
View File
@@ -0,0 +1,45 @@
#pragma once
#include <QWindow>
#include <QOpenGLFunctions>
class QOpenGLContext;
class QOpenGLPaintDevice;
class QOpenGLShaderProgram;
struct ProjectContainer;
class GameWindow : public QWindow, protected QOpenGLFunctions
{
Q_OBJECT
public:
explicit GameWindow(const ProjectContainer &project, QWindow *parent = nullptr);
~GameWindow();
void initialize();
void render();
public slots:
void renderLater();
void renderNow();
protected:
bool event(QEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
void keyReleaseEvent(QKeyEvent *event) override;
void exposeEvent(QExposeEvent *event) override;
private:
const ProjectContainer &m_project;
QOpenGLContext *m_context{};
QOpenGLPaintDevice *m_device{};
GLint m_posAttr = 0;
GLint m_colAttr = 0;
GLint m_matrixUniform = 0;
QOpenGLShaderProgram *m_program{};
int m_frame{};
};