From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/opengl.c | 6 +++--- dlls/wineandroid.drv/opengl.c | 4 ++-- dlls/winemac.drv/opengl.c | 4 ++-- dlls/winewayland.drv/opengl.c | 4 ++-- dlls/winex11.drv/opengl.c | 14 +++++--------- include/wine/opengl_driver.h | 2 +- 6 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/dlls/win32u/opengl.c b/dlls/win32u/opengl.c index b997ea4a8a8..50a81a22a52 100644 --- a/dlls/win32u/opengl.c +++ b/dlls/win32u/opengl.c @@ -401,7 +401,7 @@ static UINT egldrv_pbuffer_bind( HDC hdc, void *private, GLenum buffer ) return -1; /* use default implementation */ }
-static BOOL egldrv_context_create( HDC hdc, int format, void *share, const int *attribs, void **private ) +static BOOL egldrv_context_create( int format, void *share, const int *attribs, void **private ) { FIXME( "stub!\n" ); return TRUE; @@ -611,7 +611,7 @@ static UINT nulldrv_pbuffer_bind( HDC hdc, void *private, GLenum buffer ) return -1; /* use default implementation */ }
-static BOOL nulldrv_context_create( HDC hdc, int format, void *share, const int *attribs, void **private ) +static BOOL nulldrv_context_create( int format, void *share, const int *attribs, void **private ) { return FALSE; } @@ -848,7 +848,7 @@ static struct wgl_context *context_create( HDC hdc, struct wgl_context *shared, if (!(context = calloc( 1, sizeof(*context) ))) return NULL; context->pixel_format = format;
- if (!driver_funcs->p_context_create( hdc, format, shared_private, attribs, &context->driver_private )) + if (!driver_funcs->p_context_create( format, shared_private, attribs, &context->driver_private )) { free( context ); return NULL; diff --git a/dlls/wineandroid.drv/opengl.c b/dlls/wineandroid.drv/opengl.c index 60cdd419f62..9075e7d4ac2 100644 --- a/dlls/wineandroid.drv/opengl.c +++ b/dlls/wineandroid.drv/opengl.c @@ -205,7 +205,7 @@ static BOOL android_set_pixel_format( HWND hwnd, int old_format, int new_format, return TRUE; }
-static BOOL android_context_create( HDC hdc, int format, void *share, const int *attribs, void **private ) +static BOOL android_context_create( int format, void *share, const int *attribs, void **private ) { struct android_context *ctx, *shared_ctx = share; int count = 0, egl_attribs[3]; @@ -248,7 +248,7 @@ static BOOL android_context_create( HDC hdc, int format, void *share, const int ctx->surface = 0; ctx->refresh = FALSE; ctx->context = funcs->p_eglCreateContext( egl->display, ctx->config, shared_ctx ? shared_ctx->context : EGL_NO_CONTEXT, attribs ); - TRACE( "%p fmt %d ctx %p\n", hdc, format, ctx->context ); + TRACE( "fmt %d ctx %p\n", format, ctx->context ); list_add_head( &gl_contexts, &ctx->entry );
*private = ctx; diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c index c55ecc0976a..89e6adff3e4 100644 --- a/dlls/winemac.drv/opengl.c +++ b/dlls/winemac.drv/opengl.c @@ -2190,7 +2190,7 @@ static UINT macdrv_pbuffer_bind(HDC hdc, void *private, GLenum source) * * WGL_ARB_create_context: wglCreateContextAttribsARB */ -static BOOL macdrv_context_create(HDC hdc, int format, void *shared, const int *attrib_list, void **private) +static BOOL macdrv_context_create(int format, void *shared, const int *attrib_list, void **private) { struct macdrv_context *share_context = shared; struct macdrv_context *context; @@ -2199,7 +2199,7 @@ static BOOL macdrv_context_create(HDC hdc, int format, void *shared, const int * BOOL core = FALSE; GLint renderer_id = 0;
- TRACE("hdc %p, format %d, share_context %p, attrib_list %p\n", hdc, format, share_context, attrib_list); + TRACE("format %d, share_context %p, attrib_list %p\n", format, share_context, attrib_list);
for (iptr = attrib_list; iptr && *iptr; iptr += 2) { diff --git a/dlls/winewayland.drv/opengl.c b/dlls/winewayland.drv/opengl.c index 5b995f6b6ab..ce93fd1f432 100644 --- a/dlls/winewayland.drv/opengl.c +++ b/dlls/winewayland.drv/opengl.c @@ -356,12 +356,12 @@ static BOOL wayland_set_pixel_format(HWND hwnd, int old_format, int new_format, return TRUE; }
-static BOOL wayland_context_create(HDC hdc, int format, void *share_private, const int *attribs, void **private) +static BOOL wayland_context_create(int format, void *share_private, const int *attribs, void **private) { struct wayland_context *share = share_private, *ctx; EGLint egl_attribs[16], *attribs_end = egl_attribs;
- TRACE("hdc=%p format=%d share=%p attribs=%p\n", hdc, format, share, attribs); + TRACE("format=%d share=%p attribs=%p\n", format, share, attribs);
for (; attribs && attribs[0] != 0; attribs += 2) { diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 3c0e7f08442..5f7cc9a9276 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -196,7 +196,6 @@ struct glx_pixel_format
struct x11drv_context { - HDC hdc; GLXContext ctx; struct gl_drawable *draw; struct gl_drawable *read; @@ -1342,7 +1341,6 @@ static BOOL x11drv_context_make_current( HDC draw_hdc, HDC read_hdc, void *priva else ret = pglXMakeContextCurrent( gdi_display, draw_gl->drawable, read_gl ? read_gl->drawable : 0, ctx->ctx ); if (ret) { - ctx->hdc = draw_hdc; set_context_drawables( ctx, draw_gl, read_gl ); NtCurrentTeb()->glReserved2 = ctx; pthread_mutex_unlock( &context_mutex ); @@ -1397,7 +1395,6 @@ static void present_gl_drawable( HWND hwnd, HDC hdc, struct gl_drawable *gl, BOO static BOOL x11drv_context_flush( void *private, HWND hwnd, HDC hdc, int interval, void (*flush)(void) ) { struct gl_drawable *gl; - struct x11drv_context *ctx = private;
if (!(gl = get_gl_drawable( hwnd, 0 ))) return FALSE; if (gl->type != DC_GL_WINDOW) @@ -1417,7 +1414,7 @@ static BOOL x11drv_context_flush( void *private, HWND hwnd, HDC hdc, int interva update_gl_drawable_offscreen( gl ); pthread_mutex_unlock( &context_mutex );
- present_gl_drawable( hwnd, ctx->hdc, gl, TRUE, flush != funcs->p_glFinish ); + present_gl_drawable( hwnd, hdc, gl, TRUE, flush != funcs->p_glFinish ); release_gl_drawable( gl ); return TRUE; } @@ -1425,17 +1422,16 @@ static BOOL x11drv_context_flush( void *private, HWND hwnd, HDC hdc, int interva /*********************************************************************** * X11DRV_wglCreateContextAttribsARB */ -static BOOL x11drv_context_create( HDC hdc, int format, void *share_private, const int *attribList, void **private ) +static BOOL x11drv_context_create( int format, void *share_private, const int *attribList, void **private ) { struct x11drv_context *ret, *hShareContext = share_private; int glx_attribs[16] = {0}, *pContextAttribList = glx_attribs; int err = 0;
- TRACE("(%p %d %p %p)\n", hdc, format, hShareContext, attribList); + TRACE("(%d %p %p)\n", format, hShareContext, attribList);
if ((ret = calloc( 1, sizeof(*ret) ))) { - ret->hdc = hdc; if (attribList) { /* attribList consists of pairs {token, value] terminated with 0 */ @@ -1500,7 +1496,7 @@ static BOOL x11drv_context_create( HDC hdc, int format, void *share_private, con pthread_mutex_unlock( &context_mutex ); }
- TRACE( "%p -> %p\n", hdc, ret ); + TRACE( "-> %p\n", ret ); *private = ret; return TRUE; } @@ -1731,7 +1727,7 @@ static BOOL x11drv_swap_buffers( void *private, HWND hwnd, HDC hdc, int interval update_gl_drawable_offscreen( gl ); pthread_mutex_unlock( &context_mutex );
- present_gl_drawable( hwnd, ctx ? ctx->hdc : hdc, gl, !pglXWaitForSbcOML, FALSE ); + present_gl_drawable( hwnd, hdc, gl, !pglXWaitForSbcOML, FALSE ); release_gl_drawable( gl ); return TRUE; } diff --git a/include/wine/opengl_driver.h b/include/wine/opengl_driver.h index b850f45215e..ff8f3e6e339 100644 --- a/include/wine/opengl_driver.h +++ b/include/wine/opengl_driver.h @@ -133,7 +133,7 @@ struct opengl_driver_funcs const char *(*p_init_wgl_extensions)(struct opengl_funcs *funcs); BOOL (*p_set_pixel_format)(HWND,int,int,BOOL); BOOL (*p_swap_buffers)(void*,HWND,HDC,int); - BOOL (*p_context_create)(HDC,int,void*,const int*,void**); + BOOL (*p_context_create)( int format, void *share, const int *attribs, void **context ); BOOL (*p_context_destroy)(void*); BOOL (*p_context_flush)(void*,HWND,HDC,int,void(*)(void)); BOOL (*p_context_make_current)(HDC,HDC,void*);