kwin: Resolve functions for GL_ARB_draw_elements_base_vertex

This commit is contained in:
Fredrik Höglund 2013-03-21 21:39:40 +01:00
parent 7c4b736cec
commit 5e7b2a34a8
2 changed files with 20 additions and 0 deletions

View file

@ -198,6 +198,10 @@ glGetGraphicsResetStatus_func glGetGraphicsResetStatus;
glReadnPixels_func glReadnPixels;
glGetnUniformfv_func glGetnUniformfv;
// GL_ARB_draw_elements_base_vertex
glDrawElementsBaseVertex_func glDrawElementsBaseVertex;
glDrawElementsInstancedBaseVertex_func glDrawElementsInstancedBaseVertex;
static glXFuncPtr getProcAddress(const char* name)
{
@ -695,6 +699,15 @@ void glResolveFunctions(OpenGLPlatformInterface platformInterface)
glGetnUniformfv = KWin::GetnUniformfv;
}
if (hasGLVersion(3, 2) || hasGLExtension("GL_ARB_draw_elements_base_vertex")) {
// See http://www.opengl.org/registry/specs/ARB/draw_elements_base_vertex.txt
GL_RESOLVE(glDrawElementsBaseVertex);
GL_RESOLVE(glDrawElementsInstancedBaseVertex);
} else {
glDrawElementsBaseVertex = NULL;
glDrawElementsInstancedBaseVertex = NULL;
}
#else
if (hasGLExtension("GL_OES_mapbuffer")) {

View file

@ -453,6 +453,13 @@ extern KWIN_EXPORT glGetGraphicsResetStatus_func glGetGraphicsResetStatus;
extern KWIN_EXPORT glReadnPixels_func glReadnPixels;
extern KWIN_EXPORT glGetnUniformfv_func glGetnUniformfv;
// GL_ARB_draw_elements_base_vertex
typedef void (*glDrawElementsBaseVertex_func)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
typedef void (*glDrawElementsInstancedBaseVertex_func)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex);
extern KWIN_EXPORT glDrawElementsBaseVertex_func glDrawElementsBaseVertex;
extern KWIN_EXPORT glDrawElementsInstancedBaseVertex_func glDrawElementsInstancedBaseVertex;
} // namespace
#endif // not KWIN_HAVE_OPENGLES