@@ -48,15 +48,15 @@ inline static void attribVector(unsigned short loc, unsigned short stride, intpt
48
48
{
49
49
glEnableVertexAttribArray (loc);
50
50
glVertexAttribPointer (loc, size, GL_FLOAT, false , stride, (const void *)offset);
51
- glVertexAttribDivisor (loc, divisor);
51
+ glVertexAttribDivisorARB (loc, divisor);
52
52
}
53
53
54
54
inline static void attribMatrix (unsigned short loc, unsigned short stride, intptr_t offset, unsigned short size, unsigned short divisor)
55
55
{
56
56
for (unsigned short i = 0 ; i < size; ++i) {
57
57
glEnableVertexAttribArray (loc + i);
58
58
glVertexAttribPointer (loc + i, size, GL_FLOAT, false , stride, (const void *)(offset + size * i * sizeof (float )));
59
- glVertexAttribDivisor (loc + i, divisor);
59
+ glVertexAttribDivisorARB (loc + i, divisor);
60
60
}
61
61
}
62
62
@@ -112,13 +112,12 @@ RAS_OpenGLDebugDraw::RAS_OpenGLDebugDraw()
112
112
static const unsigned short stride = sizeof (RAS_DebugDraw::Line) / 2 ;
113
113
const unsigned int pos = GPU_shader_get_attribute (m_colorShader, " pos" );
114
114
const unsigned int color = GPU_shader_get_attribute (m_colorShader, " color" );
115
-
115
+
116
116
glBindBuffer (GL_ARRAY_BUFFER, m_vbos[LINES_VBO]);
117
117
attribVector (pos, stride, offsetof (RAS_DebugDraw::Line, m_from), 3 , 0 );
118
118
attribVector (color, stride, offsetof (RAS_DebugDraw::Line, m_color), 4 , 0 );
119
119
}
120
120
121
-
122
121
static const unsigned short frustumStride = sizeof (RAS_DebugDraw::Frustum);
123
122
124
123
glBindVertexArray (m_vaos[FRUSTUMS_LINE_VAO]);
@@ -222,11 +221,11 @@ void RAS_OpenGLDebugDraw::Flush(RAS_Rasterizer *rasty, RAS_ICanvas *canvas, RAS_
222
221
223
222
glBindVertexArray (m_vaos[FRUSTUMS_LINE_VAO]);
224
223
GPU_shader_bind (m_frustumLineShader);
225
- glDrawElementsInstanced (GL_LINES, 24 , GL_UNSIGNED_BYTE, nullptr , numfrustums);
224
+ glDrawElementsInstancedARB (GL_LINES, 24 , GL_UNSIGNED_BYTE, nullptr , numfrustums);
226
225
227
226
glBindVertexArray (m_vaos[FRUSTUMS_SOLID_VAO]);
228
227
GPU_shader_bind (m_frustumSolidShader);
229
- glDrawElementsInstanced (GL_TRIANGLES, 36 , GL_UNSIGNED_BYTE, (const void *)(sizeof (GLubyte) * 24 ), numfrustums);
228
+ glDrawElementsInstancedARB (GL_TRIANGLES, 36 , GL_UNSIGNED_BYTE, (const void *)(sizeof (GLubyte) * 24 ), numfrustums);
230
229
}
231
230
232
231
const std::vector<RAS_DebugDraw::Aabb>& aabbs = debugDraw->m_aabbs ;
@@ -236,7 +235,7 @@ void RAS_OpenGLDebugDraw::Flush(RAS_Rasterizer *rasty, RAS_ICanvas *canvas, RAS_
236
235
237
236
glBindVertexArray (m_vaos[AABB_VAO]);
238
237
GPU_shader_bind (m_frustumLineShader);
239
- glDrawElementsInstanced (GL_LINES, 24 , GL_UNSIGNED_BYTE, nullptr , numaabbs);
238
+ glDrawElementsInstancedARB (GL_LINES, 24 , GL_UNSIGNED_BYTE, nullptr , numaabbs);
240
239
}
241
240
242
241
const unsigned int width = canvas->GetWidth ();
@@ -261,7 +260,7 @@ void RAS_OpenGLDebugDraw::Flush(RAS_Rasterizer *rasty, RAS_ICanvas *canvas, RAS_
261
260
262
261
glBindVertexArray (m_vaos[BOX_2D_VAO]);
263
262
GPU_shader_bind (m_box2dShader);
264
- glDrawArraysInstanced (GL_TRIANGLE_FAN, 0 , 4 , numboxes);
263
+ glDrawArraysInstancedARB (GL_TRIANGLE_FAN, 0 , 4 , numboxes);
265
264
}
266
265
267
266
glBindVertexArray (0 );
0 commit comments