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 172 #if defined(_GLFW_VULKAN_STATIC) 178 #define vkEnumerateInstanceExtensionProperties _glfw.vk.EnumerateInstanceExtensionProperties 179 #define vkGetInstanceProcAddr _glfw.vk.GetInstanceProcAddr 182 #if defined(_GLFW_COCOA) 184 #elif defined(_GLFW_WIN32) 186 #elif defined(_GLFW_X11) 188 #elif defined(_GLFW_WAYLAND) 190 #elif defined(_GLFW_OSMESA) 193 #error "No supported window creation API selected" 197 #define _GLFW_CONCAT_VERSION(m, n, r) #m "." #n "." #r 198 #define _GLFW_MAKE_VERSION(m, n, r) _GLFW_CONCAT_VERSION(m, n, r) 199 #define _GLFW_VERSION_NUMBER _GLFW_MAKE_VERSION(GLFW_VERSION_MAJOR, \ 200 GLFW_VERSION_MINOR, \ 201 GLFW_VERSION_REVISION) 204 #define _GLFW_REQUIRE_INIT() \ 205 if (!_glfw.initialized) \ 207 _glfwInputError(GLFW_NOT_INITIALIZED, NULL); \ 210 #define _GLFW_REQUIRE_INIT_OR_RETURN(x) \ 211 if (!_glfw.initialized) \ 213 _glfwInputError(GLFW_NOT_INITIALIZED, NULL); \ 218 #define _GLFW_SWAP_POINTERS(x, y) \ 275 char instanceName[256];
549 #if !defined(_GLFW_VULKAN_STATIC) 554 #if defined(_GLFW_WIN32) 556 #elif defined(_GLFW_COCOA) 558 #elif defined(_GLFW_X11) 561 #elif defined(_GLFW_WAYLAND) 611 float* xscale,
float* yscale);
639 int minwidth,
int minheight,
640 int maxwidth,
int maxheight);
647 float* xscale,
float* yscale);
704 float xscale,
float yscale);
712 int key,
int scancode,
int action,
int mods);
714 unsigned int codepoint,
int mods,
GLFWbool plain);
728 #if defined(__GNUC__) 730 __attribute__((format(printf, 2, 3)));
_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)
GLFWcursorposfun cursorPos
void _glfwPlatformGetWindowSize(_GLFWwindow *window, int *width, int *height)
GLFWgammaramp currentRamp
void _glfwInputJoystickButton(_GLFWjoystick *js, int button, char value)
typedef void(APIENTRY *GLDEBUGPROC)(GLenum source
GLuint const GLchar * name
_GLFWfbconfig framebuffer
void _glfwPlatformDestroyMutex(_GLFWmutex *mutex)
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.
GLdouble GLdouble GLdouble top
_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)
def axes(out, pos, rotation=np.eye(3), size=0.075, thickness=2)
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)
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)
GLenum GLenum GLsizei void * image
void _glfwPlatformIconifyWindow(_GLFWwindow *window)
#define vkEnumerateInstanceExtensionProperties
void _glfwInputWindowPos(_GLFWwindow *window, int xpos, int ypos)
void _glfwPlatformGetGammaRamp(_GLFWmonitor *monitor, GLFWgammaramp *ramp)
struct VkExtensionProperties VkExtensionProperties
GLFWwindowrefreshfun refresh
_GLFWcursor * cursorListHead
void _glfwPlatformSetWindowOpacity(_GLFWwindow *window, float opacity)
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
_W64 unsigned int uintptr_t
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)
GLint GLsizei GLsizei height
GLFWbool _glfwStringInExtensionString(const char *string, const char *extensions)
void _glfwPlatformShowWindow(_GLFWwindow *window)
void _glfwPlatformFocusWindow(_GLFWwindow *window)
_GLFW_PLATFORM_LIBRARY_WINDOW_STATE
GLint GLint GLsizei GLint GLenum format
#define GLFW_JOYSTICK_LAST
void _glfwPlatformLockMutex(_GLFWmutex *mutex)
struct _GLFWwindow * next
void(* _GLFWmakecontextcurrentfun)(_GLFWwindow *)
T && forward(typename::boost::move_detail::remove_reference< T >::type &t) BOOST_NOEXCEPT
unsigned __int64 uint64_t
_GLFWmakecontextcurrentfun makeCurrent
void _glfwPlatformGetWindowFrameSize(_GLFWwindow *window, int *left, int *top, int *right, int *bottom)
void _glfwPlatformGetMonitorPos(_GLFWmonitor *monitor, int *xpos, int *ypos)
GLenum GLenum GLsizei const GLuint GLboolean enabled
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
void _glfwPlatformWaitEvents(void)
_GLFWswapintervalfun swapInterval
char extensionName[VK_MAX_EXTENSION_NAME_SIZE]
_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)
static int joysticks[GLFW_JOYSTICK_LAST+1]
_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
void _glfwPlatformWaitEventsTimeout(double timeout)
GLint GLint GLint yoffset
void _glfwInputChar(_GLFWwindow *window, unsigned int codepoint, int mods, GLFWbool plain)
GLbitfield GLuint64 timeout
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)
static const char * maximized
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
GLsizei GLsizei GLchar * source
_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.
_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.