Un-type-pun importExtensionFunctions

This was SVN commit r6151.
This commit is contained in:
Simon Brenner 2008-06-29 09:54:26 +00:00
parent 91873a66a2
commit 7d18028fe2

View File

@ -228,13 +228,13 @@ static void importExtensionFunctions()
// checking for the extension. // checking for the extension.
// (TODO: this calls ogl_HaveVersion far more times than is necessary - // (TODO: this calls ogl_HaveVersion far more times than is necessary -
// we should probably use the have_* variables instead) // we should probably use the have_* variables instead)
#define FUNC(ret, name, params) *(void**)&p##name = SDL_GL_GetProcAddress(#name); #define FUNC(ret, name, params) p##name = (ret (*) params)SDL_GL_GetProcAddress(#name);
#define FUNC2(ret, nameARB, nameCore, version, params) \ #define FUNC2(ret, nameARB, nameCore, version, params) \
p##nameARB = NULL; \ p##nameARB = NULL; \
if(ogl_HaveVersion(version)) \ if(ogl_HaveVersion(version)) \
*(void**)&p##nameARB = SDL_GL_GetProcAddress(#nameCore); \ p##nameARB = (ret (*) params)SDL_GL_GetProcAddress(#nameCore); \
if(!p##nameARB) /* use the ARB name if the driver lied about what version it supports */ \ if(!p##nameARB) /* use the ARB name if the driver lied about what version it supports */ \
*(void**)&p##nameARB = SDL_GL_GetProcAddress(#nameARB); p##nameARB = (ret (*) params)SDL_GL_GetProcAddress(#nameARB);
#include "glext_funcs.h" #include "glext_funcs.h"
#undef FUNC2 #undef FUNC2
#undef FUNC #undef FUNC