Implement actual game engine and rendering opengl and vulkan
This commit is contained in:
1 parent
543196d99e
commit
defb83c9c3
18 files changed
+1243
-981
No files matched your search
+14
-19
@@ -1,11 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <QWindow>
|
||||
#include <vector>
|
||||
|
||||
#include <QOpenGLFunctions>
|
||||
#include <QOpenGLVertexArrayObject>
|
||||
#include <QWindow>
|
||||
|
||||
class QOpenGLContext;
|
||||
class QOpenGLPaintDevice;
|
||||
class QOpenGLShaderProgram;
|
||||
struct GameScene;
|
||||
struct ProjectContainer;
|
||||
|
||||
class GlGameWindow : public QWindow, protected QOpenGLFunctions
|
||||
@@ -13,33 +16,25 @@ class GlGameWindow : public QWindow, protected QOpenGLFunctions
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit GlGameWindow(const ProjectContainer &project, const float &m_rotation, QWindow *parent = nullptr);
|
||||
~GlGameWindow();
|
||||
explicit GlGameWindow(const ProjectContainer &project, const GameScene &scene, QWindow *parent = nullptr);
|
||||
~GlGameWindow() override;
|
||||
|
||||
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:
|
||||
bool initialize();
|
||||
void releaseResources();
|
||||
|
||||
const ProjectContainer &m_project;
|
||||
|
||||
const GameScene &m_scene;
|
||||
QOpenGLContext *m_context{};
|
||||
QOpenGLPaintDevice *m_device{};
|
||||
|
||||
GLint m_posAttr = 0;
|
||||
GLint m_colAttr = 0;
|
||||
GLint m_matrixUniform = 0;
|
||||
|
||||
QOpenGLShaderProgram *m_program{};
|
||||
const float &m_rotation;
|
||||
QOpenGLVertexArrayObject m_vao;
|
||||
GLuint m_vertexBuffer{};
|
||||
std::vector<GLuint> m_textures;
|
||||
};
|
||||
Reference in new issue
Block a user