diff --git a/src/wgl_context.c b/src/wgl_context.c index a802d9a9..2284f3d1 100644 --- a/src/wgl_context.c +++ b/src/wgl_context.c @@ -293,6 +293,12 @@ int _glfwCreateContext(_GLFWwindow* window, pfd.cAuxBuffers = fbconfig->auxBuffers; pixelFormat = ChoosePixelFormat(window->wgl.dc, &pfd); + if (!pixelFormat) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "WGL: Failed to find a suitable pixel format"); + return GL_FALSE; + } } if (!DescribePixelFormat(window->wgl.dc, pixelFormat, sizeof(pfd), &pfd))