diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 95abe2051f4..d0285dfa0c0 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -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]; }