summaryrefslogtreecommitdiff
path: root/src/glwidget.h
diff options
context:
space:
mode:
authorjjesswan <jessica_wan@brown.edu>2024-04-22 21:56:26 -0400
committerjjesswan <jessica_wan@brown.edu>2024-04-22 21:56:26 -0400
commita556b45abf18f1bd509daaf63b66b7d55e9fd291 (patch)
treebc9b8a2d184c12aee236e7f9f276a34b84ca552d /src/glwidget.h
parentcd7c76017a12bb548036571c1ff13e551369d06d (diff)
add engine version
Diffstat (limited to 'src/glwidget.h')
-rwxr-xr-xsrc/glwidget.h47
1 files changed, 47 insertions, 0 deletions
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 <QTimer>
#include <memory>
+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<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
+ };
+
};