--- deliantra/Deliantra-Client/Client.xs 2006/04/24 06:05:33 1.63 +++ deliantra/Deliantra-Client/Client.xs 2006/04/24 08:11:31 1.64 @@ -44,6 +44,21 @@ #define MIN_FONT_HEIGHT 10 +#define GL_CALL(type,func,args) \ + { \ + static int init_; \ + static type fptr_; \ + \ + if (!init_) \ + { \ + init_ = 1; \ + fptr_ = (type)SDL_GL_GetProcAddress (# func); \ + } \ + \ + if (fptr_) \ + fptr_ args; \ + } + typedef Mix_Chunk *CFClient__MixChunk; typedef Mix_Music *CFClient__MixMusic; @@ -1404,7 +1419,8 @@ void glLoadIdentity () -void glOrtho (double left, double right, double bottom, double top, double near, double far) +# near and far are due to microsofts buggy c compiler +void glOrtho (double left, double right, double bottom, double top, double near_, double far_) void glViewport (int x, int y, int width, int height) @@ -1449,9 +1465,12 @@ void glConvolutionParameter (int target, int pname, float params) CODE: - glConvolutionParameterf (target, pname, params); + GL_CALL (PFNGLCONVOLUTIONPARAMETERFEXTPROC, glConvolutionParameterf, (target, pname, params)); void glConvolutionFilter2D (int target, int internalformat, int width, int height, int format, int type, char *data) + CODE: + GL_CALL (PFNGLCONVOLUTIONFILTER2DEXTPROC, glConvolutionFilter2D, + (target, internalformat, width, height, format, type, data)); void glTexImage2D (int target, int level, int internalformat, int width, int height, int border, int format, int type, char *data)