From 77d9d9b2a588c5902dfb26ebb8affe3fdab2bdd7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 27 Jul 2014 11:53:18 +0200 Subject: [PATCH] - fixed: For updating the model VAO's attribute pointers it is necessary to first bind the vertex buffer we need to refer to, because this is not part of the VAO's state. --- src/gl/models/gl_models.cpp | 1 + src/gl/shaders/gl_shader.cpp | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gl/models/gl_models.cpp b/src/gl/models/gl_models.cpp index 3d2d0db05..39663ab53 100644 --- a/src/gl/models/gl_models.cpp +++ b/src/gl/models/gl_models.cpp @@ -140,6 +140,7 @@ FModelVertexBuffer::~FModelVertexBuffer() unsigned int FModelVertexBuffer::SetupFrame(unsigned int frame1, unsigned int frame2, float factor) { + glBindBuffer(GL_ARRAY_BUFFER, vbo_id); glVertexAttribPointer(VATTR_VERTEX, 3, GL_FLOAT, false, sizeof(FModelVertex), &VMO[frame1].x); glVertexAttribPointer(VATTR_TEXCOORD, 2, GL_FLOAT, false, sizeof(FModelVertex), &VMO[frame1].u); glVertexAttribPointer(VATTR_VERTEX2, 3, GL_FLOAT, false, sizeof(FModelVertex), &VMO[frame2].x); diff --git a/src/gl/shaders/gl_shader.cpp b/src/gl/shaders/gl_shader.cpp index 870b6184a..20abe17e5 100644 --- a/src/gl/shaders/gl_shader.cpp +++ b/src/gl/shaders/gl_shader.cpp @@ -88,7 +88,6 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char * // FString vp_comb = "#version 130\n"; - if (gl.glslversion >= 3.3f) vp_comb = "#version 330 core\n"; // I can't shut up the deprecation warnings in GLSL 1.3 so if available use a version with compatibility profile. // todo when using shader storage buffers, add // "#version 400 compatibility\n#extension GL_ARB_shader_storage_buffer_object : require\n" instead.