--- deliantra/Deliantra-Client/Client.xs 2006/04/23 21:47:30 1.61 +++ deliantra/Deliantra-Client/Client.xs 2006/04/24 08:22:21 1.65 @@ -42,7 +42,22 @@ #define MAP_EXTEND_X 32 #define MAP_EXTEND_Y 512 -#define MIN_FONT_HEIGHT 8 +#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; @@ -1333,7 +1348,6 @@ const_iv (GL_RGB), const_iv (GL_RGBA), const_iv (GL_UNSIGNED_BYTE), - const_iv (GL_ALPHA4), const_iv (GL_ALPHA), const_iv (GL_FLOAT), const_iv (GL_UNSIGNED_INT_8_8_8_8_REV), @@ -1404,7 +1418,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) @@ -1412,7 +1427,7 @@ CODE: glTranslatef (x, y, z); -void glScale (float x, float y, float z) +void glScale (float x, float y, float z = 1.) CODE: glScalef (x, y, z); @@ -1449,9 +1464,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)