aboutsummaryrefslogtreecommitdiff
path: root/src/opengl_widget.hh
diff options
context:
space:
mode:
authorccolin2020-12-22 13:15:23 +0100
committerccolin2020-12-22 13:15:23 +0100
commit7fbe0814d52ba861a02b0560d4e6872845ef241e (patch)
tree1a8f6fd67b5d1606a58c0df00fbab285f1206d36 /src/opengl_widget.hh
initial commit
Diffstat (limited to 'src/opengl_widget.hh')
-rw-r--r--src/opengl_widget.hh35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/opengl_widget.hh b/src/opengl_widget.hh
new file mode 100644
index 0000000..48cb276
--- /dev/null
+++ b/src/opengl_widget.hh
@@ -0,0 +1,35 @@
+#ifndef OPENGL_WIDGET_HH
+#define OPENGL_WIDGET_HH
+
+#include "opengl_mesh.hh"
+
+#include <QOpenGLWidget>
+#include <QMatrix4x4>
+#include <QOpenGLFunctions_4_4_Core>
+#include <QOpenGLShaderProgram>
+
+#define FOV 70
+
+
+class OpenGLWidget : public QOpenGLWidget, public QOpenGLFunctions_4_4_Core {
+ Q_OBJECT
+
+ GLuint pos_attr, proj_attr, view_attr, model_attr;
+
+public:
+ static OpenGLWidget *instance;
+
+ QVector<OpenGLMesh> meshes;
+
+ OpenGLWidget(QWidget *parent=nullptr);
+ ~OpenGLWidget();
+ void initializeGL() override;
+ void resizeGL(int w, int h) override;
+ void paintGL() override;
+
+signals:
+ void initialized();
+};
+
+
+#endif