Commit 147174ff authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Implement wglGetPbufferDCARB with a DC escape and remove it from the GDI driver interface.

parent 5f99b59e
......@@ -523,15 +523,6 @@ static BOOL dibdrv_wglDeleteContext( HGLRC ctx )
}
/***********************************************************************
* dibdrv_wglGetPbufferDCARB
*/
static HDC dibdrv_wglGetPbufferDCARB( PHYSDEV dev, void *buffer )
{
FIXME( "Not supported on DIB section\n" );
return 0;
}
/***********************************************************************
* dibdrv_wglGetProcAddress
*/
static PROC dibdrv_wglGetProcAddress( LPCSTR name )
......@@ -734,7 +725,6 @@ const struct gdi_dc_funcs dib_driver =
dibdrv_wglCreateContext, /* pwglCreateContext */
dibdrv_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
dibdrv_wglDeleteContext, /* pwglDeleteContext */
dibdrv_wglGetPbufferDCARB, /* pwglGetPbufferDCARB */
dibdrv_wglGetProcAddress, /* pwglGetProcAddress */
dibdrv_wglMakeContextCurrentARB, /* pwglMakeContextCurrentARB */
dibdrv_wglMakeCurrent, /* pwglMakeCurrent */
......
......@@ -692,11 +692,6 @@ static PROC nulldrv_wglGetProcAddress( LPCSTR name )
return NULL;
}
static HDC nulldrv_wglGetPbufferDCARB( PHYSDEV dev, void *pbuffer )
{
return 0;
}
static BOOL nulldrv_wglMakeCurrent( PHYSDEV dev, HGLRC ctx )
{
return FALSE;
......@@ -867,7 +862,6 @@ const struct gdi_dc_funcs null_driver =
nulldrv_wglCreateContext, /* pwglCreateContext */
nulldrv_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
nulldrv_wglDeleteContext, /* pwglDeleteContext */
nulldrv_wglGetPbufferDCARB, /* pwglGetPbufferDCARB */
nulldrv_wglGetProcAddress, /* pwglGetProcAddress */
nulldrv_wglMakeContextCurrentARB, /* pwglMakeContextCurrentARB */
nulldrv_wglMakeCurrent, /* pwglMakeCurrent */
......
......@@ -174,7 +174,6 @@ static const struct gdi_dc_funcs EMFDRV_Funcs =
NULL, /* pwglCreateContext */
NULL, /* pwglCreateContextAttribsARB */
NULL, /* pwglDeleteContext */
NULL, /* pwglGetPbufferDCARB */
NULL, /* pwglGetProcAddress */
NULL, /* pwglMakeContextCurrentARB */
NULL, /* pwglMakeCurrent */
......
......@@ -7878,7 +7878,6 @@ static const struct gdi_dc_funcs freetype_funcs =
NULL, /* pwglCreateContext */
NULL, /* pwglCreateContextAttribsARB */
NULL, /* pwglDeleteContext */
NULL, /* pwglGetPbufferDCARB */
NULL, /* pwglGetProcAddress */
NULL, /* pwglMakeContextCurrentARB */
NULL, /* pwglMakeCurrent */
......
......@@ -237,7 +237,6 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
NULL, /* pwglCreateContext */
NULL, /* pwglCreateContextAttribsARB */
NULL, /* pwglDeleteContext */
NULL, /* pwglGetPbufferDCARB */
NULL, /* pwglGetProcAddress */
NULL, /* pwglMakeContextCurrentARB */
NULL, /* pwglMakeCurrent */
......
......@@ -179,34 +179,6 @@ HDC WINAPI wglGetCurrentDC(void)
}
/***********************************************************************
* wglGetPbufferDCARB
*/
static HDC WINAPI wglGetPbufferDCARB(void *pbuffer)
{
HDC ret = 0;
/* Create a device context to associate with the pbuffer */
HDC hdc = CreateDCA("DISPLAY", NULL, NULL, NULL);
DC *dc = get_dc_ptr(hdc);
TRACE("(%p)\n", pbuffer);
if (dc)
{
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglGetPbufferDCARB );
/* The display driver has to do the rest of the work because
* we need access to lowlevel datatypes which we can't access here
*/
ret = physdev->funcs->pwglGetPbufferDCARB( physdev, pbuffer );
release_dc_ptr( dc );
}
TRACE("(%p), hdc=%p\n", pbuffer, ret);
if (!ret) DeleteDC( hdc );
return ret;
}
/***********************************************************************
* wglMakeCurrent (OPENGL32.@)
*/
BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
......@@ -388,8 +360,6 @@ PROC WINAPI wglGetProcAddress(LPCSTR func)
return (PROC)wglCreateContextAttribsARB;
else if(ret && strcmp(func, "wglMakeContextCurrentARB") == 0)
return (PROC)wglMakeContextCurrentARB;
else if(ret && strcmp(func, "wglGetPbufferDCARB") == 0)
return (PROC)wglGetPbufferDCARB;
else if(ret && strcmp(func, "wglSetPixelFormatWINE") == 0)
return (PROC)wglSetPixelFormatWINE;
......
......@@ -2371,7 +2371,6 @@ const struct gdi_dc_funcs path_driver =
NULL, /* pwglCreateContext */
NULL, /* pwglCreateContextAttribsARB */
NULL, /* pwglDeleteContext */
NULL, /* pwglGetPbufferDCARB */
NULL, /* pwglGetProcAddress */
NULL, /* pwglMakeContextCurrentARB */
NULL, /* pwglMakeCurrent */
......
......@@ -956,7 +956,6 @@ static const struct gdi_dc_funcs psdrv_funcs =
NULL, /* pwglCreateContext */
NULL, /* pwglCreateContextAttribsARB */
NULL, /* pwglDeleteContext */
NULL, /* pwglGetPbufferDCARB */
NULL, /* pwglGetProcAddress */
NULL, /* pwglMakeContextCurrentARB */
NULL, /* pwglMakeCurrent */
......
......@@ -500,15 +500,6 @@ static PROC X11DRV_wglGetProcAddress( LPCSTR proc )
}
/***********************************************************************
* X11DRV_wglGetPbufferDCARB
*/
static HDC X11DRV_wglGetPbufferDCARB( PHYSDEV dev, void *hPbuffer )
{
opengl_error();
return NULL;
}
/***********************************************************************
* X11DRV_wglSetPixelFormatWINE
*/
static BOOL X11DRV_wglSetPixelFormatWINE( PHYSDEV dev, int fmt, const PIXELFORMATDESCRIPTOR *ppfd )
......@@ -658,7 +649,6 @@ static const struct gdi_dc_funcs x11drv_funcs =
X11DRV_wglCreateContext, /* pwglCreateContext */
X11DRV_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
NULL, /* pwglDeleteContext */
X11DRV_wglGetPbufferDCARB, /* pwglGetPbufferDCARB */
X11DRV_wglGetProcAddress, /* pwglGetProcAddress */
NULL, /* pwglMakeContextCurrentARB */
NULL, /* pwglMakeCurrent */
......
......@@ -2589,34 +2589,37 @@ static GLboolean WINAPI X11DRV_wglDestroyPbufferARB(HPBUFFERARB hPbuffer)
}
/**
* glxdrv_wglGetPbufferDCARB
* X11DRV_wglGetPbufferDCARB
*
* WGL_ARB_pbuffer: wglGetPbufferDCARB
* The function wglGetPbufferDCARB returns a device context for a pbuffer.
* Gdi32 implements the part of this function which creates a device context.
* This part associates the physDev with the X drawable of the pbuffer.
*/
static HDC glxdrv_wglGetPbufferDCARB(PHYSDEV dev, HPBUFFERARB hPbuffer)
static HDC WINAPI X11DRV_wglGetPbufferDCARB(HPBUFFERARB hPbuffer)
{
X11DRV_PDEVICE *physDev = get_glxdrv_dev( dev )->x11dev;
struct x11drv_escape_set_drawable escape;
Wine_GLPBuffer* object = hPbuffer;
HDC hdc;
if (NULL == object) {
SetLastError(ERROR_INVALID_HANDLE);
return NULL;
}
/* The function wglGetPbufferDCARB returns a DC to which the pbuffer can be connected.
* All formats in our pixelformat list are compatible with each other and the main drawable. */
physDev->current_pf = object->fmt->iPixelFormat;
physDev->drawable = object->drawable;
physDev->gl_drawable = object->drawable;
physDev->gl_type = DC_GL_PBUFFER;
SetRect( &physDev->drawable_rect, 0, 0, object->width, object->height );
physDev->dc_rect = physDev->drawable_rect;
hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
if (!hdc) return 0;
escape.code = X11DRV_SET_DRAWABLE;
escape.drawable = object->drawable;
escape.mode = IncludeInferiors;
SetRect( &escape.drawable_rect, 0, 0, object->width, object->height );
escape.dc_rect = escape.drawable_rect;
escape.fbconfig_id = object->fmt->fmt_id;
escape.gl_drawable = object->drawable;
escape.pixmap = 0;
escape.gl_type = DC_GL_PBUFFER;
ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL );
TRACE("(%p)->(%p)\n", hPbuffer, dev->hdc);
return dev->hdc;
TRACE( "(%p)->(%p)\n", hPbuffer, hdc );
return hdc;
}
/**
......@@ -3552,7 +3555,7 @@ static const WineGLExtension WGL_ARB_pbuffer =
{
{ "wglCreatePbufferARB", X11DRV_wglCreatePbufferARB },
{ "wglDestroyPbufferARB", X11DRV_wglDestroyPbufferARB },
{ "wglGetPbufferDCARB", (void *)1 /* not called directly */ },
{ "wglGetPbufferDCARB", X11DRV_wglGetPbufferDCARB },
{ "wglQueryPbufferARB", X11DRV_wglQueryPbufferARB },
{ "wglReleasePbufferDCARB", X11DRV_wglReleasePbufferDCARB },
{ "wglSetPbufferAttribARB", X11DRV_wglSetPbufferAttribARB },
......@@ -3992,7 +3995,6 @@ static const struct gdi_dc_funcs glxdrv_funcs =
glxdrv_wglCreateContext, /* pwglCreateContext */
glxdrv_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
glxdrv_wglDeleteContext, /* pwglDeleteContext */
glxdrv_wglGetPbufferDCARB, /* pwglGetPbufferDCARB */
glxdrv_wglGetProcAddress, /* pwglGetProcAddress */
glxdrv_wglMakeContextCurrentARB, /* pwglMakeContextCurrentARB */
glxdrv_wglMakeCurrent, /* pwglMakeCurrent */
......
......@@ -2784,7 +2784,6 @@ static const struct gdi_dc_funcs xrender_funcs =
NULL, /* pwglCreateContext */
NULL, /* pwglCreateContextAttribsARB */
NULL, /* pwglDeleteContext */
NULL, /* pwglGetPbufferDCARB */
NULL, /* pwglGetProcAddress */
NULL, /* pwglMakeContextCurrentARB */
NULL, /* pwglMakeCurrent */
......
......@@ -200,7 +200,6 @@ struct gdi_dc_funcs
HGLRC (*pwglCreateContext)(PHYSDEV);
HGLRC (*pwglCreateContextAttribsARB)(PHYSDEV,HGLRC,const int*);
BOOL (*pwglDeleteContext)(HGLRC);
HDC (*pwglGetPbufferDCARB)(PHYSDEV,void*);
PROC (*pwglGetProcAddress)(LPCSTR);
BOOL (*pwglMakeContextCurrentARB)(PHYSDEV,PHYSDEV,HGLRC);
BOOL (*pwglMakeCurrent)(PHYSDEV,HGLRC);
......@@ -214,7 +213,7 @@ struct gdi_dc_funcs
};
/* increment this when you change the DC function table */
#define WINE_GDI_DRIVER_VERSION 27
#define WINE_GDI_DRIVER_VERSION 28
#define GDI_PRIORITY_NULL_DRV 0 /* null driver */
#define GDI_PRIORITY_FONT_DRV 100 /* any font driver */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment