src/gl/compiler.cpp

changeset 259
c27612f0eac0
parent 250
2837b549e616
child 260
48c66a4b1fe5
--- a/src/gl/compiler.cpp	Wed Jun 22 23:51:06 2022 +0300
+++ b/src/gl/compiler.cpp	Sun Jun 26 19:44:45 2022 +0300
@@ -16,9 +16,6 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glu.h>
-#include <GL/glext.h>
 #include <QMessageBox>
 #include "gl/compiler.h"
 #include "documentmanager.h"
@@ -213,8 +210,10 @@
 			shader.program->setAttributeBuffer(0, GL_FLOAT, offsetof(Vertex, position), 3, stride);
 			shader.program->setAttributeBuffer(1, GL_FLOAT, offsetof(Vertex, color), 4, stride);
 			shader.program->setAttributeBuffer(2, GL_FLOAT, offsetof(Vertex, normal), 3, stride);
-			glVertexAttribIPointer(3, 1, GL_INT, stride, reinterpret_cast<void*>(offsetof(Vertex, id)));
-			glVertexAttribIPointer(4, 1, GL_INT, stride, reinterpret_cast<void*>(offsetof(Vertex, selected)));
+			const void* vertexptr = reinterpret_cast<const void*>(offsetof(Vertex, id));
+			glfunc().glVertexAttribPointer(3, 1, GL_INT, GL_FALSE, stride, vertexptr);
+			const void* selectedptr = reinterpret_cast<const void*>(offsetof(Vertex, selected));
+			glfunc().glVertexAttribPointer(4, 1, GL_INT, GL_FALSE, stride, selectedptr);
 			shader.vertexArray.release();
 			shader.buffer.release();
 			shader.program->release();
@@ -350,7 +349,8 @@
 		}
 		const GLsizeiptr size = static_cast<int>(vector.size() * sizeof vector[0]);
 		object.buffer.bind();
-		glBufferSubData(GL_ARRAY_BUFFER, 0, size, vector.data());
+		QOpenGLFunctions glfunc;
+		glfunc.glBufferSubData(GL_ARRAY_BUFFER, 0, size, vector.data());
 		object.buffer.release();
 	}
 }

mercurial