167 if (width <= 0 || height <= 0)
170 "Invalid window size %ix%i",
182 wndconfig.
title = title;
468 while (*prev != window)
469 prev = &((*prev)->next);
471 *prev = window->
next;
574 int minwidth,
int minheight,
575 int maxwidth,
int maxheight)
584 if (minwidth < 0 || minheight < 0)
587 "Invalid window minimum size %ix%i",
588 minwidth, minheight);
595 if (maxwidth < 0 || maxheight < 0 ||
596 maxwidth < minwidth || maxheight < minheight)
599 "Invalid window maximum size %ix%i",
600 maxwidth, maxheight);
615 maxwidth, maxheight);
629 if (numer <= 0 || denom <= 0)
632 "Invalid window aspect ratio %i:%i",
638 window->
numer = numer;
639 window->
denom = denom;
682 float* xscale,
float* yscale)
709 assert(opacity == opacity);
715 if (opacity != opacity || opacity < 0.f || opacity > 1.
f)
930 if (width <= 0 || height <= 0)
933 "Invalid window size %ix%i",
941 "Invalid refresh rate %i",
951 xpos, ypos, width, height,
1091 assert(timeout == timeout);
1093 assert(timeout <= DBL_MAX);
GLFWAPI void glfwSetWindowAspectRatio(GLFWwindow *handle, int numer, int denom)
Sets the aspect ratio of the specified window.
void(* GLFWwindowiconifyfun)(GLFWwindow *, int)
The function signature for window iconify/restore callbacks.
#define GLFW_AUTO_ICONIFY
Window auto-iconification window hint and attribute.
#define GLFW_CONTEXT_RELEASE_BEHAVIOR
Context flush-on-release hint and attribute.
void _glfwInputWindowMonitor(_GLFWwindow *window, _GLFWmonitor *monitor)
GLFWAPI void glfwFocusWindow(GLFWwindow *handle)
Brings the specified window to front and sets input focus.
GLFWAPI void glfwGetWindowSize(GLFWwindow *handle, int *width, int *height)
Retrieves the size of the client area of the specified window.
GLenum GLsizei const void * pointer
void _glfwPlatformGetWindowSize(_GLFWwindow *window, int *width, int *height)
_GLFWfbconfig framebuffer
GLFWAPI int glfwGetWindowAttrib(GLFWwindow *handle, int attrib)
Returns an attribute of the specified window.
GLFWwindowcontentscalefun scale
int _glfwPlatformCreateWindow(_GLFWwindow *window, const _GLFWwndconfig *wndconfig, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
GLFWAPI void glfwSetWindowTitle(GLFWwindow *handle, const char *title)
Sets the title of the specified window.
GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow *handle, GLFWwindowsizefun cbfun)
Sets the size callback for the specified window.
GLdouble GLdouble GLdouble top
#define GLFW_CONTEXT_ROBUSTNESS
Context robustness hint and attribute.
void _glfwPlatformPostEmptyEvent(void)
GLFWAPI void glfwSetWindowSizeLimits(GLFWwindow *handle, int minwidth, int minheight, int maxwidth, int maxheight)
Sets the size limits of the specified window.
#define _GLFW_REQUIRE_INIT()
void _glfwPlatformSetWindowSizeLimits(_GLFWwindow *window, int minwidth, int minheight, int maxwidth, int maxheight)
GLFWAPI void glfwHideWindow(GLFWwindow *handle)
Hides the specified window.
static GLFWwindow * window
#define GLFW_OPENGL_FORWARD_COMPAT
OpenGL forward-compatibility hint and attribute.
GLFWAPI void glfwSetWindowAttrib(GLFWwindow *handle, int attrib, int value)
Sets an attribute of the specified window.
GLuint64 GLenum void * handle
#define GLFW_ICONIFIED
Window iconification window attribute.
#define GLFW_ACCUM_GREEN_BITS
Framebuffer bit depth hint.
void _glfwInputWindowFocus(_GLFWwindow *window, GLFWbool focused)
void _glfwInputWindowSize(_GLFWwindow *window, int width, int height)
GLFWAPI void * glfwGetWindowUserPointer(GLFWwindow *handle)
Returns the user pointer of the specified window.
#define GLFW_CONTEXT_VERSION_MAJOR
Context client API major version hint and attribute.
void _glfwPlatformGetFramebufferSize(_GLFWwindow *window, int *width, int *height)
void _glfwPlatformSetWindowAspectRatio(_GLFWwindow *window, int numer, int denom)
struct GLFWmonitor GLFWmonitor
GLFWAPI float glfwGetWindowOpacity(GLFWwindow *handle)
Returns the opacity of the whole window.
void _glfwInputWindowCloseRequest(_GLFWwindow *window)
GLFWAPI void glfwPostEmptyEvent(void)
Posts an empty event to the event queue.
struct _GLFWwindow::@26 callbacks
#define GLFW_REFRESH_RATE
Monitor refresh rate hint.
#define GLFW_X11_CLASS_NAME
GLFWframebuffersizefun fbsize
void _glfwInputWindowPos(_GLFWwindow *window, int x, int y)
GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow *handle, GLFWframebuffersizefun cbfun)
Sets the framebuffer resize callback for the specified window.
void _glfwInputWindowContentScale(_GLFWwindow *window, float xscale, float yscale)
#define GLFW_OPENGL_PROFILE
OpenGL profile hint and attribute.
void _glfwInputWindowMaximize(_GLFWwindow *window, GLFWbool maximized)
_GLFWwindow * windowListHead
#define GLFW_TRANSPARENT_FRAMEBUFFER
Window framebuffer transparency hint and attribute.
#define GLFW_CONTEXT_CREATION_API
Context creation API hint and attribute.
#define GLFW_HOVERED
Mouse cursor hover window attribute.
void _glfwPlatformIconifyWindow(_GLFWwindow *window)
#define GLFW_SCALE_TO_MONITOR
Window content area scaling window window hint.
#define GLFW_OPENGL_DEBUG_CONTEXT
OpenGL debug context hint and attribute.
GLFWbool _glfwRefreshContextAttribs(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig)
#define GLFW_COCOA_RETINA_FRAMEBUFFER
GLFWwindowrefreshfun refresh
#define _GLFW_SWAP_POINTERS(x, y)
GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow *handle, GLFWwindowiconifyfun cbfun)
Sets the iconify callback for the specified window.
void _glfwPlatformSetWindowOpacity(_GLFWwindow *window, float opacity)
#define GLFW_RED_BITS
Framebuffer bit depth hint.
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
char keys[GLFW_KEY_LAST+1]
GLFWAPI void glfwSetWindowUserPointer(GLFWwindow *handle, void *pointer)
Sets the user pointer of the specified window.
GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig *ctxconfig)
void _glfwPlatformSetWindowFloating(_GLFWwindow *window, GLFWbool enabled)
#define GLFW_ALPHA_BITS
Framebuffer bit depth hint.
#define GLFW_FLOATING
Window decoration window hint and attribute.
#define GLFW_CURSOR_NORMAL
#define GLFW_NATIVE_CONTEXT_API
#define GLFW_CONTEXT_NO_ERROR
Context error suppression hint and attribute.
GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow *handle, GLFWwindowrefreshfun cbfun)
Sets the refresh callback for the specified window.
struct _GLFWlibrary::@27 hints
#define GLFW_STENCIL_BITS
Framebuffer bit depth hint.
int _glfwPlatformWindowIconified(_GLFWwindow *window)
int _glfwPlatformFramebufferTransparent(_GLFWwindow *window)
void(* GLFWwindowcontentscalefun)(GLFWwindow *, float, float)
The function signature for window content scale callbacks.
void _glfwInputWindowIconify(_GLFWwindow *window, GLFWbool iconified)
void _glfwInputWindowDamage(_GLFWwindow *window)
GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow *handle, GLFWwindowposfun cbfun)
Sets the position callback for the specified window.
void(* GLFWwindowsizefun)(GLFWwindow *, int, int)
The function signature for window resize callbacks.
GLFWAPI void glfwIconifyWindow(GLFWwindow *handle)
Iconifies the specified window.
int _glfwPlatformWindowMaximized(_GLFWwindow *window)
#define GLFW_ACCUM_ALPHA_BITS
Framebuffer bit depth hint.
GLFWAPI void glfwGetWindowContentScale(GLFWwindow *handle, float *xscale, float *yscale)
Retrieves the content scale for the specified window.
GLint GLsizei GLsizei height
void glfwDefaultWindowHints(void)
Resets all window hints to their default values.
void _glfwPlatformShowWindow(_GLFWwindow *window)
void _glfwPlatformFocusWindow(_GLFWwindow *window)
GLFWAPI void glfwMakeContextCurrent(GLFWwindow *window)
Makes the context of the specified window current for the calling thread.
struct _GLFWwindow * next
#define GLFW_COCOA_FRAME_NAME
GLFWAPI void glfwGetWindowFrameSize(GLFWwindow *handle, int *left, int *top, int *right, int *bottom)
Retrieves the size of the frame of the window.
GLFWAPI void glfwMaximizeWindow(GLFWwindow *handle)
Maximizes the specified window.
void _glfwPlatformGetWindowFrameSize(_GLFWwindow *window, int *left, int *top, int *right, int *bottom)
void(* GLFWframebuffersizefun)(GLFWwindow *, int, int)
The function signature for framebuffer resize callbacks.
int _glfwPlatformWindowVisible(_GLFWwindow *window)
void _glfwPlatformGetWindowPos(_GLFWwindow *window, int *xpos, int *ypos)
GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow *handle, GLFWwindowfocusfun cbfun)
Sets the focus callback for the specified window.
void _glfwPlatformSetCursorPos(_GLFWwindow *window, double xpos, double ypos)
#define GLFW_AUX_BUFFERS
Framebuffer auxiliary buffer hint.
#define GLFW_CENTER_CURSOR
Cursor centering window hint.
#define GLFW_ACCUM_RED_BITS
Framebuffer bit depth hint.
#define GLFW_GREEN_BITS
Framebuffer bit depth hint.
void _glfwPlatformSetWindowIcon(_GLFWwindow *window, int count, const GLFWimage *images)
void _glfwInputError(int code, const char *format,...)
struct _GLFWwndconfig::@23 ns
#define GLFW_RESIZABLE
Window resize-ability window hint and attribute.
void _glfwPlatformPollEvents(void)
void(* GLFWwindowposfun)(GLFWwindow *, int, int)
The function signature for window position callbacks.
GLFWAPI GLFWmonitor * glfwGetWindowMonitor(GLFWwindow *handle)
Returns the monitor that the window uses for full screen mode.
void _glfwPlatformSetWindowResizable(_GLFWwindow *window, GLFWbool enabled)
void _glfwPlatformRestoreWindow(_GLFWwindow *window)
GLFWAPI void glfwSetWindowSize(GLFWwindow *handle, int width, int height)
Sets the size of the client area of the specified window.
float _glfwPlatformGetWindowOpacity(_GLFWwindow *window)
GLFWAPI void glfwSetWindowPos(GLFWwindow *handle, int xpos, int ypos)
Sets the position of the client area of the specified window.
void _glfwPlatformSetWindowSize(_GLFWwindow *window, int width, int height)
#define GLFW_FOCUSED
Input focus window hint and attribute.
GLFWAPI void glfwSetWindowShouldClose(GLFWwindow *handle, int value)
Sets the close flag of the specified window.
GLFWAPI void glfwWaitEvents(void)
Waits until events are queued and processes them.
void _glfwPlatformGetWindowContentScale(_GLFWwindow *window, float *xscale, float *yscale)
void _glfwPlatformWaitEvents(void)
#define GLFW_STEREO
OpenGL stereoscopic rendering hint.
GLFWAPI GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(GLFWwindow *handle, GLFWwindowcontentscalefun cbfun)
Sets the window content scale callback for the specified window.
GLFWAPI void glfwSetWindowMonitor(GLFWwindow *wh, GLFWmonitor *mh, int xpos, int ypos, int width, int height, int refreshRate)
Sets the mode, monitor, video mode and placement of a window.
GLFWAPI GLFWwindow * glfwCreateWindow(int width, int height, const char *title, GLFWmonitor *monitor, GLFWwindow *share)
Creates a window and its associated context.
GLFWAPI void glfwWaitEventsTimeout(double timeout)
Waits with timeout until events are queued and processes them.
#define GLFW_INVALID_ENUM
One of the arguments to the function was an invalid enum value.
int _glfwPlatformWindowFocused(_GLFWwindow *window)
#define GLFW_INVALID_VALUE
One of the arguments to the function was an invalid value.
#define GLFW_FOCUS_ON_SHOW
Input focus on calling show window hint and attribute.
void _glfwInputFramebufferSize(_GLFWwindow *window, int width, int height)
GLFWAPI void glfwSetWindowOpacity(GLFWwindow *handle, float opacity)
Sets the opacity of the whole window.
#define GLFW_DOUBLEBUFFER
Framebuffer double buffering hint.
#define GLFW_SRGB_CAPABLE
Framebuffer sRGB hint.
void _glfwPlatformWaitEventsTimeout(double timeout)
#define GLFW_MAXIMIZED
Window maximization window hint and attribute.
GLFWAPI void glfwGetWindowPos(GLFWwindow *handle, int *xpos, int *ypos)
Retrieves the position of the client area of the specified window.
GLFWAPI void glfwRequestWindowAttention(GLFWwindow *handle)
Requests user attention to the specified window.
GLbitfield GLuint64 timeout
void _glfwPlatformSetWindowDecorated(_GLFWwindow *window, GLFWbool enabled)
void _glfwPlatformMaximizeWindow(_GLFWwindow *window)
#define GLFW_CONTEXT_REVISION
Context client API revision number hint and attribute.
GLFWAPI void glfwDestroyWindow(GLFWwindow *handle)
Destroys the specified window and its context.
GLFWAPI void glfwGetFramebufferSize(GLFWwindow *handle, int *width, int *height)
Retrieves the size of the framebuffer of the specified window.
static const char * maximized
GLFWAPI void glfwShowWindow(GLFWwindow *handle)
Makes the specified window visible.
GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow *handle, GLFWwindowclosefun cbfun)
Sets the close callback for the specified window.
void(* GLFWwindowclosefun)(GLFWwindow *)
The function signature for window close callbacks.
int _glfwPlatformWindowHovered(_GLFWwindow *window)
#define GLFW_X11_INSTANCE_NAME
#define GLFW_VISIBLE
Window visibility window hint and attribute.
struct _GLFWctxconfig::@25 nsgl
#define GLFW_SAMPLES
Framebuffer MSAA samples hint.
void * _glfwPlatformGetTls(_GLFWtls *tls)
GLFWAPI void glfwPollEvents(void)
Processes all pending events.
char mouseButtons[GLFW_MOUSE_BUTTON_LAST+1]
#define GLFW_ACCUM_BLUE_BITS
Framebuffer bit depth hint.
void _glfwPlatformDestroyWindow(_GLFWwindow *window)
#define GLFW_BLUE_BITS
Framebuffer bit depth hint.
void _glfwPlatformRequestWindowAttention(_GLFWwindow *window)
void(* GLFWwindowmaximizefun)(GLFWwindow *, int)
The function signature for window maximize/restore callbacks.
void _glfwPlatformSetWindowTitle(_GLFWwindow *window, const char *title)
#define GLFW_CONTEXT_VERSION_MINOR
Context client API minor version hint and attribute.
#define GLFW_DECORATED
Window decoration window hint and attribute.
void _glfwPlatformHideWindow(_GLFWwindow *window)
GLFWAPI void glfwWindowHintString(int hint, const char *value)
Sets the specified window hint to the desired value.
GLFWAPI void glfwRestoreWindow(GLFWwindow *handle)
Restores the specified window.
void _glfwPlatformSetWindowPos(_GLFWwindow *window, int xpos, int ypos)
#define GLFW_COCOA_GRAPHICS_SWITCHING
GLFWwindowmaximizefun maximize
GLFWwindowiconifyfun iconify
struct _GLFWwndconfig::@24 x11
void(* GLFWwindowrefreshfun)(GLFWwindow *)
The function signature for window content refresh callbacks.
struct GLFWwindow GLFWwindow
GLFWAPI void glfwWindowHint(int hint, int value)
Sets the specified window hint to the desired value.
GLFWAPI void glfwSetWindowIcon(GLFWwindow *handle, int count, const GLFWimage *images)
Sets the icon for the specified window.
#define GLFW_CLIENT_API
Context client API hint and attribute.
GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow *handle, GLFWwindowmaximizefun cbfun)
Sets the maximize callback for the specified window.
int _glfwPlatformGetKeyScancode(int key)
void _glfwPlatformSetWindowMonitor(_GLFWwindow *window, _GLFWmonitor *monitor, int xpos, int ypos, int width, int height, int refreshRate)
#define GLFW_DEPTH_BITS
Framebuffer bit depth hint.
void(* GLFWwindowfocusfun)(GLFWwindow *, int)
The function signature for window focus/defocus callbacks.
GLFWAPI int glfwWindowShouldClose(GLFWwindow *handle)
Checks the close flag of the specified window.