106 memset(&_glfw, 0,
sizeof(_glfw));
116 const size_t length = strlen(source);
117 char* result = calloc(length + 1, 1);
118 strcpy(result, source);
162 va_start(vl, format);
163 vsnprintf(description,
sizeof(description), format, vl);
166 description[
sizeof(description) - 1] =
'\0';
171 strcpy(description,
"The GLFW library is not initialized");
173 strcpy(description,
"There is no current context");
175 strcpy(description,
"Invalid argument for enum parameter");
177 strcpy(description,
"Invalid value for parameter");
179 strcpy(description,
"Out of memory");
181 strcpy(description,
"The requested API is unavailable");
183 strcpy(description,
"The requested API version is unavailable");
185 strcpy(description,
"A platform-specific error occurred");
187 strcpy(description,
"The requested format is unavailable");
189 strcpy(description,
"The specified window has no context");
191 strcpy(description,
"ERROR: UNKNOWN GLFW ERROR");
227 memset(&_glfw, 0,
sizeof(_glfw));
283 _glfwInitHints.
ns.
chdir = value;
291 "Invalid init hint 0x%08X", hint);
326 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.
float _glfw_fminf(float a, float b)
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)
GLenum GLuint GLenum GLsizei length
_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
struct GLFWwindow GLFWwindow
Opaque window object.
#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)
struct _GLFWlibrary::@6 hints
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
void _glfwFreeMonitor(_GLFWmonitor *monitor)
struct _GLFWinitconfig::@1 ns
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.
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)
struct _GLFWlibrary::@7 timer
#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.
struct _GLFWlibrary::@9 callbacks
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.
float _glfw_fmaxf(float a, float b)
#define GLFW_NOT_INITIALIZED
GLFW has not been initialized.
GLFWAPI void glfwTerminate(void)
Terminates the GLFW library.
void * _glfwPlatformGetTls(_GLFWtls *tls)
static _GLFWerror _glfwMainThreadError
static void terminate(void)
#define GLFW_VERSION_MAJOR
The major version number of the GLFW library.
#define _GLFW_MESSAGE_SIZE
error
Error code indicating why parse failed.
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.