106 memset(&_glfw, 0,
sizeof(_glfw));
116 const size_t length = strlen(source);
117 char*
result = calloc(length + 1, 1);
118 strcpy(result, source);
138 va_start(vl, format);
139 vsnprintf(description,
sizeof(description), format, vl);
142 description[
sizeof(description) - 1] =
'\0';
147 strcpy(description,
"The GLFW library is not initialized");
149 strcpy(description,
"There is no current context");
151 strcpy(description,
"Invalid argument for enum parameter");
153 strcpy(description,
"Invalid value for parameter");
155 strcpy(description,
"Out of memory");
157 strcpy(description,
"The requested API is unavailable");
159 strcpy(description,
"The requested API version is unavailable");
161 strcpy(description,
"A platform-specific error occurred");
163 strcpy(description,
"The requested format is unavailable");
165 strcpy(description,
"The specified window has no context");
167 strcpy(description,
"ERROR: UNKNOWN GLFW ERROR");
203 memset(&_glfw, 0,
sizeof(_glfw));
267 "Invalid init hint 0x%08X", hint);
302 if (description && code)
char description[_GLFW_MESSAGE_SIZE]
void _glfwPlatformDestroyTls(_GLFWtls *tls)
static GLFWerrorfun _glfwErrorCallback
#define GLFW_JOYSTICK_HAT_BUTTONS
Joystick hat buttons init hint.
void _glfwPlatformDestroyMutex(_GLFWmutex *mutex)
const char * _glfwDefaultMappings[]
#define GLFW_COCOA_MENUBAR
macOS specific init hint.
GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun)
Sets the error callback.
#define GLFW_NO_WINDOW_CONTEXT
The specified window does not have an OpenGL or OpenGL ES context.
char * _glfw_strdup(const char *source)
_GLFWerror * errorListHead
GLFWAPI int glfwGetError(const char **description)
Returns and clears the last error for the calling thread.
static _GLFWinitconfig _glfwInitHints
#define GLFW_API_UNAVAILABLE
GLFW could not find support for the requested API on the system.
void _glfwTerminateVulkan(void)
#define GLFW_FORMAT_UNAVAILABLE
The requested format is not supported or available.
_GLFWwindow * windowListHead
#define _GLFW_SWAP_POINTERS(x, y)
_GLFWcursor * cursorListHead
#define GLFW_NO_CURRENT_CONTEXT
No context is current for this thread.
GLFWAPI int glfwInit(void)
Initializes the GLFW library.
int _glfwPlatformInit(void)
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
void _glfwFreeMonitor(_GLFWmonitor *monitor)
struct _GLFWlibrary::@27 hints
GLFWAPI const char * glfwGetVersionString(void)
Returns a string describing the compile-time configuration.
void _glfwPlatformSetGammaRamp(_GLFWmonitor *monitor, const GLFWgammaramp *ramp)
#define GLFW_NO_ERROR
No error has occurred.
GLFWAPI void glfwGetVersion(int *major, int *minor, int *rev)
Retrieves the version of the GLFW library.
GLFWAPI void glfwDefaultWindowHints(void)
Resets all window hints to their default values.
GLint GLint GLsizei GLint GLenum format
void _glfwPlatformLockMutex(_GLFWmutex *mutex)
void _glfwPlatformUnlockMutex(_GLFWmutex *mutex)
void _glfwInputError(int code, const char *format,...)
GLFWbool _glfwPlatformCreateMutex(_GLFWmutex *mutex)
const char * _glfwPlatformGetVersionString(void)
GLFWbool _glfwPlatformCreateTls(_GLFWtls *tls)
#define GLFW_VERSION_UNAVAILABLE
The requested OpenGL or OpenGL ES version is not available.
uint64_t _glfwPlatformGetTimerValue(void)
GLFWgammaramp originalRamp
#define GLFW_INVALID_ENUM
One of the arguments to the function was an invalid enum value.
#define GLFW_INVALID_VALUE
One of the arguments to the function was an invalid value.
void _glfwPlatformSetTls(_GLFWtls *tls, void *value)
#define GLFW_VERSION_REVISION
The revision number of the GLFW library.
void _glfwPlatformTerminate(void)
#define GLFW_OUT_OF_MEMORY
A memory allocation failed.
GLFWAPI void glfwDestroyWindow(GLFWwindow *window)
Destroys the specified window and its context.
#define GLFW_VERSION_MINOR
The minor version number of the GLFW library.
#define GLFW_NOT_INITIALIZED
GLFW has not been initialized.
GLFWAPI void glfwTerminate(void)
Terminates the GLFW library.
struct _GLFWlibrary::@28 timer
void * _glfwPlatformGetTls(_GLFWtls *tls)
GLsizei GLsizei GLchar * source
struct _GLFWinitconfig::@22 ns
static _GLFWerror _glfwMainThreadError
static void terminate(void)
struct _GLFWlibrary::@30 callbacks
#define GLFW_VERSION_MAJOR
The major version number of the GLFW library.
GLenum GLuint GLenum GLsizei length
#define _GLFW_MESSAGE_SIZE
struct GLFWwindow GLFWwindow
void(* GLFWerrorfun)(int, const char *)
The function signature for error callbacks.
GLFWAPI void glfwInitHint(int hint, int value)
Sets the specified init hint to the desired value.
#define GLFW_COCOA_CHDIR_RESOURCES
macOS specific init hint.