winex11: Implement wglGetPbufferDCARB with a DC escape and remove it from the GDI driver interface.
This commit is contained in:
parent
5f99b59e77
commit
147174ff1c
|
@ -522,15 +522,6 @@ static BOOL dibdrv_wglDeleteContext( HGLRC ctx )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* dibdrv_wglGetPbufferDCARB
|
|
||||||
*/
|
|
||||||
static HDC dibdrv_wglGetPbufferDCARB( PHYSDEV dev, void *buffer )
|
|
||||||
{
|
|
||||||
FIXME( "Not supported on DIB section\n" );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* dibdrv_wglGetProcAddress
|
* dibdrv_wglGetProcAddress
|
||||||
*/
|
*/
|
||||||
|
@ -734,7 +725,6 @@ const struct gdi_dc_funcs dib_driver =
|
||||||
dibdrv_wglCreateContext, /* pwglCreateContext */
|
dibdrv_wglCreateContext, /* pwglCreateContext */
|
||||||
dibdrv_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
|
dibdrv_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
|
||||||
dibdrv_wglDeleteContext, /* pwglDeleteContext */
|
dibdrv_wglDeleteContext, /* pwglDeleteContext */
|
||||||
dibdrv_wglGetPbufferDCARB, /* pwglGetPbufferDCARB */
|
|
||||||
dibdrv_wglGetProcAddress, /* pwglGetProcAddress */
|
dibdrv_wglGetProcAddress, /* pwglGetProcAddress */
|
||||||
dibdrv_wglMakeContextCurrentARB, /* pwglMakeContextCurrentARB */
|
dibdrv_wglMakeContextCurrentARB, /* pwglMakeContextCurrentARB */
|
||||||
dibdrv_wglMakeCurrent, /* pwglMakeCurrent */
|
dibdrv_wglMakeCurrent, /* pwglMakeCurrent */
|
||||||
|
|
|
@ -692,11 +692,6 @@ static PROC nulldrv_wglGetProcAddress( LPCSTR name )
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HDC nulldrv_wglGetPbufferDCARB( PHYSDEV dev, void *pbuffer )
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL nulldrv_wglMakeCurrent( PHYSDEV dev, HGLRC ctx )
|
static BOOL nulldrv_wglMakeCurrent( PHYSDEV dev, HGLRC ctx )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -867,7 +862,6 @@ const struct gdi_dc_funcs null_driver =
|
||||||
nulldrv_wglCreateContext, /* pwglCreateContext */
|
nulldrv_wglCreateContext, /* pwglCreateContext */
|
||||||
nulldrv_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
|
nulldrv_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
|
||||||
nulldrv_wglDeleteContext, /* pwglDeleteContext */
|
nulldrv_wglDeleteContext, /* pwglDeleteContext */
|
||||||
nulldrv_wglGetPbufferDCARB, /* pwglGetPbufferDCARB */
|
|
||||||
nulldrv_wglGetProcAddress, /* pwglGetProcAddress */
|
nulldrv_wglGetProcAddress, /* pwglGetProcAddress */
|
||||||
nulldrv_wglMakeContextCurrentARB, /* pwglMakeContextCurrentARB */
|
nulldrv_wglMakeContextCurrentARB, /* pwglMakeContextCurrentARB */
|
||||||
nulldrv_wglMakeCurrent, /* pwglMakeCurrent */
|
nulldrv_wglMakeCurrent, /* pwglMakeCurrent */
|
||||||
|
|
|
@ -174,7 +174,6 @@ static const struct gdi_dc_funcs EMFDRV_Funcs =
|
||||||
NULL, /* pwglCreateContext */
|
NULL, /* pwglCreateContext */
|
||||||
NULL, /* pwglCreateContextAttribsARB */
|
NULL, /* pwglCreateContextAttribsARB */
|
||||||
NULL, /* pwglDeleteContext */
|
NULL, /* pwglDeleteContext */
|
||||||
NULL, /* pwglGetPbufferDCARB */
|
|
||||||
NULL, /* pwglGetProcAddress */
|
NULL, /* pwglGetProcAddress */
|
||||||
NULL, /* pwglMakeContextCurrentARB */
|
NULL, /* pwglMakeContextCurrentARB */
|
||||||
NULL, /* pwglMakeCurrent */
|
NULL, /* pwglMakeCurrent */
|
||||||
|
|
|
@ -7878,7 +7878,6 @@ static const struct gdi_dc_funcs freetype_funcs =
|
||||||
NULL, /* pwglCreateContext */
|
NULL, /* pwglCreateContext */
|
||||||
NULL, /* pwglCreateContextAttribsARB */
|
NULL, /* pwglCreateContextAttribsARB */
|
||||||
NULL, /* pwglDeleteContext */
|
NULL, /* pwglDeleteContext */
|
||||||
NULL, /* pwglGetPbufferDCARB */
|
|
||||||
NULL, /* pwglGetProcAddress */
|
NULL, /* pwglGetProcAddress */
|
||||||
NULL, /* pwglMakeContextCurrentARB */
|
NULL, /* pwglMakeContextCurrentARB */
|
||||||
NULL, /* pwglMakeCurrent */
|
NULL, /* pwglMakeCurrent */
|
||||||
|
|
|
@ -237,7 +237,6 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
|
||||||
NULL, /* pwglCreateContext */
|
NULL, /* pwglCreateContext */
|
||||||
NULL, /* pwglCreateContextAttribsARB */
|
NULL, /* pwglCreateContextAttribsARB */
|
||||||
NULL, /* pwglDeleteContext */
|
NULL, /* pwglDeleteContext */
|
||||||
NULL, /* pwglGetPbufferDCARB */
|
|
||||||
NULL, /* pwglGetProcAddress */
|
NULL, /* pwglGetProcAddress */
|
||||||
NULL, /* pwglMakeContextCurrentARB */
|
NULL, /* pwglMakeContextCurrentARB */
|
||||||
NULL, /* pwglMakeCurrent */
|
NULL, /* pwglMakeCurrent */
|
||||||
|
|
|
@ -178,34 +178,6 @@ HDC WINAPI wglGetCurrentDC(void)
|
||||||
return ctx->hdc;
|
return ctx->hdc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* 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.@)
|
* wglMakeCurrent (OPENGL32.@)
|
||||||
*/
|
*/
|
||||||
|
@ -388,8 +360,6 @@ PROC WINAPI wglGetProcAddress(LPCSTR func)
|
||||||
return (PROC)wglCreateContextAttribsARB;
|
return (PROC)wglCreateContextAttribsARB;
|
||||||
else if(ret && strcmp(func, "wglMakeContextCurrentARB") == 0)
|
else if(ret && strcmp(func, "wglMakeContextCurrentARB") == 0)
|
||||||
return (PROC)wglMakeContextCurrentARB;
|
return (PROC)wglMakeContextCurrentARB;
|
||||||
else if(ret && strcmp(func, "wglGetPbufferDCARB") == 0)
|
|
||||||
return (PROC)wglGetPbufferDCARB;
|
|
||||||
else if(ret && strcmp(func, "wglSetPixelFormatWINE") == 0)
|
else if(ret && strcmp(func, "wglSetPixelFormatWINE") == 0)
|
||||||
return (PROC)wglSetPixelFormatWINE;
|
return (PROC)wglSetPixelFormatWINE;
|
||||||
|
|
||||||
|
|
|
@ -2371,7 +2371,6 @@ const struct gdi_dc_funcs path_driver =
|
||||||
NULL, /* pwglCreateContext */
|
NULL, /* pwglCreateContext */
|
||||||
NULL, /* pwglCreateContextAttribsARB */
|
NULL, /* pwglCreateContextAttribsARB */
|
||||||
NULL, /* pwglDeleteContext */
|
NULL, /* pwglDeleteContext */
|
||||||
NULL, /* pwglGetPbufferDCARB */
|
|
||||||
NULL, /* pwglGetProcAddress */
|
NULL, /* pwglGetProcAddress */
|
||||||
NULL, /* pwglMakeContextCurrentARB */
|
NULL, /* pwglMakeContextCurrentARB */
|
||||||
NULL, /* pwglMakeCurrent */
|
NULL, /* pwglMakeCurrent */
|
||||||
|
|
|
@ -956,7 +956,6 @@ static const struct gdi_dc_funcs psdrv_funcs =
|
||||||
NULL, /* pwglCreateContext */
|
NULL, /* pwglCreateContext */
|
||||||
NULL, /* pwglCreateContextAttribsARB */
|
NULL, /* pwglCreateContextAttribsARB */
|
||||||
NULL, /* pwglDeleteContext */
|
NULL, /* pwglDeleteContext */
|
||||||
NULL, /* pwglGetPbufferDCARB */
|
|
||||||
NULL, /* pwglGetProcAddress */
|
NULL, /* pwglGetProcAddress */
|
||||||
NULL, /* pwglMakeContextCurrentARB */
|
NULL, /* pwglMakeContextCurrentARB */
|
||||||
NULL, /* pwglMakeCurrent */
|
NULL, /* pwglMakeCurrent */
|
||||||
|
|
|
@ -499,15 +499,6 @@ static PROC X11DRV_wglGetProcAddress( LPCSTR proc )
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* X11DRV_wglGetPbufferDCARB
|
|
||||||
*/
|
|
||||||
static HDC X11DRV_wglGetPbufferDCARB( PHYSDEV dev, void *hPbuffer )
|
|
||||||
{
|
|
||||||
opengl_error();
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* X11DRV_wglSetPixelFormatWINE
|
* X11DRV_wglSetPixelFormatWINE
|
||||||
*/
|
*/
|
||||||
|
@ -658,7 +649,6 @@ static const struct gdi_dc_funcs x11drv_funcs =
|
||||||
X11DRV_wglCreateContext, /* pwglCreateContext */
|
X11DRV_wglCreateContext, /* pwglCreateContext */
|
||||||
X11DRV_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
|
X11DRV_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
|
||||||
NULL, /* pwglDeleteContext */
|
NULL, /* pwglDeleteContext */
|
||||||
X11DRV_wglGetPbufferDCARB, /* pwglGetPbufferDCARB */
|
|
||||||
X11DRV_wglGetProcAddress, /* pwglGetProcAddress */
|
X11DRV_wglGetProcAddress, /* pwglGetProcAddress */
|
||||||
NULL, /* pwglMakeContextCurrentARB */
|
NULL, /* pwglMakeContextCurrentARB */
|
||||||
NULL, /* pwglMakeCurrent */
|
NULL, /* pwglMakeCurrent */
|
||||||
|
|
|
@ -2589,34 +2589,37 @@ static GLboolean WINAPI X11DRV_wglDestroyPbufferARB(HPBUFFERARB hPbuffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* glxdrv_wglGetPbufferDCARB
|
* X11DRV_wglGetPbufferDCARB
|
||||||
*
|
*
|
||||||
* WGL_ARB_pbuffer: 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;
|
Wine_GLPBuffer* object = hPbuffer;
|
||||||
|
HDC hdc;
|
||||||
|
|
||||||
if (NULL == object) {
|
if (NULL == object) {
|
||||||
SetLastError(ERROR_INVALID_HANDLE);
|
SetLastError(ERROR_INVALID_HANDLE);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The function wglGetPbufferDCARB returns a DC to which the pbuffer can be connected.
|
hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
|
||||||
* All formats in our pixelformat list are compatible with each other and the main drawable. */
|
if (!hdc) return 0;
|
||||||
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;
|
|
||||||
|
|
||||||
TRACE("(%p)->(%p)\n", hPbuffer, dev->hdc);
|
escape.code = X11DRV_SET_DRAWABLE;
|
||||||
return dev->hdc;
|
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, hdc );
|
||||||
|
return hdc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3552,7 +3555,7 @@ static const WineGLExtension WGL_ARB_pbuffer =
|
||||||
{
|
{
|
||||||
{ "wglCreatePbufferARB", X11DRV_wglCreatePbufferARB },
|
{ "wglCreatePbufferARB", X11DRV_wglCreatePbufferARB },
|
||||||
{ "wglDestroyPbufferARB", X11DRV_wglDestroyPbufferARB },
|
{ "wglDestroyPbufferARB", X11DRV_wglDestroyPbufferARB },
|
||||||
{ "wglGetPbufferDCARB", (void *)1 /* not called directly */ },
|
{ "wglGetPbufferDCARB", X11DRV_wglGetPbufferDCARB },
|
||||||
{ "wglQueryPbufferARB", X11DRV_wglQueryPbufferARB },
|
{ "wglQueryPbufferARB", X11DRV_wglQueryPbufferARB },
|
||||||
{ "wglReleasePbufferDCARB", X11DRV_wglReleasePbufferDCARB },
|
{ "wglReleasePbufferDCARB", X11DRV_wglReleasePbufferDCARB },
|
||||||
{ "wglSetPbufferAttribARB", X11DRV_wglSetPbufferAttribARB },
|
{ "wglSetPbufferAttribARB", X11DRV_wglSetPbufferAttribARB },
|
||||||
|
@ -3992,7 +3995,6 @@ static const struct gdi_dc_funcs glxdrv_funcs =
|
||||||
glxdrv_wglCreateContext, /* pwglCreateContext */
|
glxdrv_wglCreateContext, /* pwglCreateContext */
|
||||||
glxdrv_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
|
glxdrv_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
|
||||||
glxdrv_wglDeleteContext, /* pwglDeleteContext */
|
glxdrv_wglDeleteContext, /* pwglDeleteContext */
|
||||||
glxdrv_wglGetPbufferDCARB, /* pwglGetPbufferDCARB */
|
|
||||||
glxdrv_wglGetProcAddress, /* pwglGetProcAddress */
|
glxdrv_wglGetProcAddress, /* pwglGetProcAddress */
|
||||||
glxdrv_wglMakeContextCurrentARB, /* pwglMakeContextCurrentARB */
|
glxdrv_wglMakeContextCurrentARB, /* pwglMakeContextCurrentARB */
|
||||||
glxdrv_wglMakeCurrent, /* pwglMakeCurrent */
|
glxdrv_wglMakeCurrent, /* pwglMakeCurrent */
|
||||||
|
|
|
@ -2784,7 +2784,6 @@ static const struct gdi_dc_funcs xrender_funcs =
|
||||||
NULL, /* pwglCreateContext */
|
NULL, /* pwglCreateContext */
|
||||||
NULL, /* pwglCreateContextAttribsARB */
|
NULL, /* pwglCreateContextAttribsARB */
|
||||||
NULL, /* pwglDeleteContext */
|
NULL, /* pwglDeleteContext */
|
||||||
NULL, /* pwglGetPbufferDCARB */
|
|
||||||
NULL, /* pwglGetProcAddress */
|
NULL, /* pwglGetProcAddress */
|
||||||
NULL, /* pwglMakeContextCurrentARB */
|
NULL, /* pwglMakeContextCurrentARB */
|
||||||
NULL, /* pwglMakeCurrent */
|
NULL, /* pwglMakeCurrent */
|
||||||
|
|
|
@ -200,7 +200,6 @@ struct gdi_dc_funcs
|
||||||
HGLRC (*pwglCreateContext)(PHYSDEV);
|
HGLRC (*pwglCreateContext)(PHYSDEV);
|
||||||
HGLRC (*pwglCreateContextAttribsARB)(PHYSDEV,HGLRC,const int*);
|
HGLRC (*pwglCreateContextAttribsARB)(PHYSDEV,HGLRC,const int*);
|
||||||
BOOL (*pwglDeleteContext)(HGLRC);
|
BOOL (*pwglDeleteContext)(HGLRC);
|
||||||
HDC (*pwglGetPbufferDCARB)(PHYSDEV,void*);
|
|
||||||
PROC (*pwglGetProcAddress)(LPCSTR);
|
PROC (*pwglGetProcAddress)(LPCSTR);
|
||||||
BOOL (*pwglMakeContextCurrentARB)(PHYSDEV,PHYSDEV,HGLRC);
|
BOOL (*pwglMakeContextCurrentARB)(PHYSDEV,PHYSDEV,HGLRC);
|
||||||
BOOL (*pwglMakeCurrent)(PHYSDEV,HGLRC);
|
BOOL (*pwglMakeCurrent)(PHYSDEV,HGLRC);
|
||||||
|
@ -214,7 +213,7 @@ struct gdi_dc_funcs
|
||||||
};
|
};
|
||||||
|
|
||||||
/* increment this when you change the DC function table */
|
/* 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_NULL_DRV 0 /* null driver */
|
||||||
#define GDI_PRIORITY_FONT_DRV 100 /* any font driver */
|
#define GDI_PRIORITY_FONT_DRV 100 /* any font driver */
|
||||||
|
|
Loading…
Reference in New Issue