mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 16:44:11 +00:00
Add feature available/implemented errors
This adds two new error codes: GLFW_FEATURE_UNAVAILABLE for when a GLFW feature cannot be reasonably implemented on that platform, and GLFW_FEATURE_UNIMPLEMENTED for when it can be but has not been yet. This replaces the current situation where the Wayland code emitted GLFW_PLATFORM_ERROR in both cases while the macOS code silently did nothing. If your application exits on any GLFW error, these error codes should at least be easy to filter out from that behavior. Ideally, GLFW_FEATURE_UNAVAILABLE should be rare and GLFW_FEATURE_UNIMPLEMENTED should never be emitted at all. Fixes #1692.
This commit is contained in:
@@ -191,6 +191,10 @@ void _glfwInputError(int code, const char* format, ...)
|
||||
strcpy(description, "The specified window has no context");
|
||||
else if (code == GLFW_CURSOR_UNAVAILABLE)
|
||||
strcpy(description, "The specified cursor shape is unavailable");
|
||||
else if (code == GLFW_FEATURE_UNAVAILABLE)
|
||||
strcpy(description, "The requested feature cannot be implemented for this platform");
|
||||
else if (code == GLFW_FEATURE_UNIMPLEMENTED)
|
||||
strcpy(description, "The requested feature has not yet been implemented for this platform");
|
||||
else
|
||||
strcpy(description, "ERROR: UNKNOWN GLFW ERROR");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user