gdi32: Add null driver entry points for the OpenGL functions.
This commit is contained in:
parent
3a850fc842
commit
6d9ebd05a5
|
@ -427,6 +427,67 @@ static INT CDECL nulldrv_StartPage( PHYSDEV dev )
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL CDECL nulldrv_wglCopyContext( HGLRC ctx_src, HGLRC ctx_dst, UINT mask )
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HGLRC CDECL nulldrv_wglCreateContext( PHYSDEV dev )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HGLRC CDECL nulldrv_wglCreateContextAttribsARB( PHYSDEV dev, HGLRC share_ctx, const int *attribs )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL CDECL nulldrv_wglDeleteContext( HGLRC ctx )
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PROC CDECL nulldrv_wglGetProcAddress( LPCSTR name )
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HDC CDECL nulldrv_wglGetPbufferDCARB( PHYSDEV dev, void *pbuffer )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL CDECL nulldrv_wglMakeCurrent( PHYSDEV dev, HGLRC ctx )
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL CDECL nulldrv_wglMakeContextCurrentARB( PHYSDEV dev_draw, PHYSDEV dev_read, HGLRC ctx )
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL CDECL nulldrv_wglSetPixelFormatWINE( PHYSDEV dev, INT format,
|
||||||
|
const PIXELFORMATDESCRIPTOR *descr )
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL CDECL nulldrv_wglShareLists( HGLRC ctx1, HGLRC ctx2 )
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL CDECL nulldrv_wglUseFontBitmapsA( PHYSDEV dev, DWORD start, DWORD count, DWORD base )
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL CDECL nulldrv_wglUseFontBitmapsW( PHYSDEV dev, DWORD start, DWORD count, DWORD base )
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
const DC_FUNCTIONS null_driver =
|
const DC_FUNCTIONS null_driver =
|
||||||
{
|
{
|
||||||
nulldrv_AbortDoc, /* pAbortDoc */
|
nulldrv_AbortDoc, /* pAbortDoc */
|
||||||
|
@ -548,18 +609,18 @@ const DC_FUNCTIONS null_driver =
|
||||||
NULL, /* pSwapBuffers */
|
NULL, /* pSwapBuffers */
|
||||||
NULL, /* pUnrealizePalette */
|
NULL, /* pUnrealizePalette */
|
||||||
NULL, /* pWidenPath */
|
NULL, /* pWidenPath */
|
||||||
NULL, /* pwglCopyContext */
|
nulldrv_wglCopyContext, /* pwglCopyContext */
|
||||||
NULL, /* pwglCreateContext */
|
nulldrv_wglCreateContext, /* pwglCreateContext */
|
||||||
NULL, /* pwglCreateContextAttribsARB */
|
nulldrv_wglCreateContextAttribsARB, /* pwglCreateContextAttribsARB */
|
||||||
NULL, /* pwglDeleteContext */
|
nulldrv_wglDeleteContext, /* pwglDeleteContext */
|
||||||
NULL, /* pwglGetProcAddress */
|
nulldrv_wglGetProcAddress, /* pwglGetProcAddress */
|
||||||
NULL, /* pwglGetPbufferDCARB */
|
nulldrv_wglGetPbufferDCARB, /* pwglGetPbufferDCARB */
|
||||||
NULL, /* pwglMakeCurrent */
|
nulldrv_wglMakeCurrent, /* pwglMakeCurrent */
|
||||||
NULL, /* pwglMakeContextCurrentARB */
|
nulldrv_wglMakeContextCurrentARB, /* pwglMakeContextCurrentARB */
|
||||||
NULL, /* pwglSetPixelFormatWINE */
|
nulldrv_wglSetPixelFormatWINE, /* pwglSetPixelFormatWINE */
|
||||||
NULL, /* pwglShareLists */
|
nulldrv_wglShareLists, /* pwglShareLists */
|
||||||
NULL, /* pwglUseFontBitmapsA */
|
nulldrv_wglUseFontBitmapsA, /* pwglUseFontBitmapsA */
|
||||||
NULL, /* pwglUseFontBitmapsW */
|
nulldrv_wglUseFontBitmapsW, /* pwglUseFontBitmapsW */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -75,12 +75,12 @@ BOOL WINAPI wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask)
|
||||||
|
|
||||||
/* Retrieve the HDC associated with the context to access the display driver */
|
/* Retrieve the HDC associated with the context to access the display driver */
|
||||||
dc = get_dc_ptr(ctx->hdc);
|
dc = get_dc_ptr(ctx->hdc);
|
||||||
if (!dc) return FALSE;
|
if (dc)
|
||||||
|
{
|
||||||
if (!dc->funcs->pwglCopyContext) FIXME(" :stub\n");
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglCopyContext );
|
||||||
else ret = dc->funcs->pwglCopyContext(hglrcSrc, hglrcDst, mask);
|
ret = physdev->funcs->pwglCopyContext(hglrcSrc, hglrcDst, mask);
|
||||||
|
|
||||||
release_dc_ptr( dc );
|
release_dc_ptr( dc );
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,13 +94,13 @@ HGLRC WINAPI wglCreateContext(HDC hdc)
|
||||||
|
|
||||||
TRACE("(%p)\n",hdc);
|
TRACE("(%p)\n",hdc);
|
||||||
|
|
||||||
if (!dc) return 0;
|
if (dc)
|
||||||
|
{
|
||||||
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglCreateContext );
|
||||||
update_dc( dc );
|
update_dc( dc );
|
||||||
if (!dc->funcs->pwglCreateContext) FIXME(" :stub\n");
|
ret = physdev->funcs->pwglCreateContext( physdev );
|
||||||
else ret = dc->funcs->pwglCreateContext(dc->physDev);
|
|
||||||
|
|
||||||
release_dc_ptr( dc );
|
release_dc_ptr( dc );
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,13 +114,13 @@ static HGLRC WINAPI wglCreateContextAttribsARB(HDC hdc, HGLRC hShareContext, con
|
||||||
|
|
||||||
TRACE("(%p)\n",hdc);
|
TRACE("(%p)\n",hdc);
|
||||||
|
|
||||||
if (!dc) return 0;
|
if (dc)
|
||||||
|
{
|
||||||
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglCreateContextAttribsARB );
|
||||||
update_dc( dc );
|
update_dc( dc );
|
||||||
if (!dc->funcs->pwglCreateContextAttribsARB) FIXME(" :stub\n");
|
ret = physdev->funcs->pwglCreateContextAttribsARB( physdev, hShareContext, attributeList );
|
||||||
else ret = dc->funcs->pwglCreateContextAttribsARB(dc->physDev, hShareContext, attributeList);
|
|
||||||
|
|
||||||
release_dc_ptr( dc );
|
release_dc_ptr( dc );
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,16 +142,13 @@ BOOL WINAPI wglDeleteContext(HGLRC hglrc)
|
||||||
|
|
||||||
/* Retrieve the HDC associated with the context to access the display driver */
|
/* Retrieve the HDC associated with the context to access the display driver */
|
||||||
dc = get_dc_ptr(ctx->hdc);
|
dc = get_dc_ptr(ctx->hdc);
|
||||||
if (!dc)
|
if (dc)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_INVALID_HANDLE);
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglDeleteContext );
|
||||||
return FALSE;
|
ret = physdev->funcs->pwglDeleteContext( hglrc );
|
||||||
}
|
|
||||||
|
|
||||||
if (!dc->funcs->pwglDeleteContext) FIXME(" :stub\n");
|
|
||||||
else ret = dc->funcs->pwglDeleteContext(hglrc);
|
|
||||||
|
|
||||||
release_dc_ptr( dc );
|
release_dc_ptr( dc );
|
||||||
|
}
|
||||||
|
else SetLastError(ERROR_INVALID_HANDLE);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,17 +191,18 @@ static HDC WINAPI wglGetPbufferDCARB(void *pbuffer)
|
||||||
|
|
||||||
TRACE("(%p)\n", pbuffer);
|
TRACE("(%p)\n", pbuffer);
|
||||||
|
|
||||||
if (!dc) return 0;
|
if (dc)
|
||||||
|
{
|
||||||
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglGetPbufferDCARB );
|
||||||
|
|
||||||
/* The display driver has to do the rest of the work because
|
/* The display driver has to do the rest of the work because
|
||||||
* we need access to lowlevel datatypes which we can't access here
|
* we need access to lowlevel datatypes which we can't access here
|
||||||
*/
|
*/
|
||||||
if (!dc->funcs->pwglGetPbufferDCARB) FIXME(" :stub\n");
|
ret = physdev->funcs->pwglGetPbufferDCARB( physdev, pbuffer );
|
||||||
else ret = dc->funcs->pwglGetPbufferDCARB(dc->physDev, pbuffer);
|
|
||||||
|
|
||||||
TRACE("(%p), hdc=%p\n", pbuffer, ret);
|
|
||||||
|
|
||||||
release_dc_ptr( dc );
|
release_dc_ptr( dc );
|
||||||
|
}
|
||||||
|
TRACE("(%p), hdc=%p\n", pbuffer, ret);
|
||||||
|
if (!ret) DeleteDC( hdc );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,13 +231,13 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
|
||||||
|
|
||||||
TRACE("hdc: (%p), hglrc: (%p)\n", hdc, hglrc);
|
TRACE("hdc: (%p), hglrc: (%p)\n", hdc, hglrc);
|
||||||
|
|
||||||
if (!dc) return FALSE;
|
if (dc)
|
||||||
|
{
|
||||||
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglMakeCurrent );
|
||||||
update_dc( dc );
|
update_dc( dc );
|
||||||
if (!dc->funcs->pwglMakeCurrent) FIXME(" :stub\n");
|
ret = physdev->funcs->pwglMakeCurrent( physdev, hglrc );
|
||||||
else ret = dc->funcs->pwglMakeCurrent(dc->physDev,hglrc);
|
|
||||||
|
|
||||||
release_dc_ptr( dc );
|
release_dc_ptr( dc );
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,6 +247,7 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
|
||||||
static BOOL WINAPI wglMakeContextCurrentARB(HDC hDrawDC, HDC hReadDC, HGLRC hglrc)
|
static BOOL WINAPI wglMakeContextCurrentARB(HDC hDrawDC, HDC hReadDC, HGLRC hglrc)
|
||||||
{
|
{
|
||||||
BOOL ret = FALSE;
|
BOOL ret = FALSE;
|
||||||
|
PHYSDEV draw_physdev, read_physdev;
|
||||||
DC *DrawDC;
|
DC *DrawDC;
|
||||||
DC *ReadDC;
|
DC *ReadDC;
|
||||||
|
|
||||||
|
@ -266,9 +265,10 @@ static BOOL WINAPI wglMakeContextCurrentARB(HDC hDrawDC, HDC hReadDC, HGLRC hglr
|
||||||
|
|
||||||
update_dc( DrawDC );
|
update_dc( DrawDC );
|
||||||
update_dc( ReadDC );
|
update_dc( ReadDC );
|
||||||
if (!DrawDC->funcs->pwglMakeContextCurrentARB) FIXME(" :stub\n");
|
draw_physdev = GET_DC_PHYSDEV( DrawDC, pwglMakeContextCurrentARB );
|
||||||
else ret = DrawDC->funcs->pwglMakeContextCurrentARB(DrawDC->physDev, ReadDC->physDev, hglrc);
|
read_physdev = GET_DC_PHYSDEV( ReadDC, pwglMakeContextCurrentARB );
|
||||||
|
if (draw_physdev->funcs == read_physdev->funcs)
|
||||||
|
ret = draw_physdev->funcs->pwglMakeContextCurrentARB(draw_physdev, read_physdev, hglrc);
|
||||||
release_dc_ptr( DrawDC );
|
release_dc_ptr( DrawDC );
|
||||||
release_dc_ptr( ReadDC );
|
release_dc_ptr( ReadDC );
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -285,13 +285,13 @@ static BOOL WINAPI wglSetPixelFormatWINE(HDC hdc, int iPixelFormat, const PIXELF
|
||||||
|
|
||||||
TRACE("(%p,%d,%p)\n", hdc, iPixelFormat, ppfd);
|
TRACE("(%p,%d,%p)\n", hdc, iPixelFormat, ppfd);
|
||||||
|
|
||||||
if (!dc) return 0;
|
if (dc)
|
||||||
|
{
|
||||||
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglSetPixelFormatWINE );
|
||||||
update_dc( dc );
|
update_dc( dc );
|
||||||
if (!dc->funcs->pwglSetPixelFormatWINE) FIXME(" :stub\n");
|
bRet = physdev->funcs->pwglSetPixelFormatWINE( physdev, iPixelFormat, ppfd );
|
||||||
else bRet = dc->funcs->pwglSetPixelFormatWINE(dc->physDev, iPixelFormat, ppfd);
|
|
||||||
|
|
||||||
release_dc_ptr( dc );
|
release_dc_ptr( dc );
|
||||||
|
}
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,12 +310,12 @@ BOOL WINAPI wglShareLists(HGLRC hglrc1, HGLRC hglrc2)
|
||||||
|
|
||||||
/* Retrieve the HDC associated with the context to access the display driver */
|
/* Retrieve the HDC associated with the context to access the display driver */
|
||||||
dc = get_dc_ptr(ctx->hdc);
|
dc = get_dc_ptr(ctx->hdc);
|
||||||
if (!dc) return FALSE;
|
if (dc)
|
||||||
|
{
|
||||||
if (!dc->funcs->pwglShareLists) FIXME(" :stub\n");
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglShareLists );
|
||||||
else ret = dc->funcs->pwglShareLists(hglrc1, hglrc2);
|
ret = physdev->funcs->pwglShareLists( hglrc1, hglrc2 );
|
||||||
|
|
||||||
release_dc_ptr( dc );
|
release_dc_ptr( dc );
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,12 +329,12 @@ BOOL WINAPI wglUseFontBitmapsA(HDC hdc, DWORD first, DWORD count, DWORD listBase
|
||||||
|
|
||||||
TRACE("(%p, %d, %d, %d)\n", hdc, first, count, listBase);
|
TRACE("(%p, %d, %d, %d)\n", hdc, first, count, listBase);
|
||||||
|
|
||||||
if (!dc) return FALSE;
|
if (dc)
|
||||||
|
{
|
||||||
if (!dc->funcs->pwglUseFontBitmapsA) FIXME(" :stub\n");
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglUseFontBitmapsA );
|
||||||
else ret = dc->funcs->pwglUseFontBitmapsA(dc->physDev, first, count, listBase);
|
ret = physdev->funcs->pwglUseFontBitmapsA( physdev, first, count, listBase );
|
||||||
|
|
||||||
release_dc_ptr( dc );
|
release_dc_ptr( dc );
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -348,12 +348,12 @@ BOOL WINAPI wglUseFontBitmapsW(HDC hdc, DWORD first, DWORD count, DWORD listBase
|
||||||
|
|
||||||
TRACE("(%p, %d, %d, %d)\n", hdc, first, count, listBase);
|
TRACE("(%p, %d, %d, %d)\n", hdc, first, count, listBase);
|
||||||
|
|
||||||
if (!dc) return FALSE;
|
if (dc)
|
||||||
|
{
|
||||||
if (!dc->funcs->pwglUseFontBitmapsW) FIXME(" :stub\n");
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglUseFontBitmapsW );
|
||||||
else ret = dc->funcs->pwglUseFontBitmapsW(dc->physDev, first, count, listBase);
|
ret = physdev->funcs->pwglUseFontBitmapsW( physdev, first, count, listBase );
|
||||||
|
|
||||||
release_dc_ptr( dc );
|
release_dc_ptr( dc );
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,12 +372,12 @@ PROC WINAPI wglGetProcAddress(LPCSTR func)
|
||||||
|
|
||||||
/* Retrieve the global hDC to get access to the driver. */
|
/* Retrieve the global hDC to get access to the driver. */
|
||||||
dc = OPENGL_GetDefaultDC();
|
dc = OPENGL_GetDefaultDC();
|
||||||
if (!dc) return NULL;
|
if (dc)
|
||||||
|
{
|
||||||
if (!dc->funcs->pwglGetProcAddress) FIXME(" :stub\n");
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pwglGetProcAddress );
|
||||||
else ret = dc->funcs->pwglGetProcAddress(func);
|
ret = physdev->funcs->pwglGetProcAddress(func);
|
||||||
|
|
||||||
release_dc_ptr( dc );
|
release_dc_ptr( dc );
|
||||||
|
}
|
||||||
|
|
||||||
/* At the moment we implement one WGL extension which requires a HDC. When we
|
/* 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
|
* are looking up this call and when the Extension is available (that is the case
|
||||||
|
|
Loading…
Reference in New Issue