diff options
author | papush! | 2021-01-02 17:45:42 +0100 |
---|---|---|
committer | papush! | 2021-01-02 17:45:42 +0100 |
commit | 8ad1cf1b89b8acae55e36d6bd4562dffd1bcc714 (patch) | |
tree | 02c4a50e19670489a63cd80f1ca1040a2f2cb0ab /src/opengl_widget.cc | |
parent | dafdc38f1631f43d94803b0711657187ab58dedd (diff) |
target openglES 2 (with vao ext)
Diffstat (limited to 'src/opengl_widget.cc')
-rw-r--r-- | src/opengl_widget.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/opengl_widget.cc b/src/opengl_widget.cc index 5a82d23..adc851e 100644 --- a/src/opengl_widget.cc +++ b/src/opengl_widget.cc @@ -41,6 +41,7 @@ void OpenGLWidget::loadSkybox() { if (!skybox_program.addShaderFromSourceFile(QOpenGLShader::Fragment, ":/shaders/skybox.frag")) { qFatal("Error compiling skybox.frag: %s", skybox_program.log().toLocal8Bit().constData()); } + skybox_program.bindAttributeLocation("in_pos", 0); if (!skybox_program.link()) { qFatal("Error linking the skybox shader program: %s", skybox_program.log().toLocal8Bit().constData()); } @@ -111,6 +112,9 @@ void OpenGLWidget::initializeGL() { if (!main_program.addShaderFromSourceFile(QOpenGLShader::Fragment, ":/shaders/main.frag")) { qFatal("Error compiling main.frag: %s", main_program.log().toLocal8Bit().constData()); } + main_program.bindAttributeLocation("in_pos", 0); + main_program.bindAttributeLocation("in_norm", 1); + main_program.bindAttributeLocation("in_uv", 2); if (!main_program.link()) { qFatal("Error linking the main shader program: %s", main_program.log().toLocal8Bit().constData()); } |