wined3d: Don't crash when opengl is not available.
Kusanagi Kouichi
slash at ac.auone-net.jp
Tue Mar 2 10:51:10 CST 2010
Signed-off-by: Kusanagi Kouichi <slash at ac.auone-net.jp>
---
dlls/wined3d/directx.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 457cb85..cb64319 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -4677,7 +4677,7 @@ BOOL InitAdapters(IWineD3DImpl *This)
goto nogl_adapter;
}
#else
-#define USE_GL_FUNC(pfn) pfn = (void*)pwglGetProcAddress(#pfn);
+#define USE_GL_FUNC(pfn) pfn = (void*)pwglGetProcAddress(#pfn); if (!pfn) goto nogl_adapter;
/* To bypass the opengl32 thunks load wglGetProcAddress from gdi32 (glXGetProcAddress wrapper) instead of opengl32's */
mod_gl = GetModuleHandleA("gdi32.dll");
#endif
@@ -4950,6 +4950,9 @@ nogl_adapter:
initPixelFormatsNoGL(&This->adapters[0].gl_info);
+ This->adapters[0].shader_backend = &none_shader_backend;
+ This->adapters[0].fragment_pipe = &ffp_fragment_pipeline;
+
This->adapter_count = 1;
return FALSE;
}
--
1.7.0
More information about the wine-patches
mailing list