aboutsummaryrefslogtreecommitdiff
path: root/src/opengl_widget.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl_widget.hh')
-rw-r--r--src/opengl_widget.hh12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/opengl_widget.hh b/src/opengl_widget.hh
index 785a17f..1bc2bbc 100644
--- a/src/opengl_widget.hh
+++ b/src/opengl_widget.hh
@@ -13,6 +13,12 @@
#define FOV 70
+class Painter {
+public:
+ virtual void draw(QOpenGLExtraFunctions *f) const = 0;
+};
+
+
class OpenGLWidget : public QOpenGLWidget, public QOpenGLExtraFunctions {
Q_OBJECT
@@ -25,8 +31,12 @@ class OpenGLWidget : public QOpenGLWidget, public QOpenGLExtraFunctions {
GLuint skybox_tex;
GLuint skybox_vao;
GLuint skybox_vbo;
+ OpenGLMesh *ground;
void loadSkybox();
+ void loadGround();
+
+ const Painter *painter = nullptr;
protected:
virtual void mousePressEvent(QMouseEvent *e);
@@ -44,6 +54,8 @@ public:
void initializeGL() override;
void resizeGL(int w, int h) override;
void paintGL() override;
+ void setPainter(const Painter *p);
+ QOpenGLShaderProgram *getMainProgram();
signals:
void initialized();