Hi again, > > Hi, > > > > can you try with this patch ? > > > > Regards, > > Raphael > > Still doesn't work. I attached another opengl trace in case you can pick > out something that's changed though. > > Darckness
Thx, intersesting :) And this one ? Regards, Raphael
Index: wgl_ext.c =================================================================== RCS file: /home/wine/wine/dlls/opengl32/wgl_ext.c,v retrieving revision 1.4 diff -u -r1.4 wgl_ext.c --- wgl_ext.c 10 Mar 2005 11:13:33 -0000 1.4 +++ wgl_ext.c 23 Mar 2005 23:51:05 -0000 @@ -31,6 +31,7 @@ #include "winuser.h" #include "winerror.h" +#include "gdi.h" #include "wgl.h" #include "wgl_ext.h" #include "opengl_ext.h" @@ -133,6 +134,18 @@ return bTest; } +int (*p_glXSwapIntervalSGI)(int); +BOOL query_function_swap_control(glXGetProcAddressARB_t proc, const char *gl_version, const char *gl_extensions, + const char* glx_version, const char *glx_extensions, + const char *server_glx_extensions, const char *client_glx_extensions) +{ + BOOL bTest = (0 <= strcmp("1.3", glx_version) || NULL != strstr(glx_extensions, "GLX_SGIX_swap_group")); + if (bTest) { + p_glXSwapIntervalSGI = proc("glXSwapIntervalSGI"); + bTest = (NULL != p_glXSwapIntervalSGI); + } + return bTest; +} /*********************************************************************** * wglGetExtensionsStringEXT(OPENGL32.@) */ @@ -157,18 +170,21 @@ * wglSwapIntervalEXT(OPENGL32.@) */ BOOL WINAPI wglSwapIntervalEXT(int interval) { - FIXME("(%d),stub!\n", interval); - - swap_interval = interval; - return TRUE; + TRACE("(%d)\n", interval); + swap_interval = interval; + if (NULL != p_glXSwapIntervalSGI) { + return 0 == p_glXSwapIntervalSGI(interval); + } + WARN("(): GLX_SGI_swap_control extension seems not supported \n"); + return TRUE; } /*********************************************************************** * wglGetSwapIntervalEXT(OPENGL32.@) */ int WINAPI wglGetSwapIntervalEXT(VOID) { - FIXME("(),stub!\n"); - return swap_interval; + TRACE("() returns %d\n", swap_interval); + return swap_interval; } typedef struct wine_glpbuffer { @@ -226,9 +242,12 @@ #define WGL_STENCIL_BITS_ARB 0x2023 #define WGL_AUX_BUFFERS_ARB 0x2024 -#define WGL_PBUFFER_WIDTH_ARB 0x2034 -#define WGL_PBUFFER_HEIGHT_ARB 0x2035 -#define WGL_PBUFFER_LOST_ARB 0x2036 +#define WGL_PBUFFER_WIDTH_ARB 0x2034 +#define WGL_PBUFFER_HEIGHT_ARB 0x2035 +#define WGL_PBUFFER_LOST_ARB 0x2036 + +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C #if 0 /* not used yet */ static unsigned ConvertAttribGLXtoWGL(const int* iWGLAttr, int* oGLXAttr) { @@ -249,6 +268,18 @@ pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_BUFFER_SIZE, pop); break; + case WGL_BLUE_BITS_ARB: + pop = iWGLAttr[++cur]; + PUSH2(oGLXAttr, GLX_BLUE_SIZE, pop); + break; + case WGL_RED_BITS_ARB: + pop = iWGLAttr[++cur]; + PUSH2(oGLXAttr, GLX_RED_SIZE, pop); + break; + case WGL_GREEN_BITS_ARB: + pop = iWGLAttr[++cur]; + PUSH2(oGLXAttr, GLX_GREEN_SIZE, pop); + break; case WGL_ALPHA_BITS_ARB: pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_ALPHA_SIZE, pop); @@ -265,14 +296,34 @@ pop = iWGLAttr[++cur]; PUSH2(oGLXAttr, GLX_DOUBLEBUFFER, pop); break; + + case WGL_PIXEL_TYPE_ARB: + pop = iWGLAttr[++cur]; + switch (pop) { + case WGL_TYPE_RGBA_ARB: pop = GLX_RGBA_BIT; break ; + case WGL_TYPE_COLORINDEX_ARB: pop = GLX_COLOR_INDEX_BIT; break ; + default: + ERR("unexpected PixelType(%x)\n", pop); + pop = 0; + } + PUSH2(oGLXAttr,GLX_RENDER_TYPE, pop); + break; + case WGL_DRAW_TO_WINDOW_ARB: - case WGL_SUPPORT_OPENGL_ARB: + case WGL_DRAW_TO_BITMAP_ARB: + case WGL_SUPPORT_GDI_ARB: + pop = iWGLAttr[++cur]; + PUSH2(oGLXAttr, GLX_X_RENDERABLE, pop); + break; + case WGL_ACCELERATION_ARB: - /* - case WGL_SAMPLE_BUFFERS_ARB: - case WGL_SAMPLES_ARB: - */ + case WGL_SUPPORT_OPENGL_ARB: + pop = iWGLAttr[++cur]; + /** nothing to do, if we are here, supposing support Accelerated OpenGL */ + break; + default: + FIXME("unsupported %x WGL Attribute\n", iWGLAttr[cur]); break; } ++cur; @@ -282,14 +333,118 @@ GLboolean WINAPI wglGetPixelFormatAttribivARB(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues) { - TRACE("(%p, %d, %d, %d, %p, %p)\n", hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, piValues); - return GL_TRUE; + Display* display = get_display( hdc ); + UINT i; + GLXFBConfig* cfgs = NULL; + GLXFBConfig curCfg = NULL; + int nCfgs = 0; + int hTest; + int tmp; + int curGLXAttr = 0; + + TRACE("(%p, %d, %d, %d, %p, %p)\n", hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, piValues); + + if (0 < iLayerPlane) { + FIXME("unsupported iLayerPlane(%d) > 0, returns FALSE\n", iLayerPlane); + return GL_FALSE; + } + + cfgs = glXGetFBConfigs(display, DefaultScreen(display), &nCfgs); + if (NULL == cfgs) { + ERR("no FB Configs found for display(%p)\n", display); + return GL_FALSE; + } + + for (i = 0; i < nAttributes; ++i) { + const int curWGLAttr = piAttributes[i]; + TRACE("pAttr[%d] = %x\n", i, curWGLAttr); + + switch (curWGLAttr) { + case WGL_NUMBER_PIXEL_FORMATS_ARB: + piValues[i] = nCfgs; + continue ; + + case WGL_SUPPORT_OPENGL_ARB: + piValues[i] = GL_TRUE; + continue ; + + case WGL_TRANSPARENT_ARB: + curGLXAttr = GLX_TRANSPARENT_TYPE; + if (nCfgs < iPixelFormat) goto pix_error; + curCfg = cfgs[iPixelFormat]; + hTest = glXGetFBConfigAttrib(display, curCfg, curGLXAttr, &tmp); + if (hTest) goto get_error; + piValues[i] = GL_FALSE; + if (GLX_NONE != tmp) piValues[i] = GL_TRUE; + continue ; + + case WGL_COLOR_BITS_ARB: + curGLXAttr = GLX_BUFFER_SIZE; + break; + case WGL_BLUE_BITS_ARB: + curGLXAttr = GLX_BLUE_SIZE; + break; + case WGL_RED_BITS_ARB: + curGLXAttr = GLX_RED_SIZE; + break; + case WGL_GREEN_BITS_ARB: + curGLXAttr = GLX_GREEN_SIZE; + break; + case WGL_ALPHA_BITS_ARB: + curGLXAttr = GLX_ALPHA_SIZE; + break; + case WGL_DEPTH_BITS_ARB: + curGLXAttr = GLX_DEPTH_SIZE; + break; + case WGL_STENCIL_BITS_ARB: + curGLXAttr = GLX_STENCIL_SIZE; + break; + case WGL_DOUBLE_BUFFER_ARB: + curGLXAttr = GLX_DOUBLEBUFFER; + break; + case WGL_STEREO_ARB: + curGLXAttr = GLX_STEREO; + break; + case WGL_AUX_BUFFERS_ARB: + curGLXAttr = GLX_AUX_BUFFERS; + break; + + case WGL_DRAW_TO_WINDOW_ARB: + case WGL_DRAW_TO_BITMAP_ARB: + case WGL_SUPPORT_GDI_ARB: + curGLXAttr = GLX_X_RENDERABLE; + break; + + case WGL_ACCELERATION_ARB: + default: + FIXME("unsupported %x WGL Attribute\n", curWGLAttr); + } + + if (0 != curGLXAttr) { + if (nCfgs < iPixelFormat) goto pix_error; + curCfg = cfgs[iPixelFormat]; + hTest = glXGetFBConfigAttrib(display, curCfg, curGLXAttr, piValues + i); + if (hTest) goto get_error; + } else { + piValues[i] = GL_FALSE; + } + } + + return GL_TRUE; + +get_error: + ERR("(%p): unexpected failure on GetFBConfigAttrib(%x) returns FALSE\n", hdc, curGLXAttr); + return GL_FALSE; + +pix_error: + ERR("(%p): unexpected iPixelFormat(%d) > nFormats(%d), returns FALSE\n", hdc, iPixelFormat, nCfgs); + return GL_FALSE; } GLboolean WINAPI wglGetPixelFormatAttribfvARB(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues) { - TRACE("(%p, %d, %d, %d, %p, %p)\n", hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, pfValues); - return GL_TRUE; + FIXME("(%p, %d, %d, %d, %p, %p): stub\n", hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, pfValues); + return GL_FALSE; } GLboolean WINAPI wglChoosePixelFormatARB(HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats) @@ -340,7 +495,10 @@ PUSH1(attribs, None); cfgs = glXChooseFBConfig(display, DefaultScreen(display), attribs, &nCfgs); - if (nCfgs < iPixelFormat) return NULL; /* unespected error */ + if (nCfgs < iPixelFormat) { + ERR("(%p): unexpected iPixelFormat(%d) > nFormats(%d), returns NULL\n", hdc, iPixelFormat, nCfgs); + return NULL; /* unespected error */ + } --nAttribs; /** append more to attribs now we have fbConfig */ PUSH2(attribs, GLX_PBUFFER_WIDTH, iWidth); @@ -434,7 +592,8 @@ { "WGL_ARB_multisample", query_function_multisample }, { "WGL_ARB_pbuffer", query_function_pbuffer }, { "WGL_ARB_pixel_format" , query_function_pixel_format }, - { "WGL_ARB_render_texture", query_function_render_texture } + { "WGL_ARB_render_texture", query_function_render_texture }, + { "WGL_EXT_swap_control", query_function_swap_control } }; /* Used to initialize the WGL extension string at DLL loading */
pgpksc4aK8YaA.pgp
Description: PGP signature