30#if defined(_GLFW_USE_CONFIG_H)
31 #include "glfw_config.h"
34#if defined(GLFW_INCLUDE_GLCOREARB) || \
35 defined(GLFW_INCLUDE_ES1) || \
36 defined(GLFW_INCLUDE_ES2) || \
37 defined(GLFW_INCLUDE_ES3) || \
38 defined(GLFW_INCLUDE_ES31) || \
39 defined(GLFW_INCLUDE_ES32) || \
40 defined(GLFW_INCLUDE_NONE) || \
41 defined(GLFW_INCLUDE_GLEXT) || \
42 defined(GLFW_INCLUDE_GLU) || \
43 defined(GLFW_INCLUDE_VULKAN) || \
45 #error "You must not define any header option macros when compiling GLFW"
48#define GLFW_INCLUDE_NONE
49#include "../include/GLFW/glfw3.h"
51#define _GLFW_INSERT_FIRST 0
52#define _GLFW_INSERT_LAST 1
54#define _GLFW_POLL_PRESENCE 0
55#define _GLFW_POLL_AXES 1
56#define _GLFW_POLL_BUTTONS 2
57#define _GLFW_POLL_ALL (_GLFW_POLL_AXES | _GLFW_POLL_BUTTONS)
59#define _GLFW_MESSAGE_SIZE 1024
86#define GL_VERSION 0x1f02
88#define GL_COLOR_BUFFER_BIT 0x00004000
89#define GL_UNSIGNED_BYTE 0x1401
90#define GL_EXTENSIONS 0x1f03
91#define GL_NUM_EXTENSIONS 0x821d
92#define GL_CONTEXT_FLAGS 0x821e
93#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001
94#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
95#define GL_CONTEXT_PROFILE_MASK 0x9126
96#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
97#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
98#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
99#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
100#define GL_NO_RESET_NOTIFICATION_ARB 0x8261
101#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82fb
102#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82fc
103#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008
116#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"
201#define _GLFW_CONCAT_VERSION(m, n, r) #m "." #n "." #r
202#define _GLFW_MAKE_VERSION(m, n, r) _GLFW_CONCAT_VERSION(m, n, r)
203#define _GLFW_VERSION_NUMBER _GLFW_MAKE_VERSION(GLFW_VERSION_MAJOR, \
204 GLFW_VERSION_MINOR, \
205 GLFW_VERSION_REVISION)
208#define _GLFW_REQUIRE_INIT() \
209 if (!_glfw.initialized) \
211 _glfwInputError(GLFW_NOT_INITIALIZED, NULL); \
214#define _GLFW_REQUIRE_INIT_OR_RETURN(x) \
215 if (!_glfw.initialized) \
217 _glfwInputError(GLFW_NOT_INITIALIZED, NULL); \
222#define _GLFW_SWAP_POINTERS(x, y) \
565#if !defined(_GLFW_VULKAN_STATIC)
570#if defined(_GLFW_WIN32)
572#elif defined(_GLFW_COCOA)
575#elif defined(_GLFW_X11)
578#elif defined(_GLFW_WAYLAND)
619 const GLFWimage* image,
int xhot,
int yhot);
630 float* xscale,
float* yscale);
661 int minwidth,
int minheight,
662 int maxwidth,
int maxheight);
667 int* right,
int* bottom);
669 float* xscale,
float* yscale);
678 int xpos,
int ypos,
int width,
int height,
731 float xscale,
float yscale);
739 int key,
int scancode,
int action,
int mods);
741 unsigned int codepoint,
int mods,
GLFWbool plain);
757 __attribute__((format(printf, 2, 3)));
void * EGLNativeDisplayType
void * EGLNativeWindowType
#define APIENTRY
Compiler- and platform-specific preprocessor work.
void(* GLFWglproc)(void)
GLFW API types.
#define GLFW_JOYSTICK_LAST
void(* GLFWmonitorfun)(GLFWmonitor *, int)
The function pointer type for monitor configuration callbacks.
void(* GLFWframebuffersizefun)(GLFWwindow *, int, int)
The function pointer type for framebuffer size callbacks.
void(* GLFWwindowclosefun)(GLFWwindow *)
The function pointer type for window close callbacks.
void(* GLFWwindowfocusfun)(GLFWwindow *, int)
The function pointer type for window focus callbacks.
void(* GLFWwindowrefreshfun)(GLFWwindow *)
The function pointer type for window content refresh callbacks.
void(* GLFWwindowmaximizefun)(GLFWwindow *, int)
The function pointer type for window maximize callbacks.
void(* GLFWwindowiconifyfun)(GLFWwindow *, int)
The function pointer type for window iconify callbacks.
void(* GLFWwindowsizefun)(GLFWwindow *, int, int)
The function pointer type for window size callbacks.
void(* GLFWwindowcontentscalefun)(GLFWwindow *, float, float)
The function pointer type for window content scale callbacks.
void(* GLFWwindowposfun)(GLFWwindow *, int, int)
The function pointer type for window position callbacks.
void _glfwPlatformTerminateJoysticks(void)
void _glfwPlatformSetWindowMonitor(_GLFWwindow *window, _GLFWmonitor *monitor, int xpos, int ypos, int width, int height, int refreshRate)
void _glfwInputMonitorWindow(_GLFWmonitor *monitor, _GLFWwindow *window)
int _glfwPlatformPollJoystick(_GLFWjoystick *js, int mode)
void _glfwPlatformSetWindowPos(_GLFWwindow *window, int xpos, int ypos)
void _glfwPlatformFreeMonitor(_GLFWmonitor *monitor)
void _glfwPlatformGetWindowContentScale(_GLFWwindow *window, float *xscale, float *yscale)
float _glfw_fmaxf(float a, float b)
void _glfwPlatformSetWindowResizable(_GLFWwindow *window, GLFWbool enabled)
int _glfwPlatformWindowIconified(_GLFWwindow *window)
void _glfwInputFramebufferSize(_GLFWwindow *window, int width, int height)
void _glfwPlatformMaximizeWindow(_GLFWwindow *window)
EGLenum _glfwPlatformGetEGLPlatform(EGLint **attribs)
void _glfwPlatformIconifyWindow(_GLFWwindow *window)
void _glfwPlatformLockMutex(_GLFWmutex *mutex)
void _glfwPlatformSetWindowSize(_GLFWwindow *window, int width, int height)
void _glfwInputMonitor(_GLFWmonitor *monitor, int action, int placement)
_GLFWjoystick * _glfwAllocJoystick(const char *name, const char *guid, int axisCount, int buttonCount, int hatCount)
void _glfwPlatformWaitEvents(void)
void _glfwInputWindowIconify(_GLFWwindow *window, GLFWbool iconified)
GLFWbool _glfwPlatformInitJoysticks(void)
void _glfwPlatformSetTls(_GLFWtls *tls, void *value)
void _glfwPlatformSetWindowSizeLimits(_GLFWwindow *window, int minwidth, int minheight, int maxwidth, int maxheight)
void _glfwPlatformGetRequiredInstanceExtensions(char **extensions)
void _glfwInputWindowMaximize(_GLFWwindow *window, GLFWbool maximized)
void _glfwInputError(int code, const char *format,...)
VkResult _glfwPlatformCreateWindowSurface(VkInstance instance, _GLFWwindow *window, const VkAllocationCallbacks *allocator, VkSurfaceKHR *surface)
int _glfwPlatformFramebufferTransparent(_GLFWwindow *window)
void _glfwPlatformDestroyTls(_GLFWtls *tls)
void _glfwPlatformDestroyMutex(_GLFWmutex *mutex)
void(APIENTRY * PFNGLCLEARPROC)(GLbitfield)
int _glfwPlatformCreateCursor(_GLFWcursor *cursor, const GLFWimage *image, int xhot, int yhot)
void _glfwPlatformPollEvents(void)
GLFWbool _glfwInitVulkan(int mode)
void _glfwInputJoystick(_GLFWjoystick *js, int event)
const GLubyte *(APIENTRY * PFNGLGETSTRINGIPROC)(GLenum, GLuint)
void _glfwSplitBPP(int bpp, int *red, int *green, int *blue)
void _glfwPlatformGetFramebufferSize(_GLFWwindow *window, int *width, int *height)
const GLFWvidmode * _glfwChooseVideoMode(_GLFWmonitor *monitor, const GLFWvidmode *desired)
void(APIENTRY * PFN_vkVoidFunction)(void)
void _glfwInputWindowSize(_GLFWwindow *window, int width, int height)
int _glfwPlatformWindowVisible(_GLFWwindow *window)
void(* _GLFWswapbuffersfun)(_GLFWwindow *)
void _glfwInputCursorEnter(_GLFWwindow *window, GLFWbool entered)
void _glfwPlatformSetCursor(_GLFWwindow *window, _GLFWcursor *cursor)
void(* _GLFWmakecontextcurrentfun)(_GLFWwindow *)
void(* _GLFWswapintervalfun)(int)
void _glfwPlatformGetWindowSize(_GLFWwindow *window, int *width, int *height)
void _glfwFreeMonitor(_GLFWmonitor *monitor)
const char * _glfwPlatformGetVersionString(void)
void _glfwInputWindowMonitor(_GLFWwindow *window, _GLFWmonitor *monitor)
void _glfwPlatformGetWindowFrameSize(_GLFWwindow *window, int *left, int *top, int *right, int *bottom)
uint64_t _glfwPlatformGetTimerValue(void)
GLFWvidmode * _glfwPlatformGetVideoModes(_GLFWmonitor *monitor, int *count)
void _glfwPlatformSetWindowIcon(_GLFWwindow *window, int count, const GLFWimage *images)
EGLNativeWindowType _glfwPlatformGetEGLNativeWindow(_GLFWwindow *window)
const char * _glfwPlatformGetScancodeName(int scancode)
GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig *ctxconfig)
void _glfwPlatformSetWindowDecorated(_GLFWwindow *window, GLFWbool enabled)
void _glfwInputScroll(_GLFWwindow *window, double xoffset, double yoffset)
void _glfwPlatformGetWindowPos(_GLFWwindow *window, int *xpos, int *ypos)
GLFWbool _glfwPlatformCreateMutex(_GLFWmutex *mutex)
void _glfwPlatformSetWindowOpacity(_GLFWwindow *window, float opacity)
GLFWbool _glfwStringInExtensionString(const char *string, const char *extensions)
void _glfwPlatformSetCursorPos(_GLFWwindow *window, double xpos, double ypos)
float _glfwPlatformGetWindowOpacity(_GLFWwindow *window)
void _glfwPlatformDestroyCursor(_GLFWcursor *cursor)
void _glfwPlatformTerminate(void)
void * _glfwPlatformGetTls(_GLFWtls *tls)
void _glfwPlatformRestoreWindow(_GLFWwindow *window)
void _glfwTerminateVulkan(void)
GLFWbool _glfwPlatformRawMouseMotionSupported(void)
void _glfwPlatformSetCursorMode(_GLFWwindow *window, int mode)
void _glfwInputChar(_GLFWwindow *window, unsigned int codepoint, int mods, GLFWbool plain)
int _glfwPlatformWindowHovered(_GLFWwindow *window)
void _glfwPlatformDestroyWindow(_GLFWwindow *window)
void _glfwPlatformWaitEventsTimeout(double timeout)
void _glfwPlatformUnlockMutex(_GLFWmutex *mutex)
void _glfwPlatformHideWindow(_GLFWwindow *window)
int(* _GLFWextensionsupportedfun)(const char *)
void _glfwInputWindowPos(_GLFWwindow *window, int xpos, int ypos)
int _glfwPlatformGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily)
void _glfwInputCursorPos(_GLFWwindow *window, double xpos, double ypos)
int _glfwPlatformWindowMaximized(_GLFWwindow *window)
void _glfwInputDrop(_GLFWwindow *window, int count, const char **names)
void _glfwFreeGammaArrays(GLFWgammaramp *ramp)
int _glfwCompareVideoModes(const GLFWvidmode *first, const GLFWvidmode *second)
int _glfwPlatformInit(void)
const GLubyte *(APIENTRY * PFNGLGETSTRINGPROC)(GLenum)
void(APIENTRY * PFNGLGETINTEGERVPROC)(GLenum, GLint *)
void _glfwPlatformSetClipboardString(const char *string)
const char * _glfwGetVulkanResultString(VkResult result)
VkResult(APIENTRY * PFN_vkEnumerateInstanceExtensionProperties)(const char *, uint32_t *, VkExtensionProperties *)
uint64_t _glfwPlatformGetTimerFrequency(void)
void _glfwInputWindowContentScale(_GLFWwindow *window, float xscale, float yscale)
_GLFWmonitor * _glfwAllocMonitor(const char *name, int widthMM, int heightMM)
void _glfwPlatformGetVideoMode(_GLFWmonitor *monitor, GLFWvidmode *mode)
void _glfwInputJoystickAxis(_GLFWjoystick *js, int axis, float value)
void _glfwPlatformUpdateGamepadGUID(char *guid)
void _glfwInputKey(_GLFWwindow *window, int key, int scancode, int action, int mods)
void _glfwPlatformShowWindow(_GLFWwindow *window)
void _glfwPlatformSetGammaRamp(_GLFWmonitor *monitor, const GLFWgammaramp *ramp)
@ VK_ERROR_VALIDATION_FAILED_EXT
@ VK_ERROR_EXTENSION_NOT_PRESENT
@ VK_ERROR_OUT_OF_HOST_MEMORY
@ VK_ERROR_INITIALIZATION_FAILED
@ VK_ERROR_INCOMPATIBLE_DISPLAY_KHR
@ VK_ERROR_OUT_OF_DEVICE_MEMORY
@ VK_ERROR_NATIVE_WINDOW_IN_USE_KHR
@ VK_ERROR_OUT_OF_DATE_KHR
@ VK_ERROR_FORMAT_NOT_SUPPORTED
@ VK_ERROR_SURFACE_LOST_KHR
@ VK_ERROR_FEATURE_NOT_PRESENT
@ VK_ERROR_TOO_MANY_OBJECTS
@ VK_ERROR_MEMORY_MAP_FAILED
@ VK_ERROR_LAYER_NOT_PRESENT
@ VK_ERROR_INCOMPATIBLE_DRIVER
void _glfwPlatformSetRawMouseMotion(_GLFWwindow *window, GLFWbool enabled)
int _glfwPlatformWindowFocused(_GLFWwindow *window)
void _glfwPlatformGetMonitorPos(_GLFWmonitor *monitor, int *xpos, int *ypos)
void _glfwPlatformPostEmptyEvent(void)
GLFWbool _glfwPlatformGetGammaRamp(_GLFWmonitor *monitor, GLFWgammaramp *ramp)
void _glfwInputJoystickHat(_GLFWjoystick *js, int hat, char value)
void _glfwPlatformGetMonitorContentScale(_GLFWmonitor *monitor, float *xscale, float *yscale)
void _glfwAllocGammaArrays(GLFWgammaramp *ramp, unsigned int size)
int _glfwPlatformGetKeyScancode(int key)
int _glfwPlatformCreateStandardCursor(_GLFWcursor *cursor, int shape)
void _glfwCenterCursorInContentArea(_GLFWwindow *window)
GLFWbool _glfwRefreshContextAttribs(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig)
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor *monitor, int *xpos, int *ypos, int *width, int *height)
int _glfwPlatformCreateWindow(_GLFWwindow *window, const _GLFWwndconfig *wndconfig, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
void _glfwInputWindowDamage(_GLFWwindow *window)
void(* _GLFWdestroycontextfun)(_GLFWwindow *)
const _GLFWfbconfig * _glfwChooseFBConfig(const _GLFWfbconfig *desired, const _GLFWfbconfig *alternatives, unsigned int count)
void _glfwPlatformSetWindowAspectRatio(_GLFWwindow *window, int numer, int denom)
const char * _glfwPlatformGetClipboardString(void)
void _glfwInputMouseClick(_GLFWwindow *window, int button, int action, int mods)
void _glfwInputWindowCloseRequest(_GLFWwindow *window)
void _glfwPlatformGetCursorPos(_GLFWwindow *window, double *xpos, double *ypos)
#define vkGetInstanceProcAddr
void _glfwPlatformRequestWindowAttention(_GLFWwindow *window)
EGLNativeDisplayType _glfwPlatformGetEGLNativeDisplay(void)
void _glfwPlatformSetWindowTitle(_GLFWwindow *window, const char *title)
void _glfwFreeJoystick(_GLFWjoystick *js)
void _glfwPlatformFocusWindow(_GLFWwindow *window)
void _glfwInputJoystickButton(_GLFWjoystick *js, int button, char value)
float _glfw_fminf(float a, float b)
#define _GLFW_MESSAGE_SIZE
char * _glfw_strdup(const char *source)
GLFWbool _glfwPlatformCreateTls(_GLFWtls *tls)
void _glfwInputWindowFocus(_GLFWwindow *window, GLFWbool focused)
PFN_vkVoidFunction(APIENTRY * PFN_vkGetInstanceProcAddr)(VkInstance, const char *)
void _glfwPlatformSetWindowMousePassthrough(_GLFWwindow *window, GLFWbool enabled)
void _glfwPlatformSetWindowFloating(_GLFWwindow *window, GLFWbool enabled)
@ VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK
@ VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR
@ VK_STRUCTURE_TYPE_MAX_ENUM
@ VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT
@ VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR
@ VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR
@ VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR
#define vkEnumerateInstanceExtensionProperties
GLFWglproc(* _GLFWgetprocaddressfun)(const char *)
_W64 unsigned int uintptr_t
unsigned __int64 uint64_t
PFNGLGETSTRINGPROC GetString
_GLFWswapintervalfun swapInterval
_GLFWswapbuffersfun swapBuffers
PFNGLGETSTRINGIPROC GetStringi
_GLFWdestroycontextfun destroy
PFNGLGETINTEGERVPROC GetIntegerv
_GLFWcontextOSMesa osmesa
_GLFW_PLATFORM_CONTEXT_STATE
_GLFWmakecontextcurrentfun makeCurrent
_GLFWextensionsupportedfun extensionSupported
_GLFWgetprocaddressfun getProcAddress
struct _GLFWctxconfig::@21 nsgl
_GLFW_PLATFORM_CURSOR_STATE
char description[_GLFW_MESSAGE_SIZE]
struct _GLFWinitconfig::@16 ns
GLFWbool xcbVulkanSurface
struct _GLFWinitconfig::@17 x11
_GLFW_PLATFORM_JOYSTICK_STATE
_GLFW_PLATFORM_LIBRARY_CONTEXT_STATE
struct _GLFWlibrary::@26 callbacks
struct _GLFWlibrary::@25 vk
PFN_vkGetInstanceProcAddr GetInstanceProcAddr
_GLFWerror * errorListHead
_GLFWfbconfig framebuffer
struct _GLFWlibrary::@24 timer
_GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE
_GLFWwindow * windowListHead
_GLFWjoystick joysticks[GLFW_JOYSTICK_LAST+1]
_GLFWcursor * cursorListHead
GLFWbool joysticksInitialized
struct _GLFWlibrary::@23 hints
_GLFW_PLATFORM_LIBRARY_WINDOW_STATE
_GLFWlibraryOSMesa osmesa
_GLFW_PLATFORM_LIBRARY_TIMER_STATE
PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties
_GLFWmapelement buttons[15]
GLFWgammaramp originalRamp
GLFWgammaramp currentRamp
_GLFW_PLATFORM_MONITOR_STATE
_GLFW_PLATFORM_MUTEX_STATE
_GLFW_PLATFORM_WINDOW_STATE
GLFWcursorposfun cursorPos
GLFWwindowmaximizefun maximize
struct _GLFWwindow::@22 callbacks
char mouseButtons[GLFW_MOUSE_BUTTON_LAST+1]
GLFWframebuffersizefun fbsize
GLFWbool mousePassthrough
struct _GLFWwindow * next
GLFWbool stickyMouseButtons
GLFWwindowrefreshfun refresh
GLFWwindowiconifyfun iconify
GLFWwindowcontentscalefun scale
char keys[GLFW_KEY_LAST+1]
GLFWmousebuttonfun mouseButton
GLFWcursorenterfun cursorEnter
struct _GLFWwndconfig::@20 win32
struct _GLFWwndconfig::@18 ns
GLFWbool mousePassthrough
struct _GLFWwndconfig::@19 x11
char extensionName[VK_MAX_EXTENSION_NAME_SIZE]