From f3a34665978729ef65010ac2a4a9408e27d5bf3e Mon Sep 17 00:00:00 2001 From: ccolin Date: Mon, 28 Dec 2020 17:36:45 +0100 Subject: skybox --- src/opengl_widget.hh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/opengl_widget.hh') diff --git a/src/opengl_widget.hh b/src/opengl_widget.hh index 9259784..5bd4a07 100644 --- a/src/opengl_widget.hh +++ b/src/opengl_widget.hh @@ -7,6 +7,8 @@ #include #include #include +#include +#include #define FOV 70 @@ -14,12 +16,21 @@ class OpenGLWidget : public QOpenGLWidget, public QOpenGLFunctions_4_4_Core { Q_OBJECT - GLuint pos_attr, proj_attr, view_attr, model_attr; - - QMatrix4x4 rot, rot_start; + QMatrix4x4 rot, rot_start, proj; GLfloat cam_dist = 1; QPoint mouse_pos; + QOpenGLShaderProgram main_program; + QOpenGLShaderProgram skybox_program; + // QOpenGLTexture *skybox_tex; + GLuint skybox_tex; + // QOpenGLVertexArrayObject skybox_vao; + // QOpenGLBuffer skybox_vbo; + GLuint skybox_vao; + GLuint skybox_vbo; + + void loadSkybox(); + protected: virtual void mousePressEvent(QMouseEvent *e); virtual void mouseReleaseEvent(QMouseEvent *e); -- cgit v1.2.3-70-g09d2