|
@@ -171,15 +171,14 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
|
|
|
|
|
|
if (!available)
|
|
if (!available)
|
|
{
|
|
{
|
|
- _glfwSetError(GLFW_OPENGL_UNAVAILABLE, "Win32/WGL: No pixel formats found");
|
|
|
|
|
|
+ _glfwSetError(GLFW_OPENGL_UNAVAILABLE, "WGL: No pixel formats found");
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
|
|
fbconfigs = (_GLFWfbconfig*) malloc(sizeof(_GLFWfbconfig) * available);
|
|
fbconfigs = (_GLFWfbconfig*) malloc(sizeof(_GLFWfbconfig) * available);
|
|
if (!fbconfigs)
|
|
if (!fbconfigs)
|
|
{
|
|
{
|
|
- _glfwSetError(GLFW_OUT_OF_MEMORY,
|
|
|
|
- "Win32/WGL: Failed to allocate _GLFWfbconfig array");
|
|
|
|
|
|
+ _glfwSetError(GLFW_OUT_OF_MEMORY, NULL);
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -285,6 +284,9 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
|
|
|
|
|
|
if (*found == 0)
|
|
if (*found == 0)
|
|
{
|
|
{
|
|
|
|
+ _glfwSetError(GLFW_PLATFORM_ERROR,
|
|
|
|
+ "Win32/WGL: No usable pixel formats found");
|
|
|
|
+
|
|
free(fbconfigs);
|
|
free(fbconfigs);
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
@@ -310,15 +312,15 @@ static GLboolean createContext(_GLFWwindow* window,
|
|
|
|
|
|
if (!DescribePixelFormat(window->WGL.DC, pixelFormat, sizeof(pfd), &pfd))
|
|
if (!DescribePixelFormat(window->WGL.DC, pixelFormat, sizeof(pfd), &pfd))
|
|
{
|
|
{
|
|
- _glfwSetError(GLFW_OPENGL_UNAVAILABLE,
|
|
|
|
- "Win32/WGL: Failed to retrieve PFD for selected pixel format");
|
|
|
|
|
|
+ _glfwSetError(GLFW_PLATFORM_ERROR,
|
|
|
|
+ "Win32: Failed to retrieve PFD for selected pixel format");
|
|
return GL_FALSE;
|
|
return GL_FALSE;
|
|
}
|
|
}
|
|
|
|
|
|
if (!SetPixelFormat(window->WGL.DC, pixelFormat, &pfd))
|
|
if (!SetPixelFormat(window->WGL.DC, pixelFormat, &pfd))
|
|
{
|
|
{
|
|
- _glfwSetError(GLFW_OPENGL_UNAVAILABLE,
|
|
|
|
- "Win32/WGL: Failed to set selected pixel format");
|
|
|
|
|
|
+ _glfwSetError(GLFW_PLATFORM_ERROR,
|
|
|
|
+ "Win32: Failed to set selected pixel format");
|
|
return GL_FALSE;
|
|
return GL_FALSE;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -360,7 +362,7 @@ static GLboolean createContext(_GLFWwindow* window,
|
|
if (!window->WGL.ARB_create_context_profile)
|
|
if (!window->WGL.ARB_create_context_profile)
|
|
{
|
|
{
|
|
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
|
|
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
|
|
- "Win32/WGL: OpenGL profile requested but "
|
|
|
|
|
|
+ "WGL: OpenGL profile requested but "
|
|
"WGL_ARB_create_context_profile is unavailable");
|
|
"WGL_ARB_create_context_profile is unavailable");
|
|
return GL_FALSE;
|
|
return GL_FALSE;
|
|
}
|
|
}
|
|
@@ -369,7 +371,7 @@ static GLboolean createContext(_GLFWwindow* window,
|
|
!window->WGL.EXT_create_context_es2_profile)
|
|
!window->WGL.EXT_create_context_es2_profile)
|
|
{
|
|
{
|
|
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
|
|
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
|
|
- "Win32/WGL: OpenGL ES 2.x profile requested but "
|
|
|
|
|
|
+ "WGL: OpenGL ES 2.x profile requested but "
|
|
"WGL_EXT_create_context_es2_profile is unavailable");
|
|
"WGL_EXT_create_context_es2_profile is unavailable");
|
|
return GL_FALSE;
|
|
return GL_FALSE;
|
|
}
|
|
}
|
|
@@ -392,7 +394,7 @@ static GLboolean createContext(_GLFWwindow* window,
|
|
if (!window->WGL.ARB_create_context_robustness)
|
|
if (!window->WGL.ARB_create_context_robustness)
|
|
{
|
|
{
|
|
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
|
|
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
|
|
- "Win32/WGL: An OpenGL robustness strategy was "
|
|
|
|
|
|
+ "WGL: An OpenGL robustness strategy was "
|
|
"requested but WGL_ARB_create_context_robustness "
|
|
"requested but WGL_ARB_create_context_robustness "
|
|
"is unavailable");
|
|
"is unavailable");
|
|
return GL_FALSE;
|
|
return GL_FALSE;
|
|
@@ -415,7 +417,7 @@ static GLboolean createContext(_GLFWwindow* window,
|
|
if (!window->WGL.context)
|
|
if (!window->WGL.context)
|
|
{
|
|
{
|
|
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
|
|
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
|
|
- "Win32/WGL: Failed to create OpenGL context");
|
|
|
|
|
|
+ "WGL: Failed to create OpenGL context");
|
|
return GL_FALSE;
|
|
return GL_FALSE;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -425,7 +427,7 @@ static GLboolean createContext(_GLFWwindow* window,
|
|
if (!window->WGL.context)
|
|
if (!window->WGL.context)
|
|
{
|
|
{
|
|
_glfwSetError(GLFW_PLATFORM_ERROR,
|
|
_glfwSetError(GLFW_PLATFORM_ERROR,
|
|
- "Win32/WGL: Failed to create OpenGL context");
|
|
|
|
|
|
+ "WGL: Failed to create OpenGL context");
|
|
return GL_FALSE;
|
|
return GL_FALSE;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -434,8 +436,8 @@ static GLboolean createContext(_GLFWwindow* window,
|
|
if (!wglShareLists(share, window->WGL.context))
|
|
if (!wglShareLists(share, window->WGL.context))
|
|
{
|
|
{
|
|
_glfwSetError(GLFW_PLATFORM_ERROR,
|
|
_glfwSetError(GLFW_PLATFORM_ERROR,
|
|
- "Win32/WGL: Failed to enable sharing with "
|
|
|
|
- "specified OpenGL context");
|
|
|
|
|
|
+ "WGL: Failed to enable sharing with specified "
|
|
|
|
+ "OpenGL context");
|
|
return GL_FALSE;
|
|
return GL_FALSE;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -466,7 +468,7 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|
if (!window->WGL.DC)
|
|
if (!window->WGL.DC)
|
|
{
|
|
{
|
|
_glfwSetError(GLFW_PLATFORM_ERROR,
|
|
_glfwSetError(GLFW_PLATFORM_ERROR,
|
|
- "Win32/WGL: Failed to retrieve DC for window");
|
|
|
|
|
|
+ "Win32: Failed to retrieve DC for window");
|
|
return GL_FALSE;
|
|
return GL_FALSE;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -478,16 +480,12 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|
|
|
|
|
fbconfigs = getFBConfigs(window, &fbcount);
|
|
fbconfigs = getFBConfigs(window, &fbcount);
|
|
if (!fbconfigs)
|
|
if (!fbconfigs)
|
|
- {
|
|
|
|
- _glfwSetError(GLFW_PLATFORM_ERROR,
|
|
|
|
- "Win32/WGL: No usable pixel formats found");
|
|
|
|
return GL_FALSE;
|
|
return GL_FALSE;
|
|
- }
|
|
|
|
|
|
|
|
result = _glfwChooseFBConfig(fbconfig, fbconfigs, fbcount);
|
|
result = _glfwChooseFBConfig(fbconfig, fbconfigs, fbcount);
|
|
if (!result)
|
|
if (!result)
|
|
{
|
|
{
|
|
- _glfwSetError(GLFW_PLATFORM_ERROR,
|
|
|
|
|
|
+ _glfwSetError(GLFW_FORMAT_UNAVAILABLE,
|
|
"Win32/WGL: No pixel format matched the criteria");
|
|
"Win32/WGL: No pixel format matched the criteria");
|
|
|
|
|
|
free(fbconfigs);
|
|
free(fbconfigs);
|
|
@@ -620,7 +618,7 @@ void _glfwPlatformCopyContext(_GLFWwindow* src, _GLFWwindow* dst, unsigned long
|
|
if (!wglCopyContext(src->WGL.context, dst->WGL.context, mask))
|
|
if (!wglCopyContext(src->WGL.context, dst->WGL.context, mask))
|
|
{
|
|
{
|
|
_glfwSetError(GLFW_PLATFORM_ERROR,
|
|
_glfwSetError(GLFW_PLATFORM_ERROR,
|
|
- "Win32/WGL: Failed to copy OpenGL context attributes");
|
|
|
|
|
|
+ "WGL: Failed to copy OpenGL context attributes");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|