- Use SDL_GL_GetProcAddress on platforms where the SDL is being used. Since SDL initialized OpenGL for us, it is the only reliable way of retrieving proc addresses.

- Check if ogl_LoadFunctions failed and make OpenGLSWFrameBuffer gracefully recover from that
This commit is contained in:
Magnus Norddahl 2017-04-07 02:17:34 +02:00 committed by Rachael Alexanderson
parent 74faacd218
commit e690de25a8
2 changed files with 8 additions and 2 deletions

View file

@ -85,7 +85,9 @@ static PROC WinGetProcAddress(const char *name)
#define IntGetProcAddress(name) AppleGLGetProcAddress(name)
#else
#if defined(__sgi) || defined(__sun) || defined(__unix__)
#define IntGetProcAddress(name) PosixGetProcAddress((const GLubyte*)name)
void* SDL_GL_GetProcAddress(const char* proc);
#define IntGetProcAddress(name) SDL_GL_GetProcAddress((const char*)name)
//#define IntGetProcAddress(name) PosixGetProcAddress((const GLubyte*)name)
/* END OF MANUAL CHANGES, DO NOT REMOVE! */
#else /* GLX */
#include <GL/glx.h>

View file

@ -194,7 +194,11 @@ OpenGLSWFrameBuffer::OpenGLSWFrameBuffer(void *hMonitor, int width, int height,
static bool first = true;
if (first)
{
ogl_LoadFunctions();
if (ogl_LoadFunctions() == ogl_LOAD_FAILED)
{
Printf("OpenGL load failed. No OpenGL acceleration will be used.\n");
return;
}
}
gl_LoadExtensions();
InitializeState();