-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Le Dimanche 01 Juin 2003 19:31, Raphaël Junqueira a écrit : > Hi, > > Changelog: > - add a new private header d3dcore_gl.h who declare needed opengl defines > and the caps defines > - cleanup of device.c using the caps defines (avoid the #ifdef nigthmare) > > Regards, > Raphael oupss, resent. this time without conflicts with previous patch Changelog addon: - add {Set,Get}GammaRamp support Regards Raphael -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE+285np7NA3AmQTU4RAtA+AKCB8MxV5tMoFUwEXeB4soN4ldDhaACgko7U 5pO9ANe3tI3rJ+bSlYMKVmY= =ixiw -----END PGP SIGNATURE-----
diff -uP /cvs-src/wine-pending/d3d8_48/d3d8_private.h dlls/d3d8/d3d8_private.h --- /cvs-src/wine-pending/d3d8_48/d3d8_private.h 2003-06-01 19:23:19.000000000 +0200 +++ dlls/d3d8/d3d8_private.h 2003-06-01 18:46:23.000000000 +0200 @@ -153,12 +153,6 @@ /* - * External prototypes - */ -/*BOOL D3DRAW_HAL_Init(HINSTANCE, DWORD, LPVOID); */ -void CreateStateBlock(LPDIRECT3DDEVICE8 iface); - -/* * Macros */ #define checkGLcall(A) \ @@ -180,58 +174,9 @@ } \ } -typedef enum _GL_SupportedExt { - /* ARB */ - ARB_FRAGMENT_PROGRAM, - ARB_MULTISAMPLE, - ARB_MULTITEXTURE, - ARB_POINT_PARAMETERS, - ARB_TEXTURE_COMPRESSION, - ARB_TEXTURE_CUBE_MAP, - ARB_TEXTURE_ENV_DOT3, - ARB_VERTEX_PROGRAM, - ARB_VERTEX_BLEND, - /* EXT */ - EXT_FOG_COORD, - EXT_PALETTED_TEXTURE, - EXT_SECONDARY_COLOR, - EXT_TEXTURE_COMPRESSION_S3TC, - EXT_TEXTURE_FILTER_ANISOTROPIC, - EXT_TEXTURE_LOD, - EXT_TEXTURE_LOD_BIAS, - EXT_VERTEX_WEIGHTING, - /* NVIDIA */ - NV_FRAGMENT_PROGRAM, - NV_VERTEX_PROGRAM, - /* ATI */ - EXT_VERTEX_SHADER, - - OPENGL_SUPPORTED_EXT_END -} GL_SupportedExt; - -typedef enum _GL_VSVersion { - VS_VERSION_NOT_SUPPORTED = 0x0, - VS_VERSION_10 = 0x10, - VS_VERSION_11 = 0x11, - VS_VERSION_20 = 0x20, - VS_VERSION_30 = 0x30, - /*Force 32-bits*/ - VS_VERSION_FORCE_DWORD = 0x7FFFFFFF -} GL_VSVersion; - -typedef enum _GL_PSVersion { - PS_VERSION_NOT_SUPPORTED = 0x0, - PS_VERSION_10 = 0x10, - PS_VERSION_11 = 0x11, - PS_VERSION_12 = 0x12, - PS_VERSION_13 = 0x13, - PS_VERSION_14 = 0x14, - PS_VERSION_20 = 0x20, - PS_VERSION_30 = 0x30, - /*Force 32-bits*/ - PS_VERSION_FORCE_DWORD = 0x7FFFFFFF -} GL_PSVersion; +#include "d3dcore_gl.h" +#define USE_GL_FUNC(type, pfn) type pfn; typedef struct _GL_Info { /** * CAPS Constants @@ -248,12 +193,17 @@ GL_VSVersion vs_ati_version; BOOL supported[30]; + + /** ext functions ptr */ + GL_EXT_FUNCS_GEN; + /**/ } GL_Info; +#undef USE_GL_FUNC -#define GL_LIMITS(ExtName) (This->direct3d8->gl_info.max_##ExtName) -#define GL_SUPPORT(ExtName) (TRUE == This->direct3d8->gl_info.supported[ExtName]) -#define GL_SUPPORT_DEV(ExtName, dev) (TRUE == (dev)->direct3d8->gl_info.supported[ExtName]) -#define GLExtCall(FuncName) /*(This->direct3d8->glInfo.FuncName)*/ +#define GL_LIMITS(ExtName) (This->direct3d8->gl_info.max_##ExtName) +#define GL_SUPPORT(ExtName) (TRUE == This->direct3d8->gl_info.supported[ExtName]) +#define GL_SUPPORT_DEV(ExtName, dev) (TRUE == (dev)->direct3d8->gl_info.supported[ExtName]) +#define GL_EXTCALL(FuncName) (This->direct3d8->gl_info.FuncName) #define D3DCOLOR_R(dw) (((float) (((dw) >> 16) & 0xFF)) / 255.0f) @@ -1283,7 +1233,6 @@ void setupTextureStates(LPDIRECT3DDEVICE8 iface, DWORD Stage); void set_tex_op(LPDIRECT3DDEVICE8 iface, BOOL isAlpha, int Stage, D3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3); - SHORT D3DFmtGetBpp(IDirect3DDevice8Impl* This, D3DFORMAT fmt); GLint D3DFmt2GLIntFmt(IDirect3DDevice8Impl* This, D3DFORMAT fmt); GLenum D3DFmt2GLFmt(IDirect3DDevice8Impl* This, D3DFORMAT fmt); diff -uP /cvs-src/wine-pending/d3d8_48/d3dcore_gl.h dlls/d3d8/d3dcore_gl.h --- /cvs-src/wine-pending/d3d8_48/d3dcore_gl.h 1970-01-01 01:00:00.000000000 +0100 +++ dlls/d3d8/d3dcore_gl.h 2003-06-01 19:11:47.000000000 +0200 @@ -0,0 +1,133 @@ +#if !defined( __wine_d3dcore_gl_h__ ) +#define __wine_d3dcore_gl_h__ + +#if !defined( __WINE_CONFIG_H ) +# error You must include config.h to use this header +#endif + +#define XMD_H /* This is to prevent the Xmd.h inclusion bug :-/ */ +#include <GL/gl.h> +#include <GL/glx.h> +#ifdef HAVE_GL_GLEXT_H +# include <GL/glext.h> +#endif +#undef XMD_H + +#undef APIENTRY +#undef CALLBACK +#undef WINAPI + +/* Redefines the constants */ +#define CALLBACK __stdcall +#define WINAPI __stdcall +#define APIENTRY WINAPI + + + +/* GL_EXT_secondary_color */ +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif +/* GL_EXT_paletted_texture */ +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +#endif +/* GL_EXT_point_parameters */ +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +typedef void (APIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +#endif + + +typedef enum _GL_SupportedExt { + /* ARB */ + ARB_FRAGMENT_PROGRAM, + ARB_MULTISAMPLE, + ARB_MULTITEXTURE, + ARB_POINT_PARAMETERS, + ARB_TEXTURE_COMPRESSION, + ARB_TEXTURE_CUBE_MAP, + ARB_TEXTURE_ENV_DOT3, + ARB_VERTEX_PROGRAM, + ARB_VERTEX_BLEND, + /* EXT */ + EXT_FOG_COORD, + EXT_PALETTED_TEXTURE, + EXT_POINT_PARAMETERS, + EXT_SECONDARY_COLOR, + EXT_TEXTURE_COMPRESSION_S3TC, + EXT_TEXTURE_FILTER_ANISOTROPIC, + EXT_TEXTURE_LOD, + EXT_TEXTURE_LOD_BIAS, + EXT_VERTEX_WEIGHTING, + /* NVIDIA */ + NV_FRAGMENT_PROGRAM, + NV_VERTEX_PROGRAM, + /* ATI */ + EXT_VERTEX_SHADER, + + OPENGL_SUPPORTED_EXT_END +} GL_SupportedExt; + +typedef enum _GL_VSVersion { + VS_VERSION_NOT_SUPPORTED = 0x0, + VS_VERSION_10 = 0x10, + VS_VERSION_11 = 0x11, + VS_VERSION_20 = 0x20, + VS_VERSION_30 = 0x30, + /*Force 32-bits*/ + VS_VERSION_FORCE_DWORD = 0x7FFFFFFF +} GL_VSVersion; + +typedef enum _GL_PSVersion { + PS_VERSION_NOT_SUPPORTED = 0x0, + PS_VERSION_10 = 0x10, + PS_VERSION_11 = 0x11, + PS_VERSION_12 = 0x12, + PS_VERSION_13 = 0x13, + PS_VERSION_14 = 0x14, + PS_VERSION_20 = 0x20, + PS_VERSION_30 = 0x30, + /*Force 32-bits*/ + PS_VERSION_FORCE_DWORD = 0x7FFFFFFF +} GL_PSVersion; + +#define GL_EXT_FUNCS_GEN \ + /** EXT Extensions **/ \ + /* GL_EXT_fog_coord */ \ + /* GL_EXT_paletted_texture */ \ + USE_GL_FUNC(PFNGLCOLORTABLEEXTPROC, glColorTableEXT); \ + /* GL_EXT_point_parameters */ \ + USE_GL_FUNC(PFNGLPOINTPARAMETERFEXTPROC, glPointParameterfEXT); \ + USE_GL_FUNC(PFNGLPOINTPARAMETERFVEXTPROC, glPointParameterfvEXT); \ + /* GL_EXT_secondary_color */ \ + USE_GL_FUNC(PFNGLSECONDARYCOLOR3UBEXTPROC, glSecondaryColor3ubEXT); \ + USE_GL_FUNC(PFNGLSECONDARYCOLOR3FEXTPROC, glSecondaryColor3fEXT); \ + USE_GL_FUNC(PFNGLSECONDARYCOLOR3FVEXTPROC, glSecondaryColor3fvEXT); \ + USE_GL_FUNC(PFNGLSECONDARYCOLORPOINTEREXTPROC, glSecondaryColorPointerEXT); \ + +#endif diff -uP /cvs-src/wine-pending/d3d8_48/device.c dlls/d3d8/device.c --- /cvs-src/wine-pending/d3d8_48/device.c 2003-06-01 19:23:19.000000000 +0200 +++ dlls/d3d8/device.c 2003-06-01 21:26:52.000000000 +0200 @@ -32,7 +32,10 @@ /** define GL_GLEXT_PROTOTYPES for having extensions prototypes defined */ /*#define GL_GLEXT_PROTOTYPES*/ +/*#undef GLX_GLXEXT_LEGACY*/ #include "d3d8_private.h" +#include <GL/glext.h> +#include <GL/glxext.h> /** currently desactiving 1_4 support as mesa doesn't implement all 1_4 support while defining it */ #undef GL_VERSION_1_4 @@ -616,13 +619,10 @@ glColor4fv((float*) &vertex_shader->output.oD[0]); /* Requires secondary color extensions to compile... */ -#if defined(GL_VERSION_1_4) - glSecondaryColor3fv((float*) &vertex_shader->output.oD[1]); - checkGLcall("glSecondaryColor3fv"); -#elif defined(GL_EXT_secondary_color) +#if defined(GL_EXT_secondary_color) if (GL_SUPPORT(EXT_SECONDARY_COLOR)) { /*specularColor = D3DCOLORTOCOLORVALUE(vertex_shader->output.oD[1]);*/ - glSecondaryColor3fvEXT((float*) &vertex_shader->output.oD[1]); + GL_EXTCALL(glSecondaryColor3fvEXT)((float*) &vertex_shader->output.oD[1]); checkGLcall("glSecondaryColor3fvEXT"); } #endif @@ -836,34 +836,26 @@ /* Requires secondary color extensions to compile... */ if (isSpecular) { -#if defined(GL_VERSION_1_4) - glSecondaryColorPointer(4, GL_UNSIGNED_BYTE, skip, curPos); - checkGLcall("glSecondaryColorPointer(4, GL_UNSIGNED_BYTE, skip, curPos)"); - glEnableClientState(GL_SECONDARY_COLOR_ARRAY); - checkGLcall("glEnableClientState(GL_SECONDARY_COLOR_ARRAY)"); -#elif defined(GL_EXT_secondary_color) +#if defined(GL_EXT_secondary_color) /* FIXME: check for GL_EXT_secondary_color */ if (GL_SUPPORT(EXT_SECONDARY_COLOR)) { - glSecondaryColorPointerEXT(4, GL_UNSIGNED_BYTE, skip, curPos); - checkGLcall("glSecondaryColorPointerEXT(4, GL_UNSIGNED_BYTE, skip, curPos)"); + GL_EXTCALL(glSecondaryColorPointerEXT)(4, GL_UNSIGNED_BYTE, skip, curPos); + vcheckGLcall("glSecondaryColorPointerEXT(4, GL_UNSIGNED_BYTE, skip, curPos)"); glEnableClientState(GL_SECONDARY_COLOR_ARRAY_EXT); - checkGLcall("glEnableClientState(GL_SECONDARY_COLOR_ARRAY_EXT)"); + vcheckGLcall("glEnableClientState(GL_SECONDARY_COLOR_ARRAY_EXT)"); } #endif curPos += sizeof(DWORD); } else { -#if defined(GL_VERSION_1_4) - glDisableClientState(GL_SECONDARY_COLOR_ARRAY); - checkGLcall("glDisableClientState(GL_SECONDARY_COLOR_ARRAY)"); - glSecondaryColor3f(0, 0, 0); - checkGLcall("glSecondaryColor3f(0, 0, 0)"); -#else -#if 0 +#if defined(GL_EXT_secondary_color) + if (GL_SUPPORT(EXT_SECONDARY_COLOR)) { glDisableClientState(GL_SECONDARY_COLOR_ARRAY_EXT); - checkGLcall("glDisableClientState(GL_SECONDARY_COLOR_ARRAY_EXT)"); - glSecondaryColor3fEXT(0, 0, 0); - checkGLcall("glSecondaryColor3fEXT(0, 0, 0)"); + vcheckGLcall("glDisableClientState(GL_SECONDARY_COLOR_ARRAY_EXT)"); +#if 0 + GL_EXTCALL(glSecondaryColor3fEXT)(0.0f, 0.0f, 0.0f); + vcheckGLcall("glSecondaryColor3fEXT(0, 0, 0)"); #endif + } #endif } @@ -1327,13 +1319,23 @@ return D3D_OK; } void WINAPI IDirect3DDevice8Impl_SetGammaRamp(LPDIRECT3DDEVICE8 iface, DWORD Flags, CONST D3DGAMMARAMP* pRamp) { + HDC hDC; ICOM_THIS(IDirect3DDevice8Impl,iface); - FIXME("(%p) : stub\n", This); + + FIXME("(%p) : pRamp@%p\n", This, pRamp); + hDC = GetDC(This->win_handle); + SetDeviceGammaRamp(hDC, (LPVOID) pRamp); + ReleaseDC(This->win_handle, hDC); return; } void WINAPI IDirect3DDevice8Impl_GetGammaRamp(LPDIRECT3DDEVICE8 iface, D3DGAMMARAMP* pRamp) { + HDC hDC; ICOM_THIS(IDirect3DDevice8Impl,iface); - FIXME("(%p) : stub\n", This); + + FIXME("(%p) : pRamp@%p\n", This, pRamp); + hDC = GetDC(This->win_handle); + GetDeviceGammaRamp(hDC, pRamp); + ReleaseDC(This->win_handle, hDC); return; } HRESULT WINAPI IDirect3DDevice8Impl_CreateTexture(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, UINT Levels, DWORD Usage, @@ -2050,7 +2052,7 @@ /** always dirtify for now. we must find a better way to see that surface have been modified */ IDirect3DBaseTexture8Impl_SetDirty(cont, TRUE); IDirect3DBaseTexture8_PreLoad(cont); - IDirect3DBaseTexture8_Release(cont); + IDirect3DBaseTexture8Impl_Release(cont); cont = NULL; } } @@ -2104,10 +2106,10 @@ if (Flags & D3DCLEAR_TARGET) { TRACE("Clearing screen with glClear to color %lx\n", Color); glGetFloatv(GL_COLOR_CLEAR_VALUE, old_color_clear_value); - glClearColor(((Color >> 16) & 0xFF) / 255.0, - ((Color >> 8) & 0xFF) / 255.0, - ((Color >> 0) & 0xFF) / 255.0, - ((Color >> 24) & 0xFF) / 255.0); + glClearColor(((Color >> 16) & 0xFF) / 255.0f, + ((Color >> 8) & 0xFF) / 255.0f, + ((Color >> 0) & 0xFF) / 255.0f, + ((Color >> 24) & 0xFF) / 255.0f); checkGLcall("glClearColor"); glMask = glMask | GL_COLOR_BUFFER_BIT; } @@ -3165,34 +3167,26 @@ if (Value) { glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, (float*) &This->UpdateStateBlock->material.Specular); checkGLcall("glMaterialfv"); -#if defined(GL_VERSION_1_4) - glEnable(GL_COLOR_SUM); -#elif defined(GL_EXT_secondary_color) - glEnable(GL_COLOR_SUM_EXT); -#elif defined(GL_ARB_vertex_program) - glEnable(GL_COLOR_SUM_ARB); -#else - TRACE("Specular colors cannot be enabled in this version of opengl\n"); -#endif - checkGLcall("glEnable(GL_COLOR_)\n"); + if (GL_SUPPORT(EXT_SECONDARY_COLOR)) { + glEnable(GL_COLOR_SUM_EXT); + } else { + TRACE("Specular colors cannot be enabled in this version of opengl\n"); + } + checkGLcall("glEnable(GL_COLOR_SUM)\n"); } else { - float black[4] = {0.0, 0.0, 0.0, 0.0}; + float black[4] = {0.0f, 0.0f, 0.0f, 0.0f}; /* for the case of enabled lighting: */ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, &black[0]); checkGLcall("glMaterialfv"); /* for the case of disabled lighting: */ -#if defined(GL_VERSION_1_4) - glDisable(GL_COLOR_SUM); -#elif defined(GL_EXT_secondary_color) - glDisable(GL_COLOR_SUM_EXT); -#elif defined(GL_ARB_vertex_program) - glDisable(GL_COLOR_SUM_ARB); -#else - TRACE("Specular colors cannot be disabled in this version of opengl\n"); -#endif - checkGLcall("glDisable(GL_COLOR_)\n"); + if (GL_SUPPORT(EXT_SECONDARY_COLOR)) { + glDisable(GL_COLOR_SUM_EXT); + } else { + TRACE("Specular colors cannot be disabled in this version of opengl\n"); + } + checkGLcall("glDisable(GL_COLOR_SUM)\n"); } } break; @@ -3505,33 +3499,21 @@ break; case D3DRS_POINTSIZE_MIN : -#if defined(GL_VERSION_1_4) - glPointParameterf(GL_POINT_SIZE_MIN, *((float*)&Value)); - checkGLcall("glPointParameterf(...);\n"); -#elif defined(GL_EXT_point_parameters) - glPointParameterfEXT(GL_POINT_SIZE_MIN_EXT, *((float*)&Value)); - checkGLcall("glPointParameterfEXT(...);\n"); -#elif defined(GL_ARB_point_parameters) - glPointParameterfARB(GL_POINT_SIZE_MIN_ARB, *((float*)&Value)); - checkGLcall("glPointParameterfARB(...);\n"); -#else - FIXME("D3DRS_POINTSIZE_MIN not supported on this opengl\n"); -#endif + if (GL_SUPPORT(EXT_POINT_PARAMETERS)) { + GL_EXTCALL(glPointParameterfEXT)(GL_POINT_SIZE_MIN_EXT, *((float*)&Value)); + checkGLcall("glPointParameterfEXT(...);\n"); + } else { + FIXME("D3DRS_POINTSIZE_MIN not supported on this opengl\n"); + } break; case D3DRS_POINTSIZE_MAX : -#if defined(GL_VERSION_1_4) - glPointParameterf(GL_POINT_SIZE_MAX, *((float*)&Value)); - checkGLcall("glPointParameterf(...);\n"); -#elif defined(GL_EXT_point_parameters) - glPointParameterfEXT(GL_POINT_SIZE_MAX_EXT, *((float*)&Value)); - checkGLcall("glPointParameterfEXT(...);\n"); -#elif defined(GL_ARB_point_parameters) - glPointParameterfARB(GL_POINT_SIZE_MAX_ARB, *((float*)&Value)); - checkGLcall("glPointParameterfARB(...);\n"); -#else - FIXME("D3DRS_POINTSIZE_MAX not supported on this opengl\n"); -#endif + if (GL_SUPPORT(EXT_POINT_PARAMETERS)) { + GL_EXTCALL(glPointParameterfEXT)(GL_POINT_SIZE_MAX_EXT, *((float*)&Value)); + checkGLcall("glPointParameterfEXT(...);\n"); + } else { + FIXME("D3DRS_POINTSIZE_MAX not supported on this opengl\n"); + } break; case D3DRS_POINTSCALE_A : @@ -3541,38 +3523,26 @@ { /* If enabled, supply the parameters, otherwise fall back to defaults */ if (This->StateBlock->renderstate[D3DRS_POINTSCALEENABLE]) { - GLfloat att[3] = {1.0, 0.0, 0.0}; + GLfloat att[3] = {1.0f, 0.0f, 0.0f}; att[0] = *((float*)&This->StateBlock->renderstate[D3DRS_POINTSCALE_A]); att[1] = *((float*)&This->StateBlock->renderstate[D3DRS_POINTSCALE_B]); att[2] = *((float*)&This->StateBlock->renderstate[D3DRS_POINTSCALE_C]); -#if defined(GL_VERSION_1_4) - glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, att); - checkGLcall("glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, ...);\n"); -#elif defined(GL_EXT_point_parameters) - glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, att); - checkGLcall("glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, ...);\n"); -#elif defined(GL_ARB_point_parameters) - glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, att); - checkGLcall("glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, ...);\n"); -#else - TRACE("D3DRS_POINTSCALEENABLE not supported on this opengl\n"); -#endif + if (GL_SUPPORT(EXT_POINT_PARAMETERS)) { + GL_EXTCALL(glPointParameterfvEXT)(GL_DISTANCE_ATTENUATION_EXT, att); + checkGLcall("glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, ...);\n"); + } else { + TRACE("D3DRS_POINTSCALEENABLE not supported on this opengl\n"); + } } else { - GLfloat att[3] = {1.0, 0.0, 0.0}; -#if defined(GL_VERSION_1_4) - glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, att); - checkGLcall("glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, ...);\n"); -#elif defined(GL_EXT_point_parameters) - glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, att); - checkGLcall("glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, ...);\n"); -#elif defined(GL_ARB_point_parameters) - glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, att); - checkGLcall("glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, ...);\n"); -#else - TRACE("D3DRS_POINTSCALEENABLE not supported, but not on either\n"); -#endif - } + GLfloat att[3] = {1.0f, 0.0f, 0.0f}; + if (GL_SUPPORT(EXT_POINT_PARAMETERS)) { + GL_EXTCALL(glPointParameterfvEXT)(GL_DISTANCE_ATTENUATION_EXT, att); + checkGLcall("glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, ...);\n"); + } else { + TRACE("D3DRS_POINTSCALEENABLE not supported, but not on either\n"); + } + } break; } @@ -4268,12 +4238,12 @@ This->currentPalette = PaletteNumber; #if defined(GL_EXT_paletted_texture) if (GL_SUPPORT(EXT_PALETTED_TEXTURE)) { - glColorTableEXT(GL_TEXTURE_2D, /* target */ - GL_RGBA, /* internal format */ - 256, /* table size */ - GL_RGBA, /* table format */ - GL_UNSIGNED_BYTE, /* table type */ - This->palettes[PaletteNumber]); + GL_EXTCALL(glColorTableEXT)(GL_TEXTURE_2D, /* target */ + GL_RGBA, /* internal format */ + 256, /* table size */ + GL_RGBA, /* table format */ + GL_UNSIGNED_BYTE, /* table type */ + This->palettes[PaletteNumber]); checkGLcall("glColorTableEXT"); } else { /* Delayed palette handling ... waiting for software emulation into preload code */ diff -uP /cvs-src/wine-pending/d3d8_48/directx.c dlls/d3d8/directx.c --- /cvs-src/wine-pending/d3d8_48/directx.c 2003-06-01 19:23:19.000000000 +0200 +++ dlls/d3d8/directx.c 2003-06-01 19:06:26.000000000 +0200 @@ -646,6 +646,10 @@ This->gl_info.vs_nv_version = VS_VERSION_NOT_SUPPORTED; This->gl_info.vs_ati_version = VS_VERSION_NOT_SUPPORTED; +#define USE_GL_FUNC(type, pfn) This->gl_info.pfn = NULL; + GL_EXT_FUNCS_GEN; +#undef USE_GL_FUNC + /* Retrieve opengl defaults */ glGetIntegerv(GL_MAX_CLIP_PLANES, &gl_max); This->gl_info.max_clipplanes = min(MAX_CLIPPLANES, gl_max); @@ -759,6 +763,10 @@ } } +#define USE_GL_FUNC(type, pfn) This->gl_info.pfn = (type) glXGetProcAddressARB(#pfn); + GL_EXT_FUNCS_GEN; +#undef USE_GL_FUNC + GLX_Extensions = glXQueryExtensionsString(display, DefaultScreen(display)); FIXME("GLX_Extensions reported:\n");