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
idx = getFmtIdx(WINED3DFMT_UNKNOWN);
}
if(glDesc) {
if(!gl_info) {
ERR("OpenGL pixel format information was requested, but no gl info structure passed\n");
return NULL;
if(!gl_info->gl_formats) {
/* If we do not have gl format information, provide a dummy NULL format. This is an easy way to make
* 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];
}
......
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