From a556b45abf18f1bd509daaf63b66b7d55e9fd291 Mon Sep 17 00:00:00 2001 From: jjesswan Date: Mon, 22 Apr 2024 21:56:26 -0400 Subject: add engine version --- src/glwidget.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'src/glwidget.h') diff --git a/src/glwidget.h b/src/glwidget.h index b319756..71199d1 100755 --- a/src/glwidget.h +++ b/src/glwidget.h @@ -13,6 +13,12 @@ #include #include +struct TextureData{ + GLuint textureID; + int width; + int height; +}; + class GLWidget : public QOpenGLWidget { Q_OBJECT @@ -39,6 +45,15 @@ private: void keyPressEvent (QKeyEvent *event) override; void keyReleaseEvent (QKeyEvent *event) override; + TextureData loadTextureFromFile(const char *path); + void makeFBO(); + void initFullScreenQuad(); + void paintTexture(GLuint texture, bool postProcessOn); + + + + + private slots: // Physics Tick void tick(); @@ -69,4 +84,36 @@ private: bool m_rightCapture; SelectMode m_rightClickSelectMode; int m_lastSelectedVertex = -1; + + + int m_devicePixelRatio; + GLuint m_defaultFBO; + int m_fbo_width; + int m_fbo_height; + int m_screen_width; + int m_screen_height; + + GLuint m_fullscreen_vbo; + GLuint m_fullscreen_vao; + GLuint m_fbo; + GLuint m_fbo_texture; + GLuint m_fbo_renderbuffer; + GLuint m_texture0; + + std::vector fullscreen_quad_data = + { // POSITIONS // + -1.f, 1.f, 0.0f, + 0.f, 1.f, //uv + -1.f, -1.f, 0.0f, + 0.f, 0.f, //uv + 1.f, -1.f, 0.0f, + 1.f, 0.f, //uv + 1.f, 1.f, 0.0f, + 1.f, 1.f, //uv + -1.f, 1.f, 0.0f, + 0.f, 1.f, //uv + 1.f, -1.f, 0.0f, + 1.f, 0.f //uv + }; + }; -- cgit v1.2.3-70-g09d2