From ed98e06651a932f45438e9c790f18a12caeb8524 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 4 Dec 2013 05:35:36 +0100 Subject: [PATCH] Clarified WGL missing OpenGL error. --- src/wgl_context.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/wgl_context.c b/src/wgl_context.c index ccd7f574..6e7d5030 100644 --- a/src/wgl_context.c +++ b/src/wgl_context.c @@ -272,9 +272,21 @@ static GLboolean choosePixelFormat(_GLFWwindow* window, usableCount++; } + if (!usableCount) + { + _glfwInputError(GLFW_API_UNAVAILABLE, + "WGL: The driver does not appear to support OpenGL"); + + free(usableConfigs); + return GL_FALSE; + } + closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount); if (!closest) { + _glfwInputError(GLFW_PLATFORM_ERROR, + "WGL: Failed to find a suitable pixel format"); + free(usableConfigs); return GL_FALSE; } @@ -355,11 +367,7 @@ int _glfwCreateContext(_GLFWwindow* window, } if (!choosePixelFormat(window, fbconfig, &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)) {