Commit 56313c0f authored by Patrice Mandin's avatar Patrice Mandin

TinyGL does not have glFinish, only glFlush

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40996
parent 1db79a98
...@@ -116,6 +116,7 @@ int SDL_AtariGL_LoadLibrary(_THIS, const char *path) ...@@ -116,6 +116,7 @@ int SDL_AtariGL_LoadLibrary(_THIS, const char *path)
#ifdef ENABLE_OSMESA_SHARED #ifdef ENABLE_OSMESA_SHARED
void *handle; void *handle;
SDL_bool cancel_load;
if (gl_active) { if (gl_active) {
SDL_SetError("OpenGL context already created"); SDL_SetError("OpenGL context already created");
...@@ -158,9 +159,19 @@ int SDL_AtariGL_LoadLibrary(_THIS, const char *path) ...@@ -158,9 +159,19 @@ int SDL_AtariGL_LoadLibrary(_THIS, const char *path)
this->gl_data->glGetIntegerv = SDL_LoadFunction(handle, "glGetIntegerv"); this->gl_data->glGetIntegerv = SDL_LoadFunction(handle, "glGetIntegerv");
this->gl_data->glFinish = SDL_LoadFunction(handle, "glFinish"); this->gl_data->glFinish = SDL_LoadFunction(handle, "glFinish");
this->gl_data->glFlush = SDL_LoadFunction(handle, "glFlush");
if ( (this->gl_data->glGetIntegerv == NULL) || cancel_load = SDL_FALSE;
(this->gl_data->glFinish == NULL)) { if (this->gl_data->glGetIntegerv == NULL) {
cancel_load = SDL_TRUE;
} else {
/* We need either glFinish (OSMesa) or glFlush (TinyGL) */
if ((this->gl_data->glFinish == NULL) &&
(this->gl_data->glFlush == NULL)) {
cancel_load = SDL_TRUE;
}
}
if (cancel_load) {
SDL_SetError("Could not retrieve OpenGL functions"); SDL_SetError("Could not retrieve OpenGL functions");
SDL_UnloadObject(handle); SDL_UnloadObject(handle);
/* Restore pointers to static library */ /* Restore pointers to static library */
...@@ -237,12 +248,6 @@ int SDL_AtariGL_GetAttribute(_THIS, SDL_GLattr attrib, int* value) ...@@ -237,12 +248,6 @@ int SDL_AtariGL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
GLenum mesa_attrib; GLenum mesa_attrib;
SDL_Surface *surface; SDL_Surface *surface;
if (this->gl_config.dll_handle) {
if (this->gl_data->glGetIntegerv == NULL) {
return -1;
}
}
if (!gl_active) { if (!gl_active) {
return -1; return -1;
} }
...@@ -344,6 +349,8 @@ void SDL_AtariGL_SwapBuffers(_THIS) ...@@ -344,6 +349,8 @@ void SDL_AtariGL_SwapBuffers(_THIS)
if (this->gl_config.dll_handle) { if (this->gl_config.dll_handle) {
if (this->gl_data->glFinish) { if (this->gl_data->glFinish) {
this->gl_data->glFinish(); this->gl_data->glFinish();
} else if (this->gl_data->glFlush) {
this->gl_data->glFlush();
} }
} else { } else {
this->gl_data->glFinish(); this->gl_data->glFinish();
...@@ -365,6 +372,7 @@ void SDL_AtariGL_InitPointers(_THIS) ...@@ -365,6 +372,7 @@ void SDL_AtariGL_InitPointers(_THIS)
this->gl_data->glGetIntegerv = glGetIntegerv; this->gl_data->glGetIntegerv = glGetIntegerv;
this->gl_data->glFinish = glFinish; this->gl_data->glFinish = glFinish;
this->gl_data->glFlush = glFlush;
this->gl_data->OSMesaCreateLDG = NULL; this->gl_data->OSMesaCreateLDG = NULL;
this->gl_data->OSMesaDestroyLDG = NULL; this->gl_data->OSMesaDestroyLDG = NULL;
......
...@@ -53,6 +53,7 @@ struct SDL_PrivateGLData { ...@@ -53,6 +53,7 @@ struct SDL_PrivateGLData {
/* OpenGL functions */ /* OpenGL functions */
void (*glGetIntegerv)( GLenum pname, GLint *value ); void (*glGetIntegerv)( GLenum pname, GLint *value );
void (*glFinish)(void); void (*glFinish)(void);
void (*glFlush)(void);
/* osmesa.ldg */ /* osmesa.ldg */
OSMesaContext (*OSMesaCreateContextExt)( GLenum format, GLint depthBits, GLint stencilBits, GLint accumBits, OSMesaContext sharelist); OSMesaContext (*OSMesaCreateContextExt)( GLenum format, GLint depthBits, GLint stencilBits, GLint accumBits, OSMesaContext sharelist);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment