aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Gutekanst <stephen.gutekanst@gmail.com>2015-01-19 02:28:15 -0700
committerDmitri Shuralyov <shurcooL@gmail.com>2015-02-21 18:51:44 -0800
commit7ce5b43ae5ecc8823ba966faf1f23a2376beae83 (patch)
treee881250b63b92f36cb1c47ee87772be002f2ade2
parent119d0174ffee10e07549500a98ca4390946eba92 (diff)
downloadglfw-7ce5b43ae5ecc8823ba966faf1f23a2376beae83.tar.gz
Document all the public ErrorCode constants.
These are from the official GLFW documentation at: http://www.glfw.org/docs/latest/group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1
-rw-r--r--error.go46
1 files changed, 42 insertions, 4 deletions
diff --git a/error.go b/error.go
index a4f05fb..ea18b5b 100644
--- a/error.go
+++ b/error.go
@@ -22,11 +22,49 @@ const (
platformError ErrorCode = C.GLFW_PLATFORM_ERROR // A platform-specific error occurred that does not match any of the more specific categories.
)
-// Error codes.
const (
- APIUnavailable ErrorCode = C.GLFW_API_UNAVAILABLE // GLFW could not find support for the requested client API on the system.
- VersionUnavailable ErrorCode = C.GLFW_VERSION_UNAVAILABLE // The requested client API version is not available.
- FormatUnavailable ErrorCode = C.GLFW_FORMAT_UNAVAILABLE // The clipboard did not contain data in the requested format.
+ // APIUnavailable is the error code used when GLFW could not find support
+ // for the requested client API on the system.
+ //
+ // The installed graphics driver does not support the requested client API,
+ // or does not support it via the chosen context creation backend. Below
+ // are a few examples.
+ //
+ // Some pre-installed Windows graphics drivers do not support OpenGL. AMD
+ // only supports OpenGL ES via EGL, while Nvidia and Intel only supports it
+ // via a WGL or GLX extension. OS X does not provide OpenGL ES at all. The
+ // Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the
+ // Nvidia binary driver.
+ APIUnavailable ErrorCode = C.GLFW_API_UNAVAILABLE
+
+ // VersionUnavailable is the error code used when the requested OpenGL or
+ // OpenGL ES (including any requested profile or context option) is not
+ // available on this machine.
+ //
+ // The machine does not support your requirements. If your application is
+ // sufficiently flexible, downgrade your requirements and try again.
+ // Otherwise, inform the user that their machine does not match your
+ // requirements.
+ //
+ // Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if
+ // 5.0 comes out before the 4.x series gets that far, also fail with this
+ // error and not GLFW_INVALID_VALUE, because GLFW cannot know what future
+ // versions will exist.
+ VersionUnavailable ErrorCode = C.GLFW_VERSION_UNAVAILABLE
+
+ // FormatUnavailable is the error code used for both window creation and
+ // clipboard querying format errors.
+ //
+ // If emitted during window creation, the requested pixel format is not
+ // supported. This means one or more hard constraints did not match any of
+ // the available pixel formats. If your application is sufficiently
+ // flexible, downgrade your requirements and try again. Otherwise, inform
+ // the user that their machine does not match your requirements.
+ //
+ // If emitted when querying the clipboard, the contents of the clipboard
+ // could not be converted to the requested format. You should ignore the
+ // error or report it to the user, as appropriate.
+ FormatUnavailable ErrorCode = C.GLFW_FORMAT_UNAVAILABLE
)
func (e ErrorCode) String() string {