Commit 8673be0b authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Return a fake pixel format if gl is not loaded.

parent 9e831a87
...@@ -437,11 +437,16 @@ const StaticPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, WineD3D_GL_In ...@@ -437,11 +437,16 @@ const StaticPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, WineD3D_GL_In
idx = getFmtIdx(WINED3DFMT_UNKNOWN); idx = getFmtIdx(WINED3DFMT_UNKNOWN);
} }
if(glDesc) { if(glDesc) {
if(!gl_info) { if(!gl_info->gl_formats) {
ERR("OpenGL pixel format information was requested, but no gl info structure passed\n"); /* If we do not have gl format information, provide a dummy NULL format. This is an easy way to make
return NULL; * all gl caps check return "unsupported" than catching the lack of gl all over the code. ANSI C requires
* static variables to be initialized to 0.
*/
static const GlPixelFormatDesc dummyFmt;
*glDesc = &dummyFmt;
} else {
*glDesc = &gl_info->gl_formats[idx];
} }
*glDesc = &gl_info->gl_formats[idx];
} }
return &formats[idx]; return &formats[idx];
} }
......
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