mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Various error fixes.
Fixed incorrect error types. Added missing error string prefixes. Removed some invalid or superfluous error emissions. Clarified some error strings. Joined error string lines to aid grep. Replaced some generic error strings with specific ones. Documentation work. Fixes #450.
This commit is contained in:
+8
-21
@@ -679,7 +679,7 @@ static int createWindow(_GLFWwindow* window,
|
||||
if (!wideTitle)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Win32: Failed to convert title to wide string");
|
||||
"Win32: Failed to convert window title to UTF-16");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
@@ -862,7 +862,7 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
|
||||
if (!wideTitle)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Win32: Failed to convert title to wide string");
|
||||
"Win32: Failed to convert window title to UTF-16");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1168,18 +1168,12 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
|
||||
|
||||
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
|
||||
{
|
||||
LPCWSTR native = translateCursorShape(shape);
|
||||
if (!native)
|
||||
{
|
||||
_glfwInputError(GLFW_INVALID_ENUM, "Win32: Invalid standard cursor");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
cursor->win32.handle = CopyCursor(LoadCursorW(NULL, native));
|
||||
cursor->win32.handle =
|
||||
CopyCursor(LoadCursorW(NULL, translateCursorShape(shape)));
|
||||
if (!cursor->win32.handle)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Win32: Failed to retrieve shared cursor");
|
||||
"Win32: Failed to create standard cursor");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
@@ -1219,8 +1213,7 @@ void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string)
|
||||
if (!wideString)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Win32: Failed to convert clipboard string to "
|
||||
"wide string");
|
||||
"Win32: Failed to convert string to UTF-16");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1259,12 +1252,6 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
|
||||
{
|
||||
HANDLE stringHandle;
|
||||
|
||||
if (!IsClipboardFormatAvailable(CF_UNICODETEXT))
|
||||
{
|
||||
_glfwInputError(GLFW_FORMAT_UNAVAILABLE, NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!OpenClipboard(window->win32.handle))
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to open clipboard");
|
||||
@@ -1276,8 +1263,8 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
|
||||
{
|
||||
CloseClipboard();
|
||||
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Win32: Failed to retrieve clipboard data");
|
||||
_glfwInputError(GLFW_FORMAT_UNAVAILABLE,
|
||||
"Win32: Failed to convert clipboard to string");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user