From 8ad1cf1b89b8acae55e36d6bd4562dffd1bcc714 Mon Sep 17 00:00:00 2001 From: papush! Date: Sat, 2 Jan 2021 17:45:42 +0100 Subject: target openglES 2 (with vao ext) --- src/opengl_widget.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/opengl_widget.cc') 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()); } -- cgit v1.2.3-70-g09d2