diff options
Diffstat (limited to 'src/glwidget.h')
-rwxr-xr-x | src/glwidget.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/glwidget.h b/src/glwidget.h index 91df32f..9dd3744 100755 --- a/src/glwidget.h +++ b/src/glwidget.h @@ -13,6 +13,12 @@ #include <QTimer> #include <memory> +struct TextureData{ + GLuint textureID; + int width; + int height; +}; + class GLWidget : public QOpenGLWidget { Q_OBJECT @@ -40,6 +46,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(); @@ -76,4 +91,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<GLfloat> 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 + }; + }; |