Commit e059d565 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Add a null WGL driver.

parent 6a9dcd51
......@@ -50,6 +50,7 @@ static struct list drivers = LIST_INIT( drivers );
static struct graphics_driver *display_driver;
const struct gdi_dc_funcs *font_driver = NULL;
static const struct wgl_funcs null_wgl_driver;
static CRITICAL_SECTION driver_section;
static CRITICAL_SECTION_DEBUG critsect_debug =
......@@ -386,6 +387,11 @@ static UINT nulldrv_GetOutlineTextMetrics( PHYSDEV dev, UINT size, LPOUTLINETEXT
return 0;
}
static INT nulldrv_GetPixelFormat( HDC hdc )
{
return 0;
}
static UINT nulldrv_GetSystemPaletteEntries( PHYSDEV dev, UINT start, UINT count, PALETTEENTRY *entries )
{
return 0;
......@@ -660,11 +666,61 @@ static BOOL nulldrv_UnrealizePalette( HPALETTE palette )
return FALSE;
}
static const struct wgl_funcs *nulldrv_wine_get_wgl_driver( PHYSDEV dev, UINT version )
static BOOL nulldrv_wglCopyContext( HGLRC src, HGLRC dst, UINT mask )
{
return FALSE;
}
static HGLRC nulldrv_wglCreateContext( HDC hdc )
{
return 0;
}
static HGLRC nulldrv_wglCreateContextAttribsARB( HDC hdc, HGLRC share_ctx, const int *attribs )
{
return 0;
}
static BOOL nulldrv_wglDeleteContext( HGLRC hglrc )
{
return FALSE;
}
static HDC nulldrv_wglGetCurrentDC(void)
{
return 0;
}
static PROC nulldrv_wglGetProcAddress( LPCSTR name )
{
return NULL;
}
static BOOL nulldrv_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC hglrc )
{
return FALSE;
}
static BOOL nulldrv_wglMakeCurrent( HDC hdc, HGLRC hglrc )
{
return FALSE;
}
static BOOL nulldrv_wglShareLists( HGLRC org, HGLRC dst )
{
return FALSE;
}
static const struct wgl_funcs *nulldrv_wine_get_wgl_driver( PHYSDEV dev, UINT version )
{
if (version != WINE_GDI_DRIVER_VERSION)
{
ERR( "version mismatch, opengl32 wants %u but driver has %u\n", version, WINE_GDI_DRIVER_VERSION );
return NULL;
}
return &null_wgl_driver;
}
const struct gdi_dc_funcs null_driver =
{
nulldrv_AbortDoc, /* pAbortDoc */
......@@ -801,6 +857,19 @@ const struct gdi_dc_funcs null_driver =
GDI_PRIORITY_NULL_DRV /* priority */
};
static const struct wgl_funcs null_wgl_driver =
{
nulldrv_GetPixelFormat, /* p_GetPixelFormat */
nulldrv_wglCopyContext, /* p_wglCopyContext */
nulldrv_wglCreateContext, /* p_wglCreateContext */
nulldrv_wglCreateContextAttribsARB, /* p_wglCreateContextAttribsARB */
nulldrv_wglDeleteContext, /* p_wglDeleteContext */
nulldrv_wglGetCurrentDC, /* p_wglGetCurrentDC */
nulldrv_wglGetProcAddress, /* p_wglGetProcAddress */
nulldrv_wglMakeContextCurrentARB, /* p_wglMakeContextCurrentARB */
nulldrv_wglMakeCurrent, /* p_wglMakeCurrent */
nulldrv_wglShareLists, /* p_wglShareLists */
};
/*****************************************************************************
* DRIVER_GetDriverName
......
......@@ -3444,8 +3444,11 @@ static const struct wgl_funcs * glxdrv_wine_get_wgl_driver( PHYSDEV dev, UINT ve
ERR( "version mismatch, opengl32 wants %u but driver has %u\n", version, WINE_GDI_DRIVER_VERSION );
return NULL;
}
if (!has_opengl()) return NULL;
return &glxdrv_wgl_funcs;
if (has_opengl()) return &glxdrv_wgl_funcs;
dev = GET_NEXT_PHYSDEV( dev, wine_get_wgl_driver );
return dev->funcs->wine_get_wgl_driver( dev, version );
}
static const struct gdi_dc_funcs glxdrv_funcs =
......
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