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) \ 276 char instanceName[256];
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);
_GLFW_PLATFORM_CONTEXT_STATE
void _glfwInputScroll(_GLFWwindow *window, double xoffset, double yoffset)
_GLFWswapbuffersfun swapBuffers
_GLFWjoystick * _glfwAllocJoystick(const char *name, const char *guid, int axisCount, int buttonCount, int hatCount)
void(* GLFWwindowiconifyfun)(GLFWwindow *, int)
The function signature for window iconify/restore callbacks.
void _glfwPlatformDestroyTls(_GLFWtls *tls)
GLFWbool _glfwRefreshContextAttribs(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig)
GLFWbool KHR_xlib_surface
GLFWcursorposfun cursorPos
void _glfwPlatformGetWindowSize(_GLFWwindow *window, int *width, int *height)
GLFWgammaramp currentRamp
void _glfwInputJoystickButton(_GLFWjoystick *js, int button, char value)
_GLFWfbconfig framebuffer
void _glfwPlatformDestroyMutex(_GLFWmutex *mutex)
float _glfw_fminf(float a, float b)
void _glfwInputWindowCloseRequest(_GLFWwindow *window)
_GLFW_PLATFORM_CURSOR_STATE
GLFWwindowcontentscalefun scale
int _glfwPlatformCreateWindow(_GLFWwindow *window, const _GLFWwndconfig *wndconfig, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
_GLFWgetprocaddressfun getProcAddress
PFN_vkVoidFunction(APIENTRY * PFN_vkGetInstanceProcAddr)(VkInstance, const char *)
void(* GLFWmonitorfun)(GLFWmonitor *, int)
The function signature for monitor configuration callbacks.
_GLFW_PLATFORM_MUTEX_STATE
void _glfwPlatformPostEmptyEvent(void)
PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties
void(* _GLFWdestroycontextfun)(_GLFWwindow *)
void _glfwPlatformSetWindowSizeLimits(_GLFWwindow *window, int minwidth, int minheight, int maxwidth, int maxheight)
void _glfwAllocGammaArrays(GLFWgammaramp *ramp, unsigned int size)
void(* _GLFWswapintervalfun)(int)
GLFWmousebuttonfun mouseButton
GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig *ctxconfig)
void _glfwInputWindowIconify(_GLFWwindow *window, GLFWbool iconified)
void _glfwInputDrop(_GLFWwindow *window, int count, const char **names)
#define vkGetInstanceProcAddr
_GLFWdestroycontextfun destroy
void _glfwSplitBPP(int bpp, int *red, int *green, int *blue)
float _glfw_fmaxf(float a, float b)
void _glfwInputFramebufferSize(_GLFWwindow *window, int width, int height)
void _glfwPlatformGetFramebufferSize(_GLFWwindow *window, int *width, int *height)
void _glfwPlatformSetWindowAspectRatio(_GLFWwindow *window, int numer, int denom)
uint64_t _glfwPlatformGetTimerValue(void)
_GLFWmonitor * _glfwAllocMonitor(const char *name, int widthMM, int heightMM)
void _glfwInputWindowMaximize(_GLFWwindow *window, GLFWbool maximized)
PFNGLGETSTRINGPROC GetString
uint64_t _glfwPlatformGetTimerFrequency(void)
GLFWcursorenterfun cursorEnter
GLFWframebuffersizefun fbsize
const GLubyte *(APIENTRY * PFNGLGETSTRINGPROC)(GLenum)
const char * _glfwGetVulkanResultString(VkResult result)
void _glfwPlatformGetVideoMode(_GLFWmonitor *monitor, GLFWvidmode *mode)
_GLFWerror * errorListHead
void(APIENTRY * PFNGLGETINTEGERVPROC)(GLenum, GLint *)
void _glfwTerminateVulkan(void)
void _glfwPlatformSetClipboardString(const char *string)
const char * _glfwPlatformGetClipboardString(void)
_GLFWwindow * windowListHead
void _glfwFreeGammaArrays(GLFWgammaramp *ramp)
void _glfwInputWindowDamage(_GLFWwindow *window)
void _glfwPlatformIconifyWindow(_GLFWwindow *window)
#define vkEnumerateInstanceExtensionProperties
void _glfwInputWindowPos(_GLFWwindow *window, int xpos, int ypos)
GLFWbool _glfwPlatformGetGammaRamp(_GLFWmonitor *monitor, GLFWgammaramp *ramp)
struct VkExtensionProperties VkExtensionProperties
GLFWwindowrefreshfun refresh
_GLFWcursor * cursorListHead
void _glfwPlatformSetWindowOpacity(_GLFWwindow *window, float opacity)
char keys[GLFW_KEY_LAST+1]
int _glfwPlatformInit(void)
void _glfwPlatformSetWindowFloating(_GLFWwindow *window, GLFWbool enabled)
void _glfwFreeMonitor(_GLFWmonitor *monitor)
_GLFW_OSMESA_LIBRARY_CONTEXT_STATE
void _glfwInputMouseClick(_GLFWwindow *window, int button, int action, int mods)
void _glfwInputWindowFocus(_GLFWwindow *window, GLFWbool focused)
int _glfwPlatformWindowIconified(_GLFWwindow *window)
int _glfwPlatformFramebufferTransparent(_GLFWwindow *window)
void(* GLFWwindowcontentscalefun)(GLFWwindow *, float, float)
The function signature for window content scale callbacks.
GLFWbool stickyMouseButtons
_GLFW_PLATFORM_WINDOW_STATE
void(* _GLFWswapbuffersfun)(_GLFWwindow *)
void _glfwInputWindowContentScale(_GLFWwindow *window, float xscale, float yscale)
void(* GLFWwindowsizefun)(GLFWwindow *, int, int)
The function signature for window resize callbacks.
PFNGLGETINTEGERVPROC GetIntegerv
void _glfwPlatformSetGammaRamp(_GLFWmonitor *monitor, const GLFWgammaramp *ramp)
PFN_vkGetInstanceProcAddr GetInstanceProcAddr
int _glfwPlatformWindowMaximized(_GLFWwindow *window)
GLFWbool _glfwStringInExtensionString(const char *string, const char *extensions)
void _glfwPlatformShowWindow(_GLFWwindow *window)
void _glfwPlatformFocusWindow(_GLFWwindow *window)
_GLFW_PLATFORM_LIBRARY_WINDOW_STATE
#define GLFW_JOYSTICK_LAST
void _glfwPlatformLockMutex(_GLFWmutex *mutex)
struct _GLFWwindow * next
void(* _GLFWmakecontextcurrentfun)(_GLFWwindow *)
_GLFWmakecontextcurrentfun makeCurrent
void _glfwPlatformGetWindowFrameSize(_GLFWwindow *window, int *left, int *top, int *right, int *bottom)
void _glfwPlatformGetMonitorPos(_GLFWmonitor *monitor, int *xpos, int *ypos)
void(* GLFWframebuffersizefun)(GLFWwindow *, int, int)
The function signature for framebuffer resize callbacks.
void(APIENTRY * PFNGLCLEARPROC)(GLbitfield)
void _glfwPlatformFreeMonitor(_GLFWmonitor *monitor)
void _glfwInputJoystick(_GLFWjoystick *js, int event)
int _glfwPlatformWindowVisible(_GLFWwindow *window)
void _glfwPlatformGetWindowPos(_GLFWwindow *window, int *xpos, int *ypos)
void _glfwPlatformSetCursorPos(_GLFWwindow *window, double xpos, double ypos)
void _glfwInputError(int code, const char *format,...)
void _glfwPlatformUnlockMutex(_GLFWmutex *mutex)
int(* _GLFWextensionsupportedfun)(const char *)
void _glfwPlatformSetWindowIcon(_GLFWwindow *window, int count, const GLFWimage *images)
GLFWbool _glfwPlatformCreateMutex(_GLFWmutex *mutex)
const char * _glfwPlatformGetVersionString(void)
_GLFWextensionsupportedfun extensionSupported
void _glfwInputMonitor(_GLFWmonitor *monitor, int action, int placement)
const _GLFWfbconfig * _glfwChooseFBConfig(const _GLFWfbconfig *desired, const _GLFWfbconfig *alternatives, unsigned int count)
void _glfwInputCursorPos(_GLFWwindow *window, double xpos, double ypos)
GLFWbool _glfwPlatformCreateTls(_GLFWtls *tls)
void _glfwInputJoystickHat(_GLFWjoystick *js, int hat, char value)
void _glfwInputKey(_GLFWwindow *window, int key, int scancode, int action, int mods)
void _glfwPlatformPollEvents(void)
void(* GLFWwindowposfun)(GLFWwindow *, int, int)
The function signature for window position callbacks.
void _glfwPlatformSetWindowResizable(_GLFWwindow *window, GLFWbool enabled)
void _glfwPlatformRestoreWindow(_GLFWwindow *window)
float _glfwPlatformGetWindowOpacity(_GLFWwindow *window)
void _glfwInputWindowSize(_GLFWwindow *window, int width, int height)
const char * _glfwPlatformGetScancodeName(int scancode)
int _glfwCompareVideoModes(const GLFWvidmode *first, const GLFWvidmode *second)
void(APIENTRY * PFN_vkVoidFunction)(void)
void _glfwPlatformSetWindowSize(_GLFWwindow *window, int width, int height)
const GLubyte *(APIENTRY * PFNGLGETSTRINGIPROC)(GLenum, GLuint)
GLFWvidmode * _glfwPlatformGetVideoModes(_GLFWmonitor *monitor, int *count)
void _glfwPlatformGetWindowContentScale(_GLFWwindow *window, float *xscale, float *yscale)
PFNGLGETSTRINGIPROC GetStringi
typedef void(GLAD_API_PTR *GLDEBUGPROC)(GLenum source
void _glfwPlatformWaitEvents(void)
_GLFWswapintervalfun swapInterval
_GLFW_PLATFORM_LIBRARY_CONTEXT_STATE
GLFWgammaramp originalRamp
void _glfwInputWindowMonitor(_GLFWwindow *window, _GLFWmonitor *monitor)
GLFWglproc(* _GLFWgetprocaddressfun)(const char *)
int _glfwPlatformWindowFocused(_GLFWwindow *window)
void _glfwPlatformSetTls(_GLFWtls *tls, void *value)
char * _glfw_strdup(const char *source)
void _glfwInputCursorEnter(_GLFWwindow *window, GLFWbool entered)
_GLFW_PLATFORM_LIBRARY_TIMER_STATE
_GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE
int _glfwPlatformCreateCursor(_GLFWcursor *cursor, const GLFWimage *image, int xhot, int yhot)
_GLFW_PLATFORM_MONITOR_STATE
struct VkAllocationCallbacks VkAllocationCallbacks
void _glfwPlatformWaitEventsTimeout(double timeout)
void _glfwInputChar(_GLFWwindow *window, unsigned int codepoint, int mods, GLFWbool plain)
void _glfwPlatformSetWindowDecorated(_GLFWwindow *window, GLFWbool enabled)
void _glfwPlatformMaximizeWindow(_GLFWwindow *window)
void _glfwPlatformGetRequiredInstanceExtensions(char **extensions)
void _glfwPlatformGetCursorPos(_GLFWwindow *window, double *xpos, double *ypos)
void _glfwPlatformTerminate(void)
void _glfwInputMonitorWindow(_GLFWmonitor *monitor, _GLFWwindow *window)
void _glfwInputJoystickAxis(_GLFWjoystick *js, int axis, float value)
void(* GLFWwindowclosefun)(GLFWwindow *)
The function signature for window close callbacks.
int _glfwPlatformWindowHovered(_GLFWwindow *window)
int _glfwPlatformGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily)
void _glfwPlatformSetCursorMode(_GLFWwindow *window, int mode)
GLFWbool _glfwInitVulkan(int mode)
void * _glfwPlatformGetTls(_GLFWtls *tls)
_GLFW_PLATFORM_JOYSTICK_STATE
_GLFW_OSMESA_CONTEXT_STATE
int _glfwPlatformCreateStandardCursor(_GLFWcursor *cursor, int shape)
char mouseButtons[GLFW_MOUSE_BUTTON_LAST+1]
void _glfwPlatformDestroyWindow(_GLFWwindow *window)
int _glfwPlatformPollJoystick(_GLFWjoystick *js, int mode)
VkResult(APIENTRY * PFN_vkEnumerateInstanceExtensionProperties)(const char *, uint32_t *, VkExtensionProperties *)
void _glfwPlatformRequestWindowAttention(_GLFWwindow *window)
#define _GLFW_MESSAGE_SIZE
void(* GLFWwindowmaximizefun)(GLFWwindow *, int)
The function signature for window maximize/restore callbacks.
void _glfwPlatformGetMonitorContentScale(_GLFWmonitor *monitor, float *xscale, float *yscale)
VkResult _glfwPlatformCreateWindowSurface(VkInstance instance, _GLFWwindow *window, const VkAllocationCallbacks *allocator, VkSurfaceKHR *surface)
void _glfwPlatformSetWindowTitle(_GLFWwindow *window, const char *title)
void _glfwPlatformHideWindow(_GLFWwindow *window)
const GLFWvidmode * _glfwChooseVideoMode(_GLFWmonitor *monitor, const GLFWvidmode *desired)
void _glfwPlatformSetWindowPos(_GLFWwindow *window, int xpos, int ypos)
void _glfwPlatformUpdateGamepadGUID(char *guid)
GLFWwindowmaximizefun maximize
GLFWwindowiconifyfun iconify
void _glfwFreeJoystick(_GLFWjoystick *js)
void _glfwPlatformSetCursor(_GLFWwindow *window, _GLFWcursor *cursor)
void _glfwPlatformDestroyCursor(_GLFWcursor *cursor)
void(* GLFWwindowrefreshfun)(GLFWwindow *)
The function signature for window content refresh callbacks.
void(* GLFWglproc)(void)
Client API function pointer type.
_GLFW_EGL_LIBRARY_CONTEXT_STATE
int _glfwPlatformGetKeyScancode(int key)
void _glfwPlatformSetWindowMonitor(_GLFWwindow *window, _GLFWmonitor *monitor, int xpos, int ypos, int width, int height, int refreshRate)
void(* GLFWwindowfocusfun)(GLFWwindow *, int)
The function signature for window focus/defocus callbacks.