disable *SwapInterval function when extensions are missing, since it

can cause crashes.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16985 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2005-11-13 21:53:26 +00:00
parent 06ac97d79f
commit 68ecbc34f1
1 changed files with 5 additions and 0 deletions

View File

@ -251,6 +251,7 @@ static void *setNull(const GLubyte *s) {
* \param getProcAddress function to resolve function names, may be NULL
*/
static void getFunctions(void *(*getProcAddress)(const GLubyte *)) {
const char *extensions = glGetString(GL_EXTENSIONS);
if (!getProcAddress)
getProcAddress = setNull;
GenBuffers = getProcAddress("glGenBuffers");
@ -323,6 +324,9 @@ static void getFunctions(void *(*getProcAddress)(const GLubyte *)) {
ProgramEnvParameter4f = getProcAddress("glProgramEnvParameter4fARB");
if (!ProgramEnvParameter4f)
ProgramEnvParameter4f = getProcAddress("glProgramEnvParameter4fNV");
if (!extensions || !strstr(extensions, "_swap_control"))
SwapInterval = NULL;
else {
SwapInterval = getProcAddress("glXSwapInterval");
if (!SwapInterval)
SwapInterval = getProcAddress("glXSwapIntervalEXT");
@ -334,6 +338,7 @@ static void getFunctions(void *(*getProcAddress)(const GLubyte *)) {
SwapInterval = getProcAddress("wglSwapIntervalEXT");
if (!SwapInterval)
SwapInterval = getProcAddress("wglSwapIntervalSGI");
}
}
/**