winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2012
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
827 discussions
Start a n
N
ew thread
Alexandre Julliard : opengl32: Move wglGetProcAddress to the WGL driver.
by Alexandre Julliard
28 Jun '12
28 Jun '12
Module: wine Branch: master Commit: edfc7f0de0ac5eb8b2051bccfb567da981cf4957 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=edfc7f0de0ac5eb8b2051bccf…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jun 28 16:14:55 2012 +0200 opengl32: Move wglGetProcAddress to the WGL driver. --- dlls/gdi32/gdi32.spec | 5 ----- dlls/gdi32/opengl.c | 40 ---------------------------------------- dlls/opengl32/wgl.c | 25 ++++++------------------- dlls/wined3d/directx.c | 20 +++++++++----------- dlls/wined3d/wined3d_gl.h | 2 +- dlls/winex11.drv/opengl.c | 11 ++++------- include/wine/gdi_driver.h | 3 ++- 7 files changed, 22 insertions(+), 84 deletions(-) diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec index 9dfa4dd..1e30485 100644 --- a/dlls/gdi32/gdi32.spec +++ b/dlls/gdi32/gdi32.spec @@ -497,11 +497,6 @@ @ stub pstackConnect ################################################################ -# Wine extensions: OpenGL support -# -@ stdcall -private wglGetProcAddress(str) - -################################################################ # Wine extensions: Win16 functions that are needed by other dlls # @ stdcall GetDCHook(long ptr) diff --git a/dlls/gdi32/opengl.c b/dlls/gdi32/opengl.c index 95db11d..1db261e 100644 --- a/dlls/gdi32/opengl.c +++ b/dlls/gdi32/opengl.c @@ -46,46 +46,6 @@ static INT (WINAPI *wglGetPixelFormat)(HDC); static BOOL (WINAPI *wglSetPixelFormat)(HDC,INT,const PIXELFORMATDESCRIPTOR*); static BOOL (WINAPI *wglSwapBuffers)(HDC); -static HDC default_hdc = 0; - -/* We route all wgl functions from opengl32.dll through gdi32.dll to - * the display driver. Various wgl calls have a hDC as one of their parameters. - * Using get_dc_ptr we get access to the functions exported by the driver. - * Some functions don't receive a hDC. This function creates a global hdc and - * if there's already a global hdc, it returns it. - */ -static DC* OPENGL_GetDefaultDC(void) -{ - if(!default_hdc) - default_hdc = CreateDCA("DISPLAY", NULL, NULL, NULL); - - return get_dc_ptr(default_hdc); -} - -/*********************************************************************** - * Internal wglGetProcAddress for retrieving WGL extensions - */ -PROC WINAPI wglGetProcAddress(LPCSTR func) -{ - PROC ret = NULL; - DC *dc; - - if(!func) - return NULL; - - TRACE("func: '%s'\n", func); - - /* Retrieve the global hDC to get access to the driver. */ - dc = OPENGL_GetDefaultDC(); - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglGetProcAddress ); - ret = physdev->funcs->pwglGetProcAddress(func); - release_dc_ptr( dc ); - } - return ret; -} - /*********************************************************************** * __wine_get_wgl_driver (GDI32.@) */ diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 0a19506..4d5510f 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -48,8 +48,6 @@ WINE_DECLARE_DEBUG_CHANNEL(opengl); static struct { - PROC (WINAPI *p_wglGetProcAddress)(LPCSTR lpszProc); - /* internal WGL functions */ void (WINAPI *p_wglFinish)(void); void (WINAPI *p_wglFlush)(void); @@ -508,7 +506,7 @@ PROC WINAPI wglGetProcAddress(LPCSTR lpszProc) { /* If the function name starts with a 'w', it is a WGL extension */ if(lpszProc[0] == 'w') { - local_func = wine_wgl.p_wglGetProcAddress( lpszProc ); + local_func = wgl_driver->p_wglGetProcAddress( lpszProc ); if (local_func == (void *)1) /* special function that needs a wrapper */ { ext_ret = bsearch( &ext, wgl_extensions, sizeof(wgl_extensions)/sizeof(wgl_extensions[0]), @@ -531,7 +529,7 @@ PROC WINAPI wglGetProcAddress(LPCSTR lpszProc) { WARN("Extension '%s' required by function '%s' not supported!\n", ext_ret->extension, lpszProc); } - local_func = wine_wgl.p_wglGetProcAddress(ext_ret->name); + local_func = wgl_driver->p_wglGetProcAddress(ext_ret->name); /* After that, look at the extensions defined in the Linux OpenGL library */ if (local_func == NULL) { @@ -1113,27 +1111,16 @@ BOOL WINAPI DECLSPEC_HOTPATCH wglSwapBuffers( HDC hdc ) creating a rendering context.... */ static BOOL process_attach(void) { - HMODULE mod_gdi32; HDC hdc = GetDC( 0 ); wgl_driver = __wine_get_wgl_driver( hdc, WINE_GDI_DRIVER_VERSION ); ReleaseDC( 0, hdc ); - mod_gdi32 = GetModuleHandleA( "gdi32.dll" ); - - if (!mod_gdi32) - { - ERR("GDI32 not loaded. Cannot create default context.\n"); - return FALSE; - } - - wine_wgl.p_wglGetProcAddress = (void *)GetProcAddress(mod_gdi32, "wglGetProcAddress"); - /* internal WGL functions */ - wine_wgl.p_wglFinish = (void *)wine_wgl.p_wglGetProcAddress("wglFinish"); - wine_wgl.p_wglFlush = (void *)wine_wgl.p_wglGetProcAddress("wglFlush"); - wine_wgl.p_wglGetCurrentContext = (void *)wine_wgl.p_wglGetProcAddress("wglGetCurrentContext"); - wine_wgl.p_wglGetIntegerv = (void *)wine_wgl.p_wglGetProcAddress("wglGetIntegerv"); + wine_wgl.p_wglFinish = (void *)wgl_driver->p_wglGetProcAddress("wglFinish"); + wine_wgl.p_wglFlush = (void *)wgl_driver->p_wglGetProcAddress("wglFlush"); + wine_wgl.p_wglGetCurrentContext = (void *)wgl_driver->p_wglGetProcAddress("wglGetCurrentContext"); + wine_wgl.p_wglGetIntegerv = (void *)wgl_driver->p_wglGetProcAddress("wglGetIntegerv"); return TRUE; } diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index f576b33..1cce96b 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -27,6 +27,9 @@ #include <stdio.h> #include "wined3d_private.h" +#ifndef USE_WIN32_OPENGL +#include "wine/gdi_driver.h" +#endif WINE_DEFAULT_DEBUG_CHANNEL(d3d); @@ -5386,15 +5389,15 @@ static BOOL InitAdapters(struct wined3d *wined3d) #define USE_GL_FUNC(pfn) pfn = (void*)GetProcAddress(mod_gl, #pfn); #else /* To bypass the opengl32 thunks load wglGetProcAddress from gdi32 instead of opengl32 */ - pwglGetProcAddress = (void*)GetProcAddress(GetModuleHandleA("gdi32.dll"), "wglGetProcAddress"); + { + HDC hdc = GetDC( 0 ); + const struct wgl_funcs *wgl_driver = __wine_get_wgl_driver( hdc, WINE_GDI_DRIVER_VERSION ); + pwglGetProcAddress = wgl_driver->p_wglGetProcAddress; + ReleaseDC( 0, hdc ); + } #define USE_GL_FUNC(pfn) pfn = (void*)pwglGetProcAddress(#pfn); #endif - if(!pwglGetProcAddress) { - ERR("Unable to load wglGetProcAddress!\n"); - goto nogl_adapter; - } - /* Load WGL core functions from opengl32.dll */ #define USE_WGL_FUNC(pfn) p##pfn = (void*)GetProcAddress(mod_gl, #pfn); WGL_FUNCS_GEN; @@ -5407,13 +5410,8 @@ static BOOL InitAdapters(struct wined3d *wined3d) /* Load glFinish and glFlush from opengl32.dll even if we're not using WIN32 opengl * otherwise because we have to use winex11.drv's override */ -#ifdef USE_WIN32_OPENGL wglFinish = (void*)GetProcAddress(mod_gl, "glFinish"); wglFlush = (void*)GetProcAddress(mod_gl, "glFlush"); -#else - wglFinish = (void*)pwglGetProcAddress("wglFinish"); - wglFlush = (void*)pwglGetProcAddress("wglFlush"); -#endif glEnableWINE = glEnable; glDisableWINE = glDisable; diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 51281e4..b8e2195 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -1369,7 +1369,7 @@ HGLRC (WINAPI *pwglCreateContext)(HDC) DECLSPEC_HIDDEN; BOOL (WINAPI *pwglDeleteContext)(HGLRC) DECLSPEC_HIDDEN; HGLRC (WINAPI *pwglGetCurrentContext)(void) DECLSPEC_HIDDEN; HDC (WINAPI *pwglGetCurrentDC)(void) DECLSPEC_HIDDEN; -PROC (WINAPI *pwglGetProcAddress)(LPCSTR) DECLSPEC_HIDDEN; +PROC (WINE_GLAPI *pwglGetProcAddress)(LPCSTR) DECLSPEC_HIDDEN; BOOL (WINAPI *pwglMakeCurrent)(HDC, HGLRC) DECLSPEC_HIDDEN; BOOL (WINAPI *pwglShareLists)(HGLRC, HGLRC) DECLSPEC_HIDDEN; diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 5f7c3d7..10cd5ef 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1521,10 +1521,8 @@ static HDC WINAPI X11DRV_wglGetCurrentReadDCARB(void) return ret; } -/** - * glxdrv_wglGetProcAddress - * - * For OpenGL32 wglGetProcAddress. +/*********************************************************************** + * glxdrv_wglGetProcAddress */ static PROC glxdrv_wglGetProcAddress(LPCSTR lpszProc) { @@ -1535,8 +1533,6 @@ static PROC glxdrv_wglGetProcAddress(LPCSTR lpszProc) if (padding < 0) padding = 0; - if (!has_opengl()) return NULL; - /* Check the table of WGL extensions to see if we need to return a WGL extension * or a function pointer to a native OpenGL function. */ if(strncmp(lpszProc, "wgl", 3) != 0) { @@ -3596,7 +3592,7 @@ static const struct gdi_dc_funcs glxdrv_funcs = NULL, /* pWidenPath */ NULL, /* pwglCreateContext */ NULL, /* pwglCreateContextAttribsARB */ - glxdrv_wglGetProcAddress, /* pwglGetProcAddress */ + NULL, /* pwglGetProcAddress */ glxdrv_wine_get_wgl_driver, /* wine_get_wgl_driver */ GDI_PRIORITY_GRAPHICS_DRV + 20 /* priority */ }; @@ -3609,6 +3605,7 @@ static const struct wgl_funcs glxdrv_wgl_funcs = glxdrv_wglCreateContextAttribsARB, /* p_wglCreateContextAttribsARB */ glxdrv_wglDeleteContext, /* p_wglDeleteContext */ glxdrv_wglGetCurrentDC, /* p_wglGetCurrentDC */ + glxdrv_wglGetProcAddress, /* p_wglGetProcAddress */ glxdrv_wglMakeContextCurrentARB, /* p_wglMakeContextCurrentARB */ glxdrv_wglMakeCurrent, /* p_wglMakeCurrent */ glxdrv_wglShareLists, /* p_wglShareLists */ diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 4f8d0f1..1476beb 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -203,7 +203,7 @@ struct gdi_dc_funcs }; /* increment this when you change the DC function table */ -#define WINE_GDI_DRIVER_VERSION 37 +#define WINE_GDI_DRIVER_VERSION 38 #define GDI_PRIORITY_NULL_DRV 0 /* null driver */ #define GDI_PRIORITY_FONT_DRV 100 /* any font driver */ @@ -239,6 +239,7 @@ struct wgl_funcs HGLRC (*p_wglCreateContextAttribsARB)(HDC,HGLRC,const int*); BOOL (*p_wglDeleteContext)(HGLRC); HDC (*p_wglGetCurrentDC)(void); + PROC (*p_wglGetProcAddress)(LPCSTR); BOOL (*p_wglMakeContextCurrentARB)(HDC,HDC,HGLRC); BOOL (*p_wglMakeCurrent)(HDC,HGLRC); BOOL (*p_wglShareLists)(HGLRC,HGLRC);
1
0
0
0
Alexandre Julliard : opengl32: Move GetPixelFormat to the WGL driver.
by Alexandre Julliard
28 Jun '12
28 Jun '12
Module: wine Branch: master Commit: 8a13afedd6970ecccc64f105d7a459bc4292604c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8a13afedd6970ecccc64f105d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jun 28 15:51:44 2012 +0200 opengl32: Move GetPixelFormat to the WGL driver. --- dlls/gdi32/opengl.c | 15 +++++++++++ dlls/gdi32/painting.c | 29 --------------------- dlls/opengl32/wgl.c | 4 +-- dlls/winex11.drv/opengl.c | 61 +++++++++++++++++++++++--------------------- include/wine/gdi_driver.h | 3 +- 5 files changed, 50 insertions(+), 62 deletions(-) diff --git a/dlls/gdi32/opengl.c b/dlls/gdi32/opengl.c index f8e5de7..95db11d 100644 --- a/dlls/gdi32/opengl.c +++ b/dlls/gdi32/opengl.c @@ -42,6 +42,7 @@ static const WCHAR opengl32W[] = {'o','p','e','n','g','l','3','2','.','d','l','l static HMODULE opengl32; static INT (WINAPI *wglChoosePixelFormat)(HDC,const PIXELFORMATDESCRIPTOR *); static INT (WINAPI *wglDescribePixelFormat)(HDC,INT,UINT,PIXELFORMATDESCRIPTOR*); +static INT (WINAPI *wglGetPixelFormat)(HDC); static BOOL (WINAPI *wglSetPixelFormat)(HDC,INT,const PIXELFORMATDESCRIPTOR*); static BOOL (WINAPI *wglSwapBuffers)(HDC); @@ -131,6 +132,20 @@ INT WINAPI DescribePixelFormat( HDC hdc, INT fmt, UINT size, PIXELFORMATDESCRIPT } /****************************************************************************** + * GetPixelFormat (GDI32.@) + */ +INT WINAPI GetPixelFormat( HDC hdc ) +{ + if (!wglGetPixelFormat) + { + if (!opengl32) opengl32 = LoadLibraryW( opengl32W ); + if (!(wglGetPixelFormat = (void *)GetProcAddress( opengl32, "wglGetPixelFormat" ))) + return 0; + } + return wglGetPixelFormat( hdc ); +} + +/****************************************************************************** * SetPixelFormat (GDI32.@) */ BOOL WINAPI SetPixelFormat( HDC hdc, INT fmt, const PIXELFORMATDESCRIPTOR *pfd ) diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c index 571a96b..822c86a 100644 --- a/dlls/gdi32/painting.c +++ b/dlls/gdi32/painting.c @@ -509,35 +509,6 @@ BOOL WINAPI GdiSetPixelFormat( HDC hdc, INT iPixelFormat, const PIXELFORMATDESCR /****************************************************************************** - * GetPixelFormat [GDI32.@] - * Gets index of pixel format of DC - * - * PARAMETERS - * hdc [I] Device context whose pixel format index is sought - * - * RETURNS - * Success: Currently selected pixel format - * Failure: 0 - */ -INT WINAPI GetPixelFormat( HDC hdc ) -{ - INT ret = 0; - DC * dc = get_dc_ptr( hdc ); - - TRACE("(%p)\n",hdc); - - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pGetPixelFormat ); - update_dc( dc ); - ret = physdev->funcs->pGetPixelFormat( physdev ); - release_dc_ptr( dc ); - } - return ret; -} - - -/****************************************************************************** * GdiDescribePixelFormat [GDI32.@] * * Probably not the correct semantics, it's supposed to be an internal backend for DescribePixelFormat. diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index c604774..0a19506 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -49,7 +49,6 @@ WINE_DECLARE_DEBUG_CHANNEL(opengl); static struct { PROC (WINAPI *p_wglGetProcAddress)(LPCSTR lpszProc); - INT (WINAPI *p_GetPixelFormat)(HDC hdc); /* internal WGL functions */ void (WINAPI *p_wglFinish)(void); @@ -361,7 +360,7 @@ INT WINAPI wglDescribePixelFormat(HDC hdc, INT iPixelFormat, UINT nBytes, */ INT WINAPI wglGetPixelFormat(HDC hdc) { - return wine_wgl.p_GetPixelFormat(hdc); + return wgl_driver->p_GetPixelFormat( hdc ); } /*********************************************************************** @@ -1129,7 +1128,6 @@ static BOOL process_attach(void) } wine_wgl.p_wglGetProcAddress = (void *)GetProcAddress(mod_gdi32, "wglGetProcAddress"); - wine_wgl.p_GetPixelFormat = (void *)GetProcAddress(mod_gdi32, "GetPixelFormat"); /* internal WGL functions */ wine_wgl.p_wglFinish = (void *)wine_wgl.p_wglGetProcAddress("wglFinish"); diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index df625d3..5f7c3d7 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1281,41 +1281,43 @@ static int glxdrv_DescribePixelFormat(PHYSDEV dev, int iPixelFormat, return ret; } -/** - * glxdrv_GetPixelFormat - * - * Get the pixel-format id used by this DC +/*********************************************************************** + * glxdrv_GetPixelFormat */ -static int glxdrv_GetPixelFormat(PHYSDEV dev) +static int glxdrv_GetPixelFormat( HDC hdc ) { - struct glx_physdev *physdev = get_glxdrv_dev( dev ); - WineGLPixelFormat *fmt; - int tmp; + struct x11drv_escape_get_drawable escape; + WineGLPixelFormat *fmt; + int tmp; - if (!physdev->pixel_format) return 0; /* not set yet */ + TRACE( "(%p)\n", hdc ); - fmt = ConvertPixelFormatWGLtoGLX(gdi_display, physdev->pixel_format, TRUE, &tmp); - if(!fmt) - { - ERR("Unable to find a WineGLPixelFormat for iPixelFormat=%d\n", physdev->pixel_format); - return 0; - } - else if(fmt->offscreenOnly) - { - /* Offscreen formats can't be used with traditional WGL calls. - * As has been verified on Windows GetPixelFormat doesn't fail but returns iPixelFormat=1. */ - TRACE("Returning iPixelFormat=1 for offscreen format: %d\n", fmt->iPixelFormat); - return 1; - } + escape.code = X11DRV_GET_DRAWABLE; + if (!ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape.code), (LPCSTR)&escape.code, + sizeof(escape), (LPSTR)&escape )) + return 0; - TRACE("(%p): returns %d\n", dev->hdc, physdev->pixel_format); - return physdev->pixel_format; + if (!escape.pixel_format) return 0; /* not set yet */ + + fmt = ConvertPixelFormatWGLtoGLX(gdi_display, escape.pixel_format, TRUE, &tmp); + if (!fmt) + { + ERR("Unable to find a WineGLPixelFormat for iPixelFormat=%d\n", escape.pixel_format); + return 0; + } + if (fmt->offscreenOnly) + { + /* Offscreen formats can't be used with traditional WGL calls. + * As has been verified on Windows GetPixelFormat doesn't fail but returns iPixelFormat=1. */ + TRACE("Returning iPixelFormat=1 for offscreen format: %d\n", fmt->iPixelFormat); + return 1; + } + TRACE("(%p): returns %d\n", hdc, escape.pixel_format); + return escape.pixel_format; } -/** - * glxdrv_SetPixelFormat - * - * Set the pixel-format id used by this DC +/*********************************************************************** + * glxdrv_SetPixelFormat */ static BOOL glxdrv_SetPixelFormat(PHYSDEV dev, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) { @@ -3513,7 +3515,7 @@ static const struct gdi_dc_funcs glxdrv_funcs = NULL, /* pGetNearestColor */ NULL, /* pGetOutlineTextMetrics */ NULL, /* pGetPixel */ - glxdrv_GetPixelFormat, /* pGetPixelFormat */ + NULL, /* pGetPixelFormat */ NULL, /* pGetSystemPaletteEntries */ NULL, /* pGetTextCharsetInfo */ NULL, /* pGetTextExtentExPoint */ @@ -3601,6 +3603,7 @@ static const struct gdi_dc_funcs glxdrv_funcs = static const struct wgl_funcs glxdrv_wgl_funcs = { + glxdrv_GetPixelFormat, /* p_GetPixelFormat */ glxdrv_wglCopyContext, /* p_wglCopyContext */ glxdrv_wglCreateContext, /* p_wglCreateContext */ glxdrv_wglCreateContextAttribsARB, /* p_wglCreateContextAttribsARB */ diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 796d4fa..4f8d0f1 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -203,7 +203,7 @@ struct gdi_dc_funcs }; /* increment this when you change the DC function table */ -#define WINE_GDI_DRIVER_VERSION 36 +#define WINE_GDI_DRIVER_VERSION 37 #define GDI_PRIORITY_NULL_DRV 0 /* null driver */ #define GDI_PRIORITY_FONT_DRV 100 /* any font driver */ @@ -233,6 +233,7 @@ static inline void push_dc_driver( PHYSDEV *dev, PHYSDEV physdev, const struct g struct wgl_funcs { + INT (*p_GetPixelFormat)(HDC); BOOL (*p_wglCopyContext)(HGLRC,HGLRC,UINT); HGLRC (*p_wglCreateContext)(HDC); HGLRC (*p_wglCreateContextAttribsARB)(HDC,HGLRC,const int*);
1
0
0
0
Alexandre Julliard : opengl32: Move wglCreateContext to the WGL driver.
by Alexandre Julliard
28 Jun '12
28 Jun '12
Module: wine Branch: master Commit: bbdf77a3118df6af777af73fd3fa1efe592d315a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bbdf77a3118df6af777af73fd…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jun 28 15:47:31 2012 +0200 opengl32: Move wglCreateContext to the WGL driver. --- dlls/gdi32/gdi32.spec | 1 - dlls/gdi32/opengl.c | 20 -------------------- dlls/opengl32/wgl.c | 4 +--- dlls/winex11.drv/opengl.c | 26 ++++++++++++++------------ include/wine/gdi_driver.h | 3 ++- 5 files changed, 17 insertions(+), 37 deletions(-) diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec index 5954892..9dfa4dd 100644 --- a/dlls/gdi32/gdi32.spec +++ b/dlls/gdi32/gdi32.spec @@ -499,7 +499,6 @@ ################################################################ # Wine extensions: OpenGL support # -@ stdcall -private wglCreateContext(long) @ stdcall -private wglGetProcAddress(str) ################################################################ diff --git a/dlls/gdi32/opengl.c b/dlls/gdi32/opengl.c index 81a9824..f8e5de7 100644 --- a/dlls/gdi32/opengl.c +++ b/dlls/gdi32/opengl.c @@ -62,26 +62,6 @@ static DC* OPENGL_GetDefaultDC(void) } /*********************************************************************** - * wglCreateContext (OPENGL32.@) - */ -HGLRC WINAPI wglCreateContext(HDC hdc) -{ - HGLRC ret = 0; - DC * dc = get_dc_ptr( hdc ); - - TRACE("(%p)\n",hdc); - - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglCreateContext ); - update_dc( dc ); - ret = physdev->funcs->pwglCreateContext( physdev ); - release_dc_ptr( dc ); - } - return ret; -} - -/*********************************************************************** * Internal wglGetProcAddress for retrieving WGL extensions */ PROC WINAPI wglGetProcAddress(LPCSTR func) diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index ab26f4a..c604774 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -49,7 +49,6 @@ WINE_DECLARE_DEBUG_CHANNEL(opengl); static struct { PROC (WINAPI *p_wglGetProcAddress)(LPCSTR lpszProc); - HGLRC (WINAPI *p_wglCreateContext)(HDC hdc); INT (WINAPI *p_GetPixelFormat)(HDC hdc); /* internal WGL functions */ @@ -174,7 +173,7 @@ HDC WINAPI wglGetCurrentDC(void) */ HGLRC WINAPI wglCreateContext(HDC hdc) { - return wine_wgl.p_wglCreateContext(hdc); + return wgl_driver->p_wglCreateContext(hdc); } /*********************************************************************** @@ -1130,7 +1129,6 @@ static BOOL process_attach(void) } wine_wgl.p_wglGetProcAddress = (void *)GetProcAddress(mod_gdi32, "wglGetProcAddress"); - wine_wgl.p_wglCreateContext = (void *)GetProcAddress(mod_gdi32, "wglCreateContext"); wine_wgl.p_GetPixelFormat = (void *)GetProcAddress(mod_gdi32, "GetPixelFormat"); /* internal WGL functions */ diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 90d4cd6..df625d3 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1413,36 +1413,37 @@ static BOOL glxdrv_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) return TRUE; } -/** - * X11DRV_wglCreateContext - * - * For OpenGL32 wglCreateContext. +/*********************************************************************** + * glxdrv_wglCreateContext */ -static HGLRC glxdrv_wglCreateContext(PHYSDEV dev) +static HGLRC glxdrv_wglCreateContext( HDC hdc ) { - struct glx_physdev *physdev = get_glxdrv_dev( dev ); + struct x11drv_escape_get_drawable escape; Wine_GLContext *ret; WineGLPixelFormat *fmt; int fmt_count = 0; - TRACE("(%p)->(PF:%d)\n", dev->hdc, physdev->pixel_format); + TRACE( "(%p)\n", hdc ); - if (!has_opengl()) return 0; + escape.code = X11DRV_GET_DRAWABLE; + if (!ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape.code), (LPCSTR)&escape.code, + sizeof(escape), (LPSTR)&escape )) + return 0; - fmt = ConvertPixelFormatWGLtoGLX(gdi_display, physdev->pixel_format, TRUE /* Offscreen */, &fmt_count); + fmt = ConvertPixelFormatWGLtoGLX(gdi_display, escape.pixel_format, TRUE /* Offscreen */, &fmt_count); /* We can render using the iPixelFormat (1) of Wine's Main visual AND using some offscreen formats. * Note that standard WGL-calls don't recognize offscreen-only formats. For that reason pbuffers * use a sort of 'proxy' HDC (wglGetPbufferDCARB). * If this fails something is very wrong on the system. */ if(!fmt) { - ERR("Cannot get FB Config for iPixelFormat %d, expect problems!\n", physdev->pixel_format); + ERR("Cannot get FB Config for iPixelFormat %d, expect problems!\n", escape.pixel_format); SetLastError(ERROR_INVALID_PIXEL_FORMAT); return NULL; } if (!(ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret)))) return 0; - ret->hdc = dev->hdc; + ret->hdc = hdc; ret->fmt = fmt; ret->has_been_current = FALSE; ret->sharing = FALSE; @@ -3591,7 +3592,7 @@ static const struct gdi_dc_funcs glxdrv_funcs = glxdrv_SwapBuffers, /* pSwapBuffers */ NULL, /* pUnrealizePalette */ NULL, /* pWidenPath */ - glxdrv_wglCreateContext, /* pwglCreateContext */ + NULL, /* pwglCreateContext */ NULL, /* pwglCreateContextAttribsARB */ glxdrv_wglGetProcAddress, /* pwglGetProcAddress */ glxdrv_wine_get_wgl_driver, /* wine_get_wgl_driver */ @@ -3601,6 +3602,7 @@ static const struct gdi_dc_funcs glxdrv_funcs = static const struct wgl_funcs glxdrv_wgl_funcs = { glxdrv_wglCopyContext, /* p_wglCopyContext */ + glxdrv_wglCreateContext, /* p_wglCreateContext */ glxdrv_wglCreateContextAttribsARB, /* p_wglCreateContextAttribsARB */ glxdrv_wglDeleteContext, /* p_wglDeleteContext */ glxdrv_wglGetCurrentDC, /* p_wglGetCurrentDC */ diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index b3d01d4..796d4fa 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -203,7 +203,7 @@ struct gdi_dc_funcs }; /* increment this when you change the DC function table */ -#define WINE_GDI_DRIVER_VERSION 35 +#define WINE_GDI_DRIVER_VERSION 36 #define GDI_PRIORITY_NULL_DRV 0 /* null driver */ #define GDI_PRIORITY_FONT_DRV 100 /* any font driver */ @@ -234,6 +234,7 @@ static inline void push_dc_driver( PHYSDEV *dev, PHYSDEV physdev, const struct g struct wgl_funcs { BOOL (*p_wglCopyContext)(HGLRC,HGLRC,UINT); + HGLRC (*p_wglCreateContext)(HDC); HGLRC (*p_wglCreateContextAttribsARB)(HDC,HGLRC,const int*); BOOL (*p_wglDeleteContext)(HGLRC); HDC (*p_wglGetCurrentDC)(void);
1
0
0
0
Alexandre Julliard : opengl32: Move wglCreateContextAttribsARB to the WGL driver.
by Alexandre Julliard
28 Jun '12
28 Jun '12
Module: wine Branch: master Commit: 3bcb8057a17fc3386e756706022510784291869d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3bcb8057a17fc3386e7567060…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jun 28 15:07:44 2012 +0200 opengl32: Move wglCreateContextAttribsARB to the WGL driver. --- dlls/gdi32/opengl.c | 29 ----------------------------- dlls/opengl32/wgl.c | 27 ++++++++++++++++++++------- dlls/winex11.drv/opengl.c | 28 +++++++++++++++------------- include/wine/gdi_driver.h | 3 ++- 4 files changed, 37 insertions(+), 50 deletions(-) diff --git a/dlls/gdi32/opengl.c b/dlls/gdi32/opengl.c index ba4106b..81a9824 100644 --- a/dlls/gdi32/opengl.c +++ b/dlls/gdi32/opengl.c @@ -82,26 +82,6 @@ HGLRC WINAPI wglCreateContext(HDC hdc) } /*********************************************************************** - * wglCreateContextAttribsARB - */ -static HGLRC WINAPI wglCreateContextAttribsARB(HDC hdc, HGLRC hShareContext, const int *attributeList) -{ - HGLRC ret = 0; - DC * dc = get_dc_ptr( hdc ); - - TRACE("(%p)\n",hdc); - - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglCreateContextAttribsARB ); - update_dc( dc ); - ret = physdev->funcs->pwglCreateContextAttribsARB( physdev, hShareContext, attributeList ); - release_dc_ptr( dc ); - } - return ret; -} - -/*********************************************************************** * Internal wglGetProcAddress for retrieving WGL extensions */ PROC WINAPI wglGetProcAddress(LPCSTR func) @@ -122,15 +102,6 @@ PROC WINAPI wglGetProcAddress(LPCSTR func) ret = physdev->funcs->pwglGetProcAddress(func); release_dc_ptr( dc ); } - - /* At the moment we implement one WGL extension which requires a HDC. When we - * are looking up this call and when the Extension is available (that is the case - * when a non-NULL value is returned by wglGetProcAddress), we return the address - * of a wrapper function which will handle the HDC->PhysDev conversion. - */ - if(ret && strcmp(func, "wglCreateContextAttribsARB") == 0) - return (PROC)wglCreateContextAttribsARB; - return ret; } diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 9761bba..ab26f4a 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -133,6 +133,14 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc) } /*********************************************************************** + * wglCreateContextAttribsARB (wrapper for the extension function returned by the driver) + */ +static HGLRC WINAPI wglCreateContextAttribsARB( HDC hdc, HGLRC share, const int *attribs ) +{ + return wgl_driver->p_wglCreateContextAttribsARB( hdc, share, attribs ); +} + +/*********************************************************************** * wglMakeContextCurrentARB (wrapper for the extension function returned by the driver) */ static BOOL WINAPI wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC hglrc ) @@ -464,6 +472,12 @@ static BOOL is_extension_supported(const char* extension) return FALSE; } +static const OpenGL_extension wgl_extensions[] = +{ + { "wglCreateContextAttribsARB", "WGL_ARB_create_context", wglCreateContextAttribsARB }, + { "wglMakeContextCurrentARB", "WGL_ARB_make_current_read", wglMakeContextCurrentARB }, +}; + /*********************************************************************** * wglGetProcAddress (OPENGL32.@) */ @@ -499,13 +513,12 @@ PROC WINAPI wglGetProcAddress(LPCSTR lpszProc) { local_func = wine_wgl.p_wglGetProcAddress( lpszProc ); if (local_func == (void *)1) /* special function that needs a wrapper */ { - if (!strcmp( lpszProc, "wglMakeContextCurrentARB" )) - local_func = wglMakeContextCurrentARB; - else - { - FIXME( "wrapper missing for %s\n", lpszProc ); - local_func = NULL; - } + ext_ret = bsearch( &ext, wgl_extensions, sizeof(wgl_extensions)/sizeof(wgl_extensions[0]), + sizeof(OpenGL_extension), compar ); + if (ext_ret) return ext_ret->func; + + FIXME( "wrapper missing for %s\n", lpszProc ); + return NULL; } return local_func; } diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index f99e98c..90d4cd6 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1913,35 +1913,36 @@ static void WINAPI X11DRV_wglFlush(void) } } -/** - * glxdrv_wglCreateContextAttribsARB - * - * WGL_ARB_create_context: wglCreateContextAttribsARB +/*********************************************************************** + * glxdrv_wglCreateContextAttribsARB */ -static HGLRC glxdrv_wglCreateContextAttribsARB(PHYSDEV dev, HGLRC hShareContext, const int* attribList) +static HGLRC glxdrv_wglCreateContextAttribsARB( HDC hdc, HGLRC hShareContext, const int* attribList ) { - struct glx_physdev *physdev = get_glxdrv_dev( dev ); + struct x11drv_escape_get_drawable escape; Wine_GLContext *ret; WineGLPixelFormat *fmt; int fmt_count = 0; - TRACE("(%p %p %p)\n", dev->hdc, hShareContext, attribList); + TRACE("(%p %p %p)\n", hdc, hShareContext, attribList); - if (!has_opengl()) return 0; + escape.code = X11DRV_GET_DRAWABLE; + if (!ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape.code), (LPCSTR)&escape.code, + sizeof(escape), (LPSTR)&escape )) + return 0; - fmt = ConvertPixelFormatWGLtoGLX(gdi_display, physdev->pixel_format, TRUE /* Offscreen */, &fmt_count); + fmt = ConvertPixelFormatWGLtoGLX(gdi_display, escape.pixel_format, TRUE /* Offscreen */, &fmt_count); /* wglCreateContextAttribsARB supports ALL pixel formats, so also offscreen ones. * If this fails something is very wrong on the system. */ if(!fmt) { - ERR("Cannot get FB Config for iPixelFormat %d, expect problems!\n", physdev->pixel_format); + ERR("Cannot get FB Config for iPixelFormat %d, expect problems!\n", escape.pixel_format); SetLastError(ERROR_INVALID_PIXEL_FORMAT); return NULL; } if (!(ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret)))) return 0; - ret->hdc = dev->hdc; + ret->hdc = hdc; ret->fmt = fmt; ret->vis = NULL; /* glXCreateContextAttribsARB requires a fbconfig instead of a visual */ ret->gl3_context = TRUE; @@ -3076,7 +3077,7 @@ static const WineGLExtension WGL_ARB_create_context = { "WGL_ARB_create_context", { - { "wglCreateContextAttribsARB", (void *)1 /* not called directly */ }, + { "wglCreateContextAttribsARB", (void *)1 /* called through the glxdrv_wgl_funcs driver */ }, } }; @@ -3591,7 +3592,7 @@ static const struct gdi_dc_funcs glxdrv_funcs = NULL, /* pUnrealizePalette */ NULL, /* pWidenPath */ glxdrv_wglCreateContext, /* pwglCreateContext */ - glxdrv_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */ + NULL, /* pwglCreateContextAttribsARB */ glxdrv_wglGetProcAddress, /* pwglGetProcAddress */ glxdrv_wine_get_wgl_driver, /* wine_get_wgl_driver */ GDI_PRIORITY_GRAPHICS_DRV + 20 /* priority */ @@ -3600,6 +3601,7 @@ static const struct gdi_dc_funcs glxdrv_funcs = static const struct wgl_funcs glxdrv_wgl_funcs = { glxdrv_wglCopyContext, /* p_wglCopyContext */ + glxdrv_wglCreateContextAttribsARB, /* p_wglCreateContextAttribsARB */ glxdrv_wglDeleteContext, /* p_wglDeleteContext */ glxdrv_wglGetCurrentDC, /* p_wglGetCurrentDC */ glxdrv_wglMakeContextCurrentARB, /* p_wglMakeContextCurrentARB */ diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 4f4ad94..b3d01d4 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -203,7 +203,7 @@ struct gdi_dc_funcs }; /* increment this when you change the DC function table */ -#define WINE_GDI_DRIVER_VERSION 34 +#define WINE_GDI_DRIVER_VERSION 35 #define GDI_PRIORITY_NULL_DRV 0 /* null driver */ #define GDI_PRIORITY_FONT_DRV 100 /* any font driver */ @@ -234,6 +234,7 @@ static inline void push_dc_driver( PHYSDEV *dev, PHYSDEV physdev, const struct g struct wgl_funcs { BOOL (*p_wglCopyContext)(HGLRC,HGLRC,UINT); + HGLRC (*p_wglCreateContextAttribsARB)(HDC,HGLRC,const int*); BOOL (*p_wglDeleteContext)(HGLRC); HDC (*p_wglGetCurrentDC)(void); BOOL (*p_wglMakeContextCurrentARB)(HDC,HDC,HGLRC);
1
0
0
0
Alexandre Julliard : opengl32: Move wglMakeContextCurrentARB to the WGL driver.
by Alexandre Julliard
28 Jun '12
28 Jun '12
Module: wine Branch: master Commit: 47fe838b152b54742e5af612ca4ad4fa1fb213e7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=47fe838b152b54742e5af612c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jun 28 14:49:49 2012 +0200 opengl32: Move wglMakeContextCurrentARB to the WGL driver. --- dlls/opengl32/wgl.c | 23 ++++++++++++++++++++++- dlls/winex11.drv/opengl.c | 11 +++++------ include/wine/gdi_driver.h | 3 ++- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 16a76db..9761bba 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -133,6 +133,14 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc) } /*********************************************************************** + * wglMakeContextCurrentARB (wrapper for the extension function returned by the driver) + */ +static BOOL WINAPI wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC hglrc ) +{ + return wgl_driver->p_wglMakeContextCurrentARB( draw_hdc, read_hdc, hglrc ); +} + +/*********************************************************************** * wglShareLists (OPENGL32.@) */ BOOL WINAPI wglShareLists(HGLRC hglrc1, HGLRC hglrc2) @@ -487,7 +495,20 @@ PROC WINAPI wglGetProcAddress(LPCSTR lpszProc) { if (ext_ret == NULL) { /* If the function name starts with a 'w', it is a WGL extension */ if(lpszProc[0] == 'w') - return wine_wgl.p_wglGetProcAddress(lpszProc); + { + local_func = wine_wgl.p_wglGetProcAddress( lpszProc ); + if (local_func == (void *)1) /* special function that needs a wrapper */ + { + if (!strcmp( lpszProc, "wglMakeContextCurrentARB" )) + local_func = wglMakeContextCurrentARB; + else + { + FIXME( "wrapper missing for %s\n", lpszProc ); + local_func = NULL; + } + } + return local_func; + } /* We are dealing with an unknown GL extension */ WARN("Extension '%s' not defined in opengl32.dll's function table!\n", lpszProc); diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 4c1ce9c..f99e98c 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1654,12 +1654,10 @@ static BOOL glxdrv_wglMakeCurrent(HDC hdc, HGLRC hglrc) return ret; } -/** - * X11DRV_wglMakeContextCurrentARB - * - * For OpenGL32 wglMakeContextCurrentARB +/*********************************************************************** + * glxdrv_wglMakeContextCurrentARB */ -static BOOL WINAPI X11DRV_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC hglrc ) +static BOOL glxdrv_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC hglrc ) { Wine_GLContext *ctx = (Wine_GLContext *)hglrc; Wine_GLContext *prev_ctx = NtCurrentTeb()->glContext; @@ -3095,7 +3093,7 @@ static const WineGLExtension WGL_ARB_make_current_read = "WGL_ARB_make_current_read", { { "wglGetCurrentReadDCARB", X11DRV_wglGetCurrentReadDCARB }, - { "wglMakeContextCurrentARB", X11DRV_wglMakeContextCurrentARB }, + { "wglMakeContextCurrentARB", (void *)1 /* called through the glxdrv_wgl_funcs driver */ }, } }; @@ -3604,6 +3602,7 @@ static const struct wgl_funcs glxdrv_wgl_funcs = glxdrv_wglCopyContext, /* p_wglCopyContext */ glxdrv_wglDeleteContext, /* p_wglDeleteContext */ glxdrv_wglGetCurrentDC, /* p_wglGetCurrentDC */ + glxdrv_wglMakeContextCurrentARB, /* p_wglMakeContextCurrentARB */ glxdrv_wglMakeCurrent, /* p_wglMakeCurrent */ glxdrv_wglShareLists, /* p_wglShareLists */ }; diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 7a17d09..4f4ad94 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -203,7 +203,7 @@ struct gdi_dc_funcs }; /* increment this when you change the DC function table */ -#define WINE_GDI_DRIVER_VERSION 33 +#define WINE_GDI_DRIVER_VERSION 34 #define GDI_PRIORITY_NULL_DRV 0 /* null driver */ #define GDI_PRIORITY_FONT_DRV 100 /* any font driver */ @@ -236,6 +236,7 @@ struct wgl_funcs BOOL (*p_wglCopyContext)(HGLRC,HGLRC,UINT); BOOL (*p_wglDeleteContext)(HGLRC); HDC (*p_wglGetCurrentDC)(void); + BOOL (*p_wglMakeContextCurrentARB)(HDC,HDC,HGLRC); BOOL (*p_wglMakeCurrent)(HDC,HGLRC); BOOL (*p_wglShareLists)(HGLRC,HGLRC); };
1
0
0
0
Alexandre Julliard : opengl32: Add the concept of a WGL driver.
by Alexandre Julliard
28 Jun '12
28 Jun '12
Module: wine Branch: master Commit: 7a031d9b92320f1cb2d30d112d0e7a7afcf10c73 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7a031d9b92320f1cb2d30d112…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jun 28 14:13:24 2012 +0200 opengl32: Add the concept of a WGL driver. --- dlls/gdi32/dibdrv/dc.c | 4 +-- dlls/gdi32/driver.c | 18 ++-------- dlls/gdi32/enhmfdrv/init.c | 4 +-- dlls/gdi32/freetype.c | 4 +-- dlls/gdi32/gdi32.spec | 3 ++ dlls/gdi32/mfdrv/init.c | 4 +-- dlls/gdi32/opengl.c | 17 +++++++++ dlls/gdi32/path.c | 4 +-- dlls/opengl32/wgl.c | 28 ++++++-------- dlls/wineps.drv/init.c | 4 +-- dlls/winex11.drv/init.c | 13 +------ dlls/winex11.drv/opengl.c | 83 ++++++++++++++++++++++++------------------- dlls/winex11.drv/xrender.c | 4 +-- include/wine/gdi_driver.h | 19 ++++++++-- 14 files changed, 104 insertions(+), 105 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=7a031d9b92320f1cb2d30…
1
0
0
0
Alexandre Julliard : winex11: Simplify wglSetPixelFormatWINE and export it as a standard extension function .
by Alexandre Julliard
28 Jun '12
28 Jun '12
Module: wine Branch: master Commit: db25d4022aad801a455bea09267a4be8ed0206fb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=db25d4022aad801a455bea092…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jun 28 12:00:45 2012 +0200 winex11: Simplify wglSetPixelFormatWINE and export it as a standard extension function. --- dlls/gdi32/opengl.c | 23 ------------ dlls/wined3d/context.c | 2 +- dlls/wined3d/wined3d_gl.h | 3 +- dlls/winex11.drv/opengl.c | 83 +++++++++++++++++++++++++-------------------- 4 files changed, 48 insertions(+), 63 deletions(-) diff --git a/dlls/gdi32/opengl.c b/dlls/gdi32/opengl.c index 90c2a87..df7424d 100644 --- a/dlls/gdi32/opengl.c +++ b/dlls/gdi32/opengl.c @@ -101,27 +101,6 @@ static HGLRC WINAPI wglCreateContextAttribsARB(HDC hdc, HGLRC hShareContext, con return ret; } -/************************************************************************************** - * WINE-specific wglSetPixelFormat which can set the iPixelFormat multiple times - * - */ -static BOOL WINAPI wglSetPixelFormatWINE(HDC hdc, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) -{ - INT bRet = FALSE; - DC * dc = get_dc_ptr( hdc ); - - TRACE("(%p,%d,%p)\n", hdc, iPixelFormat, ppfd); - - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglSetPixelFormatWINE ); - update_dc( dc ); - bRet = physdev->funcs->pwglSetPixelFormatWINE( physdev, iPixelFormat, ppfd ); - release_dc_ptr( dc ); - } - return bRet; -} - /*********************************************************************** * Internal wglGetProcAddress for retrieving WGL extensions */ @@ -151,8 +130,6 @@ PROC WINAPI wglGetProcAddress(LPCSTR func) */ if(ret && strcmp(func, "wglCreateContextAttribsARB") == 0) return (PROC)wglCreateContextAttribsARB; - else if(ret && strcmp(func, "wglSetPixelFormatWINE") == 0) - return (PROC)wglSetPixelFormatWINE; return ret; } diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index b5db3e1..e53936f 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -741,7 +741,7 @@ static BOOL context_set_pixel_format(const struct wined3d_gl_info *gl_info, HDC * when really needed. */ if (gl_info->supported[WGL_WINE_PIXEL_FORMAT_PASSTHROUGH]) { - if (!GL_EXTCALL(wglSetPixelFormatWINE(dc, format, NULL))) + if (!GL_EXTCALL(wglSetPixelFormatWINE(dc, format))) { ERR("wglSetPixelFormatWINE failed to set pixel format %d on device context %p.\n", format, dc); diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index fe156d0..51281e4 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -3770,8 +3770,7 @@ typedef BOOL (WINAPI *WINED3D_PFNWGLCHOOSEPIXELFORMATARBPROC)(HDC hdc, const int #endif /* WGL_WINE_pixel_format_passthrough */ -typedef BOOL (WINAPI *WINED3D_PFNWGLSETPIXELFORMATWINE)(HDC hdc, int iPixelFormat, - const PIXELFORMATDESCRIPTOR *ppfd); +typedef BOOL (WINAPI *WINED3D_PFNWGLSETPIXELFORMATWINE)(HDC hdc, int iPixelFormat); typedef BOOL (WINAPI *WINED3D_PFNWGLSWAPINTERVALEXTPROC)(int interval); diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index b78edc3..09694f1 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1310,17 +1310,25 @@ static int glxdrv_GetPixelFormat(PHYSDEV dev) return physdev->pixel_format; } -/* This function is the core of X11DRV_SetPixelFormat and X11DRV_SetPixelFormatWINE. - * Both functions are the same except that X11DRV_SetPixelFormatWINE allows you to - * set the pixel format multiple times. */ -static BOOL internal_SetPixelFormat( struct glx_physdev *physdev, - int iPixelFormat, - const PIXELFORMATDESCRIPTOR *ppfd) +/** + * glxdrv_SetPixelFormat + * + * Set the pixel-format id used by this DC + */ +static BOOL glxdrv_SetPixelFormat(PHYSDEV dev, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) { + struct glx_physdev *physdev = get_glxdrv_dev( dev ); WineGLPixelFormat *fmt; int value; HWND hwnd; + TRACE("(%p,%d,%p)\n", dev->hdc, iPixelFormat, ppfd); + + if (!has_opengl()) return FALSE; + + if(physdev->pixel_format) /* cannot change it if already set */ + return (physdev->pixel_format == iPixelFormat); + /* SetPixelFormat is not allowed on the X root_window e.g. GetDC(0) */ if(physdev->x11dev->drawable == root_window) { @@ -1385,26 +1393,6 @@ static BOOL internal_SetPixelFormat( struct glx_physdev *physdev, return TRUE; } - -/** - * glxdrv_SetPixelFormat - * - * Set the pixel-format id used by this DC - */ -static BOOL glxdrv_SetPixelFormat(PHYSDEV dev, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) -{ - struct glx_physdev *physdev = get_glxdrv_dev( dev ); - - TRACE("(%p,%d,%p)\n", dev->hdc, iPixelFormat, ppfd); - - if (!has_opengl()) return FALSE; - - if(physdev->pixel_format) /* cannot change it if already set */ - return (physdev->pixel_format == iPixelFormat); - - return internal_SetPixelFormat(physdev, iPixelFormat, ppfd); -} - /** * X11DRV_wglCopyContext * @@ -2991,24 +2979,45 @@ static void WINAPI X11DRV_wglFreeMemoryNV(GLvoid* pointer) { } /** - * glxdrv_wglSetPixelFormatWINE + * X11DRV_wglSetPixelFormatWINE * * WGL_WINE_pixel_format_passthrough: wglSetPixelFormatWINE * This is a WINE-specific wglSetPixelFormat which can set the pixel format multiple times. */ -static BOOL glxdrv_wglSetPixelFormatWINE(PHYSDEV dev, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) +static BOOL WINAPI X11DRV_wglSetPixelFormatWINE(HDC hdc, int format) { - struct glx_physdev *physdev = get_glxdrv_dev( dev ); + WineGLPixelFormat *fmt; + int value; + HWND hwnd; - TRACE("(%p,%d,%p)\n", dev->hdc, iPixelFormat, ppfd); + TRACE("(%p,%d)\n", hdc, format); - if (!has_opengl()) return FALSE; + fmt = ConvertPixelFormatWGLtoGLX(gdi_display, format, FALSE /* Offscreen */, &value); + if (!fmt) + { + ERR( "Invalid format %d\n", format ); + return FALSE; + } - if (physdev->pixel_format == iPixelFormat) return TRUE; + hwnd = WindowFromDC( hdc ); + if (!hwnd || hwnd == GetDesktopWindow()) + { + ERR( "not a valid window DC %p\n", hdc ); + return FALSE; + } + + wine_tsx11_lock(); + pglXGetFBConfigAttrib(gdi_display, fmt->fbconfig, GLX_DRAWABLE_TYPE, &value); + wine_tsx11_unlock(); + + if (!(value & GLX_WINDOW_BIT)) + { + WARN( "Pixel format %d is not compatible for window rendering\n", format ); + return FALSE; + } - /* Relay to the core SetPixelFormat */ - TRACE("Changing iPixelFormat from %d to %d\n", physdev->pixel_format, iPixelFormat); - return internal_SetPixelFormat(physdev, iPixelFormat, ppfd); + return SendMessageW(hwnd, WM_X11DRV_SET_WIN_FORMAT, fmt->fmt_id, 0); + /* DC pixel format will be set by the DCE update */ } /** @@ -3167,7 +3176,7 @@ static const WineGLExtension WGL_WINE_pixel_format_passthrough = { "WGL_WINE_pixel_format_passthrough", { - { "wglSetPixelFormatWINE", (void *)1 /* not called directly */ }, + { "wglSetPixelFormatWINE", X11DRV_wglSetPixelFormatWINE }, } }; @@ -3586,7 +3595,7 @@ static const struct gdi_dc_funcs glxdrv_funcs = glxdrv_wglGetProcAddress, /* pwglGetProcAddress */ NULL, /* pwglMakeContextCurrentARB */ NULL, /* pwglMakeCurrent */ - glxdrv_wglSetPixelFormatWINE, /* pwglSetPixelFormatWINE */ + NULL, /* pwglSetPixelFormatWINE */ GDI_PRIORITY_GRAPHICS_DRV + 20 /* priority */ };
1
0
0
0
Hans Leidekker : wbemprox: Implement IEnumWbemClassObject::Clone.
by Alexandre Julliard
28 Jun '12
28 Jun '12
Module: wine Branch: master Commit: 02b00ffb27f9a275b338c069d380154918da7f82 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=02b00ffb27f9a275b338c069d…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Jun 28 09:25:39 2012 +0200 wbemprox: Implement IEnumWbemClassObject::Clone. --- dlls/wbemprox/class.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c index e826202..d60f726 100644 --- a/dlls/wbemprox/class.c +++ b/dlls/wbemprox/class.c @@ -148,8 +148,11 @@ static HRESULT WINAPI enum_class_object_Clone( IEnumWbemClassObject *iface, IEnumWbemClassObject **ppEnum ) { - FIXME("%p, %p\n", iface, ppEnum); - return E_NOTIMPL; + struct enum_class_object *ec = impl_from_IEnumWbemClassObject( iface ); + + TRACE("%p, %p\n", iface, ppEnum); + + return EnumWbemClassObject_create( NULL, ec->query, (void **)ppEnum ); } static HRESULT WINAPI enum_class_object_Skip(
1
0
0
0
Hans Leidekker : wbemprox: Add reference counting to the query object.
by Alexandre Julliard
28 Jun '12
28 Jun '12
Module: wine Branch: master Commit: 992d1e15597389b0d378d86a03ae160050458cb7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=992d1e15597389b0d378d86a0…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Jun 28 09:25:13 2012 +0200 wbemprox: Add reference counting to the query object. --- dlls/wbemprox/class.c | 3 ++- dlls/wbemprox/query.c | 19 +++++++++++++++---- dlls/wbemprox/wbemprox_private.h | 4 +++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c index f32ee35..e826202 100644 --- a/dlls/wbemprox/class.c +++ b/dlls/wbemprox/class.c @@ -60,7 +60,7 @@ static ULONG WINAPI enum_class_object_Release( if (!refs) { TRACE("destroying %p\n", ec); - free_query( ec->query ); + release_query( ec->query ); heap_free( ec ); } return refs; @@ -198,6 +198,7 @@ HRESULT EnumWbemClassObject_create( ec->IEnumWbemClassObject_iface.lpVtbl = &enum_class_object_vtbl; ec->refs = 1; ec->query = query; + addref_query( query ); ec->index = 0; *ppObj = &ec->IEnumWbemClassObject_iface; diff --git a/dlls/wbemprox/query.c b/dlls/wbemprox/query.c index 0f41d44..7e5872a 100644 --- a/dlls/wbemprox/query.c +++ b/dlls/wbemprox/query.c @@ -395,16 +395,17 @@ static HRESULT execute_view( struct view *view ) return S_OK; } -static struct query *alloc_query(void) +static struct query *create_query(void) { struct query *query; if (!(query = heap_alloc( sizeof(*query) ))) return NULL; list_init( &query->mem ); + query->refs = 1; return query; } -void free_query( struct query *query ) +static void free_query( struct query *query ) { struct list *mem, *next; @@ -416,13 +417,23 @@ void free_query( struct query *query ) heap_free( query ); } +void addref_query( struct query *query ) +{ + InterlockedIncrement( &query->refs ); +} + +void release_query( struct query *query ) +{ + if (!InterlockedDecrement( &query->refs )) free_query( query ); +} + HRESULT exec_query( const WCHAR *str, IEnumWbemClassObject **result ) { HRESULT hr; struct query *query; *result = NULL; - if (!(query = alloc_query())) return E_OUTOFMEMORY; + if (!(query = create_query())) return E_OUTOFMEMORY; hr = parse_query( str, &query->view, &query->mem ); if (hr != S_OK) goto done; hr = execute_view( query->view ); @@ -430,7 +441,7 @@ HRESULT exec_query( const WCHAR *str, IEnumWbemClassObject **result ) hr = EnumWbemClassObject_create( NULL, query, (void **)result ); done: - if (hr != S_OK) free_query( query ); + release_query( query ); return hr; } diff --git a/dlls/wbemprox/wbemprox_private.h b/dlls/wbemprox/wbemprox_private.h index 6865ddd..e2ffce1 100644 --- a/dlls/wbemprox/wbemprox_private.h +++ b/dlls/wbemprox/wbemprox_private.h @@ -106,11 +106,13 @@ struct view struct query { + LONG refs; struct view *view; struct list mem; }; -void free_query( struct query * ) DECLSPEC_HIDDEN; +void addref_query( struct query * ) DECLSPEC_HIDDEN; +void release_query( struct query *query ) DECLSPEC_HIDDEN; HRESULT exec_query( const WCHAR *, IEnumWbemClassObject ** ) DECLSPEC_HIDDEN; HRESULT parse_query( const WCHAR *, struct view **, struct list * ) DECLSPEC_HIDDEN; HRESULT create_view( const struct property *, const WCHAR *, const struct expr *,
1
0
0
0
Hans Leidekker : wbemprox: Support IClientSecurity on the class enumerator object; .
by Alexandre Julliard
28 Jun '12
28 Jun '12
Module: wine Branch: master Commit: 0ceee481fe16ac6f731f4cb13717d5b404bb3147 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0ceee481fe16ac6f731f4cb13…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Jun 28 09:24:42 2012 +0200 wbemprox: Support IClientSecurity on the class enumerator object;. --- dlls/wbemprox/class.c | 5 +++++ dlls/wbemprox/services.c | 2 +- dlls/wbemprox/wbemprox_private.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletions(-) diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c index bb2c5e6..f32ee35 100644 --- a/dlls/wbemprox/class.c +++ b/dlls/wbemprox/class.c @@ -80,6 +80,11 @@ static HRESULT WINAPI enum_class_object_QueryInterface( { *ppvObject = ec; } + else if ( IsEqualGUID( riid, &IID_IClientSecurity ) ) + { + *ppvObject = &client_security; + return S_OK; + } else { FIXME("interface %s not implemented\n", debugstr_guid(riid)); diff --git a/dlls/wbemprox/services.c b/dlls/wbemprox/services.c index 05a9811..2e8a34a 100644 --- a/dlls/wbemprox/services.c +++ b/dlls/wbemprox/services.c @@ -130,7 +130,7 @@ static const IClientSecurityVtbl client_security_vtbl = client_security_CopyProxy }; -static IClientSecurity client_security = { &client_security_vtbl }; +IClientSecurity client_security = { &client_security_vtbl }; struct wbem_services { diff --git a/dlls/wbemprox/wbemprox_private.h b/dlls/wbemprox/wbemprox_private.h index db3cb3a..6865ddd 100644 --- a/dlls/wbemprox/wbemprox_private.h +++ b/dlls/wbemprox/wbemprox_private.h @@ -19,6 +19,8 @@ #include "wine/list.h" #include "wine/unicode.h" +IClientSecurity client_security; + #define SIZEOF(array) (sizeof(array)/sizeof((array)[0])) #define COL_TYPE_MASK 0x0000ffff
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
83
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Results per page:
10
25
50
100
200