(Apple) Add workarounds for Apple when not using GL core profile

This commit is contained in:
twinaphex 2016-05-16 18:52:53 +02:00
parent b9dde5320f
commit 1be3042ef9

View File

@ -1668,8 +1668,12 @@ void rglCopyImageSubData( GLuint srcName,
void rglBindVertexArray(GLuint array)
{
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) && defined(HAVE_OPENGLES3)
#if defined(__APPLE__) && !defined(CORE) && defined(GL_APPLE_vertex_array_object) && !defined(GL_ARB_vertex_array_object)
glBindVertexArraysAPPLE(array);
#else
glBindVertexArray(array);
#endif
#endif
}
/*
@ -1682,8 +1686,12 @@ void rglBindVertexArray(GLuint array)
void rglGenVertexArrays(GLsizei n, GLuint *arrays)
{
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) && defined(HAVE_OPENGLES3)
#if defined(__APPLE__) && !defined(CORE) && defined(GL_APPLE_vertex_array_object) && !defined(GL_ARB_vertex_array_object)
glGenVertexArraysAPPLE(n, arrays);
#else
glGenVertexArrays(n, arrays);
#endif
#endif
}
/*
@ -1696,8 +1704,12 @@ void rglGenVertexArrays(GLsizei n, GLuint *arrays)
void rglDeleteVertexArrays(GLsizei n, const GLuint *arrays)
{
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) && defined(HAVE_OPENGLES3)
#if defined(__APPLE__) && !defined(CORE) && defined(GL_APPLE_vertex_array_object) && !defined(GL_ARB_vertex_array_object)
glDeleteVertexArraysAPPLE(n, arrays);
#else
glDeleteVertexArrays(n, arrays);
#endif
#endif
}
/* GLSM-side */
@ -1824,7 +1836,7 @@ static void glsm_state_bind(void)
gl_state.viewport.w,
gl_state.viewport.h);
#ifdef CORE
glBindVertexArray(gl_state.vao);
rglBindVertexArray(gl_state.vao);
#endif
for(i = 0; i < SGL_CAP_MAX; i ++)
{
@ -1864,7 +1876,7 @@ static void glsm_state_unbind(void)
{
unsigned i;
#ifdef CORE
glBindVertexArray(0);
rglBindVertexArray(0);
#endif
for (i = 0; i < SGL_CAP_MAX; i ++)
{