Go to the documentation of this file.
35 #if defined(GLFW_INCLUDE_GLCOREARB) || \
36 defined(GLFW_INCLUDE_ES1) || \
37 defined(GLFW_INCLUDE_ES2) || \
38 defined(GLFW_INCLUDE_ES3) || \
39 defined(GLFW_INCLUDE_ES31) || \
40 defined(GLFW_INCLUDE_ES32) || \
41 defined(GLFW_INCLUDE_NONE) || \
42 defined(GLFW_INCLUDE_GLEXT) || \
43 defined(GLFW_INCLUDE_GLU) || \
44 defined(GLFW_INCLUDE_VULKAN) || \
46 #error "You must not define any header option macros when compiling GLFW"
49 #define GLFW_INCLUDE_NONE
50 #include "../include/GLFW/glfw3.h"
52 #define _GLFW_INSERT_FIRST 0
53 #define _GLFW_INSERT_LAST 1
55 #define _GLFW_POLL_PRESENCE 0
56 #define _GLFW_POLL_AXES 1
57 #define _GLFW_POLL_BUTTONS 2
58 #define _GLFW_POLL_ALL (_GLFW_POLL_AXES | _GLFW_POLL_BUTTONS)
60 #define _GLFW_MESSAGE_SIZE 1024
87 #define GL_VERSION 0x1f02
89 #define GL_COLOR_BUFFER_BIT 0x00004000
90 #define GL_UNSIGNED_BYTE 0x1401
91 #define GL_EXTENSIONS 0x1f03
92 #define GL_NUM_EXTENSIONS 0x821d
93 #define GL_CONTEXT_FLAGS 0x821e
94 #define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001
95 #define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
96 #define GL_CONTEXT_PROFILE_MASK 0x9126
97 #define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
98 #define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
99 #define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
100 #define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
101 #define GL_NO_RESET_NOTIFICATION_ARB 0x8261
102 #define GL_CONTEXT_RELEASE_BEHAVIOR 0x82fb
103 #define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82fc
104 #define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008
117 #define VK_NULL_HANDLE 0
173 #if defined(_GLFW_VULKAN_STATIC)
179 #define vkEnumerateInstanceExtensionProperties _glfw.vk.EnumerateInstanceExtensionProperties
180 #define vkGetInstanceProcAddr _glfw.vk.GetInstanceProcAddr
183 #if defined(_GLFW_COCOA)
185 #elif defined(_GLFW_WIN32)
187 #elif defined(_GLFW_X11)
189 #elif defined(_GLFW_WAYLAND)
191 #elif defined(_GLFW_OSMESA)
194 #error "No supported window creation API selected"
198 #define _GLFW_CONCAT_VERSION(m, n, r) #m "." #n "." #r
199 #define _GLFW_MAKE_VERSION(m, n, r) _GLFW_CONCAT_VERSION(m, n, r)
200 #define _GLFW_VERSION_NUMBER _GLFW_MAKE_VERSION(GLFW_VERSION_MAJOR, \
201 GLFW_VERSION_MINOR, \
202 GLFW_VERSION_REVISION)
205 #define _GLFW_REQUIRE_INIT() \
206 if (!_glfw.initialized) \
208 _glfwInputError(GLFW_NOT_INITIALIZED, NULL); \
211 #define _GLFW_REQUIRE_INIT_OR_RETURN(x) \
212 if (!_glfw.initialized) \
214 _glfwInputError(GLFW_NOT_INITIALIZED, NULL); \
219 #define _GLFW_SWAP_POINTERS(x, y) \
550 #if !defined(_GLFW_VULKAN_STATIC)
555 #if defined(_GLFW_WIN32)
557 #elif defined(_GLFW_COCOA)
559 #elif defined(_GLFW_X11)
562 #elif defined(_GLFW_WAYLAND)
601 const GLFWimage* image,
int xhot,
int yhot);
612 float* xscale,
float* yscale);
640 int minwidth,
int minheight,
641 int maxwidth,
int maxheight);
646 int* right,
int* bottom);
648 float* xscale,
float* yscale);
657 int xpos,
int ypos,
int width,
int height,
679 uint32_t queuefamily);
705 float xscale,
float yscale);
713 int key,
int scancode,
int action,
int mods);
715 unsigned int codepoint,
int mods,
GLFWbool plain);
729 #if defined(__GNUC__)
731 __attribute__((format(printf, 2, 3)));
756 void _glfwSplitBPP(
int bpp,
int* red,
int* green,
int* blue);
struct _GLFWwindow::@5 callbacks
_GLFW_PLATFORM_MONITOR_STATE
void(* GLFWwindowclosefun)(GLFWwindow *)
The function signature for window close callbacks.
void _glfwInputWindowContentScale(_GLFWwindow *window, float xscale, float yscale)
struct _GLFWlibrary::@7 timer
_GLFW_PLATFORM_WINDOW_STATE
int _glfwPlatformCreateStandardCursor(_GLFWcursor *cursor, int shape)
int _glfwPlatformWindowHovered(_GLFWwindow *window)
@ VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR
void _glfwPlatformHideWindow(_GLFWwindow *window)
GLFWvidmode * _glfwPlatformGetVideoModes(_GLFWmonitor *monitor, int *count)
void(* GLFWwindowrefreshfun)(GLFWwindow *)
The function signature for window content refresh callbacks.
void _glfwInputCursorEnter(_GLFWwindow *window, GLFWbool entered)
struct _GLFWlibrary::@9 callbacks
_GLFWextensionsupportedfun extensionSupported
const _GLFWfbconfig * _glfwChooseFBConfig(const _GLFWfbconfig *desired, const _GLFWfbconfig *alternatives, unsigned int count)
_GLFWmapelement buttons[15]
@ VK_ERROR_INCOMPATIBLE_DISPLAY_KHR
_GLFWmakecontextcurrentfun makeCurrent
int _glfwPlatformWindowFocused(_GLFWwindow *window)
void _glfwPlatformSetWindowTitle(_GLFWwindow *window, const char *title)
void(* GLFWmonitorfun)(GLFWmonitor *, int)
The function signature for monitor configuration callbacks.
void _glfwPlatformTerminate(void)
void _glfwInputChar(_GLFWwindow *window, unsigned int codepoint, int mods, GLFWbool plain)
void _glfwPlatformMaximizeWindow(_GLFWwindow *window)
char keys[GLFW_KEY_LAST+1]
GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig *ctxconfig)
#define vkEnumerateInstanceExtensionProperties
void _glfwPlatformSetWindowIcon(_GLFWwindow *window, int count, const GLFWimage *images)
float _glfw_fmaxf(float a, float b)
void _glfwInputCursorPos(_GLFWwindow *window, double xpos, double ypos)
@ VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK
int _glfwPlatformGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily)
@ VK_ERROR_FEATURE_NOT_PRESENT
void(* GLFWwindowiconifyfun)(GLFWwindow *, int)
The function signature for window iconify/restore callbacks.
void _glfwInputJoystickButton(_GLFWjoystick *js, int button, char value)
void _glfwInputWindowDamage(_GLFWwindow *window)
int _glfwPlatformWindowIconified(_GLFWwindow *window)
@ VK_ERROR_NATIVE_WINDOW_IN_USE_KHR
int _glfwPlatformPollJoystick(_GLFWjoystick *js, int mode)
void(* GLFWwindowsizefun)(GLFWwindow *, int, int)
The function signature for window resize callbacks.
void _glfwPlatformRequestWindowAttention(_GLFWwindow *window)
PFN_vkGetInstanceProcAddr GetInstanceProcAddr
@ VK_ERROR_VALIDATION_FAILED_EXT
void _glfwPlatformSetWindowSizeLimits(_GLFWwindow *window, int minwidth, int minheight, int maxwidth, int maxheight)
int _glfwPlatformWindowVisible(_GLFWwindow *window)
void _glfwPlatformRestoreWindow(_GLFWwindow *window)
void _glfwFreeJoystick(_GLFWjoystick *js)
void _glfwPlatformLockMutex(_GLFWmutex *mutex)
struct _GLFWlibrary::@6 hints
PFNGLGETSTRINGIPROC GetStringi
void _glfwPlatformSetTls(_GLFWtls *tls, void *value)
void _glfwInputMonitor(_GLFWmonitor *monitor, int action, int placement)
void(APIENTRY * PFNGLCLEARPROC)(GLbitfield)
void(APIENTRY * PFN_vkVoidFunction)(void)
void _glfwPlatformFreeMonitor(_GLFWmonitor *monitor)
void _glfwInputFramebufferSize(_GLFWwindow *window, int width, int height)
void _glfwPlatformSetWindowFloating(_GLFWwindow *window, GLFWbool enabled)
void _glfwInputWindowFocus(_GLFWwindow *window, GLFWbool focused)
const char * _glfwGetVulkanResultString(VkResult result)
_GLFW_OSMESA_CONTEXT_STATE
void _glfwPlatformWaitEventsTimeout(double timeout)
void _glfwPlatformFocusWindow(_GLFWwindow *window)
@ VK_ERROR_MEMORY_MAP_FAILED
const typedef GLubyte *APIENTRY * PFNGLGETSTRINGPROC(GLenum)
@ VK_ERROR_INCOMPATIBLE_DRIVER
GLFWbool _glfwInitVulkan(int mode)
@ VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR
void(* _GLFWswapintervalfun)(int)
struct _GLFWctxconfig::@4 nsgl
@ VK_ERROR_TOO_MANY_OBJECTS
void _glfwPlatformGetWindowContentScale(_GLFWwindow *window, float *xscale, float *yscale)
void _glfwPlatformSetWindowPos(_GLFWwindow *window, int xpos, int ypos)
void _glfwPlatformWaitEvents(void)
_GLFWdestroycontextfun destroy
PFN_vkVoidFunction(APIENTRY * PFN_vkGetInstanceProcAddr)(VkInstance, const char *)
void _glfwInputKey(_GLFWwindow *window, int key, int scancode, int action, int mods)
struct _GLFWwndconfig::@3 x11
@ VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR
void _glfwInputError(int code, const char *format,...)
void(APIENTRY * PFNGLGETINTEGERVPROC)(GLenum, GLint *)
GLFWwindowcontentscalefun scale
void _glfwFreeMonitor(_GLFWmonitor *monitor)
void _glfwPlatformSetGammaRamp(_GLFWmonitor *monitor, const GLFWgammaramp *ramp)
void _glfwInputJoystick(_GLFWjoystick *js, int event)
int _glfwPlatformCreateCursor(_GLFWcursor *cursor, const GLFWimage *image, int xhot, int yhot)
void _glfwAllocGammaArrays(GLFWgammaramp *ramp, unsigned int size)
void(* GLFWglproc)(void)
Client API function pointer type.
uint64_t _glfwPlatformGetTimerValue(void)
void _glfwPlatformPostEmptyEvent(void)
const typedef GLubyte *APIENTRY * PFNGLGETSTRINGIPROC(GLenum, GLuint)
_GLFWjoystick joysticks[GLFW_JOYSTICK_LAST+1]
const GLFWvidmode * _glfwChooseVideoMode(_GLFWmonitor *monitor, const GLFWvidmode *desired)
void _glfwPlatformDestroyMutex(_GLFWmutex *mutex)
void _glfwInputMonitorWindow(_GLFWmonitor *monitor, _GLFWwindow *window)
typedef void(GLAD_API_PTR *GLDEBUGPROC)(GLenum source
const char * _glfwPlatformGetScancodeName(int scancode)
GLFWmousebuttonfun mouseButton
@ VK_ERROR_OUT_OF_HOST_MEMORY
void(* GLFWwindowmaximizefun)(GLFWwindow *, int)
The function signature for window maximize/restore callbacks.
void(* GLFWframebuffersizefun)(GLFWwindow *, int, int)
The function signature for framebuffer resize callbacks.
void _glfwInputWindowSize(_GLFWwindow *window, int width, int height)
void _glfwPlatformSetCursor(_GLFWwindow *window, _GLFWcursor *cursor)
struct _GLFWlibrary::@8 vk
struct VkExtensionProperties VkExtensionProperties
struct _GLFWwndconfig::@2 ns
_GLFW_PLATFORM_LIBRARY_CONTEXT_STATE
void * _glfwPlatformGetTls(_GLFWtls *tls)
int(* _GLFWextensionsupportedfun)(const char *)
void _glfwInputDrop(_GLFWwindow *window, int count, const char **names)
#define vkGetInstanceProcAddr
_GLFWfbconfig framebuffer
void _glfwPlatformUpdateGamepadGUID(char *guid)
void _glfwFreeGammaArrays(GLFWgammaramp *ramp)
void _glfwInputScroll(_GLFWwindow *window, double xoffset, double yoffset)
void _glfwPlatformSetClipboardString(const char *string)
_GLFWjoystick * _glfwAllocJoystick(const char *name, const char *guid, int axisCount, int buttonCount, int hatCount)
GLFWgammaramp currentRamp
void _glfwInputJoystickHat(_GLFWjoystick *js, int hat, char value)
struct VkAllocationCallbacks VkAllocationCallbacks
void _glfwPlatformSetCursorMode(_GLFWwindow *window, int mode)
_GLFW_PLATFORM_LIBRARY_TIMER_STATE
PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties
_GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE
GLFWwindowmaximizefun maximize
PFNGLGETINTEGERVPROC GetIntegerv
void(* GLFWwindowcontentscalefun)(GLFWwindow *, float, float)
The function signature for window content scale callbacks.
void _glfwInputWindowCloseRequest(_GLFWwindow *window)
void _glfwPlatformSetWindowResizable(_GLFWwindow *window, GLFWbool enabled)
void _glfwPlatformSetWindowAspectRatio(_GLFWwindow *window, int numer, int denom)
void _glfwPlatformGetWindowPos(_GLFWwindow *window, int *xpos, int *ypos)
void _glfwPlatformSetWindowMonitor(_GLFWwindow *window, _GLFWmonitor *monitor, int xpos, int ypos, int width, int height, int refreshRate)
GLFWframebuffersizefun fbsize
void _glfwInputWindowIconify(_GLFWwindow *window, GLFWbool iconified)
@ VK_ERROR_OUT_OF_DATE_KHR
GLFWcursorenterfun cursorEnter
float _glfw_fminf(float a, float b)
_GLFW_PLATFORM_CONTEXT_STATE
GLFWcursorposfun cursorPos
@ VK_ERROR_FORMAT_NOT_SUPPORTED
void _glfwPlatformGetMonitorContentScale(_GLFWmonitor *monitor, float *xscale, float *yscale)
void _glfwInputMouseClick(_GLFWwindow *window, int button, int action, int mods)
GLFWbool _glfwRefreshContextAttribs(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig)
void(* GLFWwindowfocusfun)(GLFWwindow *, int)
The function signature for window focus/defocus callbacks.
struct _GLFWwindow * next
void(* _GLFWswapbuffersfun)(_GLFWwindow *)
void(* GLFWwindowposfun)(GLFWwindow *, int, int)
The function signature for window position callbacks.
void _glfwPlatformSetCursorPos(_GLFWwindow *window, double xpos, double ypos)
void _glfwPlatformSetWindowOpacity(_GLFWwindow *window, float opacity)
_GLFWerror * errorListHead
GLFWbool _glfwPlatformCreateMutex(_GLFWmutex *mutex)
VkResult(APIENTRY * PFN_vkEnumerateInstanceExtensionProperties)(const char *, uint32_t *, VkExtensionProperties *)
void _glfwPlatformGetMonitorPos(_GLFWmonitor *monitor, int *xpos, int *ypos)
GLFWbool stickyMouseButtons
int _glfwPlatformWindowMaximized(_GLFWwindow *window)
GLFWbool _glfwPlatformGetGammaRamp(_GLFWmonitor *monitor, GLFWgammaramp *ramp)
void _glfwPlatformGetVideoMode(_GLFWmonitor *monitor, GLFWvidmode *mode)
int _glfwPlatformInit(void)
void _glfwPlatformShowWindow(_GLFWwindow *window)
void _glfwInputWindowMaximize(_GLFWwindow *window, GLFWbool maximized)
void _glfwInputJoystickAxis(_GLFWjoystick *js, int axis, float value)
GLFWwindowiconifyfun iconify
uint64_t _glfwPlatformGetTimerFrequency(void)
void _glfwPlatformGetRequiredInstanceExtensions(char **extensions)
_GLFW_PLATFORM_LIBRARY_WINDOW_STATE
void(* _GLFWmakecontextcurrentfun)(_GLFWwindow *)
const char * _glfwPlatformGetClipboardString(void)
void _glfwPlatformGetCursorPos(_GLFWwindow *window, double *xpos, double *ypos)
GLFWwindowrefreshfun refresh
char description[_GLFW_MESSAGE_SIZE]
void _glfwPlatformIconifyWindow(_GLFWwindow *window)
#define GLFW_JOYSTICK_LAST
int _glfwPlatformGetKeyScancode(int key)
VkResult _glfwPlatformCreateWindowSurface(VkInstance instance, _GLFWwindow *window, const VkAllocationCallbacks *allocator, VkSurfaceKHR *surface)
char mouseButtons[GLFW_MOUSE_BUTTON_LAST+1]
int _glfwCompareVideoModes(const GLFWvidmode *first, const GLFWvidmode *second)
@ VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR
void _glfwSplitBPP(int bpp, int *red, int *green, int *blue)
GLFWglproc(* _GLFWgetprocaddressfun)(const char *)
const char * _glfwPlatformGetVersionString(void)
void _glfwPlatformDestroyTls(_GLFWtls *tls)
GLFWbool _glfwPlatformCreateTls(_GLFWtls *tls)
_GLFWswapbuffersfun swapBuffers
float _glfwPlatformGetWindowOpacity(_GLFWwindow *window)
_GLFWmonitor * _glfwAllocMonitor(const char *name, int widthMM, int heightMM)
_GLFWwindow * windowListHead
void _glfwInputWindowMonitor(_GLFWwindow *window, _GLFWmonitor *monitor)
void _glfwInputWindowPos(_GLFWwindow *window, int xpos, int ypos)
_GLFW_PLATFORM_JOYSTICK_STATE
void _glfwPlatformSetWindowDecorated(_GLFWwindow *window, GLFWbool enabled)
_GLFWcursor * cursorListHead
void _glfwPlatformDestroyCursor(_GLFWcursor *cursor)
GLFWgammaramp originalRamp
@ VK_STRUCTURE_TYPE_MAX_ENUM
int _glfwPlatformFramebufferTransparent(_GLFWwindow *window)
void _glfwPlatformPollEvents(void)
@ VK_ERROR_INITIALIZATION_FAILED
int _glfwPlatformCreateWindow(_GLFWwindow *window, const _GLFWwndconfig *wndconfig, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
void _glfwPlatformDestroyWindow(_GLFWwindow *window)
void _glfwPlatformUnlockMutex(_GLFWmutex *mutex)
GLFWbool KHR_xlib_surface
struct _GLFWinitconfig::@1 ns
@ VK_ERROR_SURFACE_LOST_KHR
void _glfwPlatformGetWindowSize(_GLFWwindow *window, int *width, int *height)
char * _glfw_strdup(const char *source)
_GLFWgetprocaddressfun getProcAddress
void _glfwPlatformSetWindowSize(_GLFWwindow *window, int width, int height)
_GLFW_PLATFORM_CURSOR_STATE
PFNGLGETSTRINGPROC GetString
@ VK_ERROR_EXTENSION_NOT_PRESENT
void _glfwPlatformGetWindowFrameSize(_GLFWwindow *window, int *left, int *top, int *right, int *bottom)
@ VK_ERROR_OUT_OF_DEVICE_MEMORY
void _glfwTerminateVulkan(void)
#define _GLFW_MESSAGE_SIZE
void _glfwPlatformGetFramebufferSize(_GLFWwindow *window, int *width, int *height)
void(* _GLFWdestroycontextfun)(_GLFWwindow *)
_GLFW_EGL_LIBRARY_CONTEXT_STATE
_GLFW_OSMESA_LIBRARY_CONTEXT_STATE
_GLFW_PLATFORM_MUTEX_STATE
GLFWbool _glfwStringInExtensionString(const char *string, const char *extensions)
@ VK_ERROR_LAYER_NOT_PRESENT
_GLFWswapintervalfun swapInterval
mvsim
Author(s):
autogenerated on Wed May 28 2025 02:13:08