68static void terminate(
void)
123 const size_t length = strlen(source);
124 char* result = calloc(length + 1, 1);
125 strcpy(result, source);
169 va_start(vl, format);
170 vsnprintf(description,
sizeof(description), format, vl);
173 description[
sizeof(description) - 1] =
'\0';
178 strcpy(description,
"The GLFW library is not initialized");
180 strcpy(description,
"There is no current context");
182 strcpy(description,
"Invalid argument for enum parameter");
184 strcpy(description,
"Invalid value for parameter");
186 strcpy(description,
"Out of memory");
188 strcpy(description,
"The requested API is unavailable");
190 strcpy(description,
"The requested API version is unavailable");
192 strcpy(description,
"A platform-specific error occurred");
194 strcpy(description,
"The requested format is unavailable");
196 strcpy(description,
"The specified window has no context");
198 strcpy(description,
"The specified cursor shape is unavailable");
200 strcpy(description,
"The requested feature cannot be implemented for this platform");
202 strcpy(description,
"The requested feature has not yet been implemented for this platform");
204 strcpy(description,
"ERROR: UNKNOWN GLFW ERROR");
221 error = &_glfwMainThreadError;
226 if (_glfwErrorCallback)
227 _glfwErrorCallback(code, description);
299 _glfwInitHints.
ns.
chdir = value;
310 "Invalid init hint 0x%08X", hint);
339 error = &_glfwMainThreadError;
345 if (description && code)
const char * _glfwPlatformGetVersionString(void)
void _glfwPlatformTerminate(void)
int _glfwPlatformInit(void)
void _glfwPlatformTerminateJoysticks(void)
void _glfwPlatformSetGammaRamp(_GLFWmonitor *monitor, const GLFWgammaramp *ramp)
uint64_t _glfwPlatformGetTimerValue(void)
#define GLFW_ANGLE_PLATFORM_TYPE_NONE
#define GLFW_CURSOR_UNAVAILABLE
The specified cursor shape is not available.
#define GLFW_FORMAT_UNAVAILABLE
The requested format is not supported or available.
#define GLFW_NOT_INITIALIZED
GLFW has not been initialized.
#define GLFW_FEATURE_UNAVAILABLE
The requested feature is not provided by the platform.
#define GLFW_API_UNAVAILABLE
GLFW could not find support for the requested API on the system.
#define GLFW_FEATURE_UNIMPLEMENTED
The requested feature is not implemented for the platform.
#define GLFW_INVALID_ENUM
One of the arguments to the function was an invalid enum value.
#define GLFW_OUT_OF_MEMORY
A memory allocation failed.
#define GLFW_NO_CURRENT_CONTEXT
No context is current for this thread.
#define GLFW_INVALID_VALUE
One of the arguments to the function was an invalid value.
#define GLFW_NO_WINDOW_CONTEXT
The specified window does not have an OpenGL or OpenGL ES context.
#define GLFW_VERSION_UNAVAILABLE
The requested OpenGL or OpenGL ES version is not available.
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
#define GLFW_NO_ERROR
No error has occurred.
GLFWAPI void glfwGetVersion(int *major, int *minor, int *rev)
Retrieves the version of the GLFW library.
#define GLFW_VERSION_MAJOR
The major version number of the GLFW header.
#define GLFW_COCOA_MENUBAR
macOS specific init hint.
GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun)
Sets the error callback.
#define GLFW_X11_XCB_VULKAN_SURFACE
X11 specific init hint.
void(* GLFWerrorfun)(int, const char *)
The function pointer type for error callbacks.
GLFWAPI int glfwInit(void)
GLFW API functions.
#define GLFW_VERSION_REVISION
The revision number of the GLFW header.
#define GLFW_COCOA_CHDIR_RESOURCES
macOS specific init hint.
#define GLFW_JOYSTICK_HAT_BUTTONS
Joystick hat buttons init hint.
GLFWAPI void glfwInitHint(int hint, int value)
Sets the specified init hint to the desired value.
GLFWAPI const char * glfwGetVersionString(void)
Returns a string describing the compile-time configuration.
#define GLFW_ANGLE_PLATFORM_TYPE
ANGLE rendering backend init hint.
GLFWAPI int glfwGetError(const char **description)
Returns and clears the last error for the calling thread.
#define GLFW_VERSION_MINOR
The minor version number of the GLFW header.
GLFWAPI void glfwTerminate(void)
Terminates the GLFW library.
struct GLFWwindow GLFWwindow
Opaque window object.
GLFWAPI void glfwDefaultWindowHints(void)
Resets all window hints to their default values.
GLFWAPI void glfwDestroyWindow(GLFWwindow *window)
Destroys the specified window and its context.
float _glfw_fmaxf(float a, float b)
void _glfwInputError(int code, const char *format,...)
float _glfw_fminf(float a, float b)
char * _glfw_strdup(const char *source)
void _glfwPlatformLockMutex(_GLFWmutex *mutex)
void _glfwPlatformSetTls(_GLFWtls *tls, void *value)
void _glfwPlatformDestroyTls(_GLFWtls *tls)
void _glfwPlatformDestroyMutex(_GLFWmutex *mutex)
void _glfwFreeMonitor(_GLFWmonitor *monitor)
GLFWbool _glfwPlatformCreateMutex(_GLFWmutex *mutex)
#define _GLFW_SWAP_POINTERS(x, y)
void * _glfwPlatformGetTls(_GLFWtls *tls)
void _glfwTerminateVulkan(void)
void _glfwPlatformUnlockMutex(_GLFWmutex *mutex)
#define _GLFW_MESSAGE_SIZE
GLFWbool _glfwPlatformCreateTls(_GLFWtls *tls)
const char * _glfwDefaultMappings[]
char description[_GLFW_MESSAGE_SIZE]
struct _GLFWinitconfig::@16 ns
GLFWbool xcbVulkanSurface
struct _GLFWinitconfig::@17 x11
struct _GLFWlibrary::@26 callbacks
_GLFWerror * errorListHead
struct _GLFWlibrary::@24 timer
_GLFWwindow * windowListHead
_GLFWcursor * cursorListHead
struct _GLFWlibrary::@23 hints
GLFWgammaramp originalRamp