window.c
Go to the documentation of this file.
1 //========================================================================
2 // GLFW 3.1 - www.glfw.org
3 //------------------------------------------------------------------------
4 // Copyright (c) 2002-2006 Marcus Geelnard
5 // Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
6 // Copyright (c) 2012 Torsten Walluhn <tw@mad-cad.net>
7 //
8 // This software is provided 'as-is', without any express or implied
9 // warranty. In no event will the authors be held liable for any damages
10 // arising from the use of this software.
11 //
12 // Permission is granted to anyone to use this software for any purpose,
13 // including commercial applications, and to alter it and redistribute it
14 // freely, subject to the following restrictions:
15 //
16 // 1. The origin of this software must not be misrepresented; you must not
17 // claim that you wrote the original software. If you use this software
18 // in a product, an acknowledgment in the product documentation would
19 // be appreciated but is not required.
20 //
21 // 2. Altered source versions must be plainly marked as such, and must not
22 // be misrepresented as being the original software.
23 //
24 // 3. This notice may not be removed or altered from any source
25 // distribution.
26 //
27 //========================================================================
28 
29 #include "internal.h"
30 
31 #include <string.h>
32 #include <stdlib.h>
33 
34 
38 
40 {
41  if (focused)
42  {
43  _glfw.cursorWindow = window;
44 
45  if (window->callbacks.focus)
46  window->callbacks.focus((GLFWwindow*) window, focused);
47  }
48  else
49  {
50  int i;
51 
52  _glfw.cursorWindow = NULL;
53 
54  if (window->callbacks.focus)
55  window->callbacks.focus((GLFWwindow*) window, focused);
56 
57  // Release all pressed keyboard keys
58  for (i = 0; i <= GLFW_KEY_LAST; i++)
59  {
60  if (window->keys[i] == GLFW_PRESS)
61  _glfwInputKey(window, i, 0, GLFW_RELEASE, 0);
62  }
63 
64  // Release all pressed mouse buttons
65  for (i = 0; i <= GLFW_MOUSE_BUTTON_LAST; i++)
66  {
67  if (window->mouseButtons[i] == GLFW_PRESS)
68  _glfwInputMouseClick(window, i, GLFW_RELEASE, 0);
69  }
70  }
71 }
72 
73 void _glfwInputWindowPos(_GLFWwindow* window, int x, int y)
74 {
75  if (window->callbacks.pos)
76  window->callbacks.pos((GLFWwindow*) window, x, y);
77 }
78 
80 {
81  if (window->callbacks.size)
82  window->callbacks.size((GLFWwindow*) window, width, height);
83 }
84 
85 void _glfwInputWindowIconify(_GLFWwindow* window, int iconified)
86 {
87  if (window->callbacks.iconify)
88  window->callbacks.iconify((GLFWwindow*) window, iconified);
89 }
90 
92 {
93  if (window->callbacks.fbsize)
94  window->callbacks.fbsize((GLFWwindow*) window, width, height);
95 }
96 
98 {
99  if (window->callbacks.refresh)
100  window->callbacks.refresh((GLFWwindow*) window);
101 }
102 
104 {
105  window->closed = GL_TRUE;
106 
107  if (window->callbacks.close)
108  window->callbacks.close((GLFWwindow*) window);
109 }
110 
111 
115 
117  const char* title,
118  GLFWmonitor* monitor,
119  GLFWwindow* share)
120 {
121  _GLFWfbconfig fbconfig;
122  _GLFWctxconfig ctxconfig;
123  _GLFWwndconfig wndconfig;
124  _GLFWwindow* window;
125  _GLFWwindow* previous;
126 
128 
129  if (width <= 0 || height <= 0)
130  {
131  _glfwInputError(GLFW_INVALID_VALUE, "Invalid window size");
132  return NULL;
133  }
134 
135  fbconfig = _glfw.hints.framebuffer;
136  ctxconfig = _glfw.hints.context;
137  wndconfig = _glfw.hints.window;
138 
139  wndconfig.width = width;
140  wndconfig.height = height;
141  wndconfig.title = title;
142  wndconfig.monitor = (_GLFWmonitor*) monitor;
143  ctxconfig.share = (_GLFWwindow*) share;
144 
145  if (wndconfig.monitor)
146  {
147  wndconfig.resizable = GL_TRUE;
148  wndconfig.visible = GL_TRUE;
149  wndconfig.focused = GL_TRUE;
150  }
151 
152  // Check the OpenGL bits of the window config
153  if (!_glfwIsValidContextConfig(&ctxconfig))
154  return NULL;
155 
156  window = calloc(1, sizeof(_GLFWwindow));
157  window->next = _glfw.windowListHead;
158  _glfw.windowListHead = window;
159 
160  window->videoMode.width = width;
161  window->videoMode.height = height;
162  window->videoMode.redBits = fbconfig.redBits;
163  window->videoMode.greenBits = fbconfig.greenBits;
164  window->videoMode.blueBits = fbconfig.blueBits;
166 
167  window->monitor = wndconfig.monitor;
168  window->resizable = wndconfig.resizable;
169  window->decorated = wndconfig.decorated;
170  window->autoIconify = wndconfig.autoIconify;
171  window->floating = wndconfig.floating;
172  window->cursorMode = GLFW_CURSOR_NORMAL;
173 
174  // Save the currently current context so it can be restored later
175  previous = _glfwPlatformGetCurrentContext();
176 
177  // Open the actual window and create its context
178  if (!_glfwPlatformCreateWindow(window, &wndconfig, &ctxconfig, &fbconfig))
179  {
180  glfwDestroyWindow((GLFWwindow*) window);
182  return NULL;
183  }
184 
186 
187  // Retrieve the actual (as opposed to requested) context attributes
188  if (!_glfwRefreshContextAttribs(&ctxconfig))
189  {
190  glfwDestroyWindow((GLFWwindow*) window);
192  return NULL;
193  }
194 
195  // Verify the context against the requested parameters
196  if (!_glfwIsValidContext(&ctxconfig))
197  {
198  glfwDestroyWindow((GLFWwindow*) window);
200  return NULL;
201  }
202 
203  // Clearing the front buffer to black to avoid garbage pixels left over
204  // from previous uses of our bit of VRAM
205  window->Clear(GL_COLOR_BUFFER_BIT);
206  _glfwPlatformSwapBuffers(window);
207 
208  // Restore the previously current context (or NULL)
210 
211  if (wndconfig.monitor)
212  {
213  int width, height;
214  _glfwPlatformGetWindowSize(window, &width, &height);
215 
216  window->cursorPosX = width / 2;
217  window->cursorPosY = height / 2;
218 
219  _glfwPlatformSetCursorPos(window, window->cursorPosX, window->cursorPosY);
220  }
221  else
222  {
223  if (wndconfig.visible)
224  {
225  if (wndconfig.focused)
226  _glfwPlatformShowWindow(window);
227  else
229  }
230  }
231 
232  return (GLFWwindow*) window;
233 }
234 
236 {
238 
239  memset(&_glfw.hints, 0, sizeof(_glfw.hints));
240 
241  // The default is OpenGL with minimum version 1.0
243  _glfw.hints.context.major = 1;
244  _glfw.hints.context.minor = 0;
245 
246  // The default is a focused, visible, resizable window with decorations
247  _glfw.hints.window.resizable = GL_TRUE;
248  _glfw.hints.window.visible = GL_TRUE;
249  _glfw.hints.window.decorated = GL_TRUE;
250  _glfw.hints.window.focused = GL_TRUE;
251  _glfw.hints.window.autoIconify = GL_TRUE;
252 
253  // The default is 24 bits of color, 24 bits of depth and 8 bits of stencil,
254  // double buffered
262 
263  // The default is to select the highest available refresh rate
265 }
266 
267 GLFWAPI void glfwWindowHint(int target, int hint)
268 {
270 
271  switch (target)
272  {
273  case GLFW_RED_BITS:
275  break;
276  case GLFW_GREEN_BITS:
278  break;
279  case GLFW_BLUE_BITS:
281  break;
282  case GLFW_ALPHA_BITS:
284  break;
285  case GLFW_DEPTH_BITS:
287  break;
288  case GLFW_STENCIL_BITS:
290  break;
291  case GLFW_ACCUM_RED_BITS:
293  break;
296  break;
299  break;
302  break;
303  case GLFW_AUX_BUFFERS:
305  break;
306  case GLFW_STEREO:
307  _glfw.hints.framebuffer.stereo = hint ? GL_TRUE : GL_FALSE;
308  break;
309  case GLFW_DOUBLEBUFFER:
310  _glfw.hints.framebuffer.doublebuffer = hint ? GL_TRUE : GL_FALSE;
311  break;
312  case GLFW_SAMPLES:
314  break;
315  case GLFW_SRGB_CAPABLE:
316  _glfw.hints.framebuffer.sRGB = hint ? GL_TRUE : GL_FALSE;
317  break;
318  case GLFW_RESIZABLE:
319  _glfw.hints.window.resizable = hint ? GL_TRUE : GL_FALSE;
320  break;
321  case GLFW_DECORATED:
322  _glfw.hints.window.decorated = hint ? GL_TRUE : GL_FALSE;
323  break;
324  case GLFW_FOCUSED:
325  _glfw.hints.window.focused = hint ? GL_TRUE : GL_FALSE;
326  break;
327  case GLFW_AUTO_ICONIFY:
328  _glfw.hints.window.autoIconify = hint ? GL_TRUE : GL_FALSE;
329  break;
330  case GLFW_FLOATING:
331  _glfw.hints.window.floating = hint ? GL_TRUE : GL_FALSE;
332  break;
333  case GLFW_VISIBLE:
334  _glfw.hints.window.visible = hint ? GL_TRUE : GL_FALSE;
335  break;
336  case GLFW_CLIENT_API:
337  _glfw.hints.context.api = hint;
338  break;
340  _glfw.hints.context.major = hint;
341  break;
343  _glfw.hints.context.minor = hint;
344  break;
346  _glfw.hints.context.robustness = hint;
347  break;
349  _glfw.hints.context.forward = hint ? GL_TRUE : GL_FALSE;
350  break;
352  _glfw.hints.context.debug = hint ? GL_TRUE : GL_FALSE;
353  break;
354  case GLFW_OPENGL_PROFILE:
355  _glfw.hints.context.profile = hint;
356  break;
358  _glfw.hints.context.release = hint;
359  break;
360  case GLFW_REFRESH_RATE:
361  _glfw.hints.refreshRate = hint;
362  break;
363  default:
364  _glfwInputError(GLFW_INVALID_ENUM, "Invalid window hint");
365  break;
366  }
367 }
368 
370 {
371  _GLFWwindow* window = (_GLFWwindow*) handle;
372 
374 
375  // Allow closing of NULL (to match the behavior of free)
376  if (window == NULL)
377  return;
378 
379  // Clear all callbacks to avoid exposing a half torn-down window object
380  memset(&window->callbacks, 0, sizeof(window->callbacks));
381 
382  // The window's context must not be current on another thread when the
383  // window is destroyed
384  if (window == _glfwPlatformGetCurrentContext())
386 
387  // Clear the focused window pointer if this is the focused window
388  if (_glfw.cursorWindow == window)
389  _glfw.cursorWindow = NULL;
390 
392 
393  // Unlink window from global linked list
394  {
395  _GLFWwindow** prev = &_glfw.windowListHead;
396 
397  while (*prev != window)
398  prev = &((*prev)->next);
399 
400  *prev = window->next;
401  }
402 
403  free(window);
404 }
405 
407 {
408  _GLFWwindow* window = (_GLFWwindow*) handle;
410  return window->closed;
411 }
412 
414 {
415  _GLFWwindow* window = (_GLFWwindow*) handle;
417  window->closed = value;
418 }
419 
420 GLFWAPI void glfwSetWindowTitle(GLFWwindow* handle, const char* title)
421 {
422  _GLFWwindow* window = (_GLFWwindow*) handle;
424  _glfwPlatformSetWindowTitle(window, title);
425 }
426 
427 GLFWAPI void glfwGetWindowPos(GLFWwindow* handle, int* xpos, int* ypos)
428 {
429  _GLFWwindow* window = (_GLFWwindow*) handle;
430 
431  if (xpos)
432  *xpos = 0;
433  if (ypos)
434  *ypos = 0;
435 
437  _glfwPlatformGetWindowPos(window, xpos, ypos);
438 }
439 
440 GLFWAPI void glfwSetWindowPos(GLFWwindow* handle, int xpos, int ypos)
441 {
442  _GLFWwindow* window = (_GLFWwindow*) handle;
443 
445 
446  if (window->monitor)
447  {
449  "Full screen windows cannot be moved");
450  return;
451  }
452 
453  _glfwPlatformSetWindowPos(window, xpos, ypos);
454 }
455 
457 {
458  _GLFWwindow* window = (_GLFWwindow*) handle;
459 
460  if (width)
461  *width = 0;
462  if (height)
463  *height = 0;
464 
466  _glfwPlatformGetWindowSize(window, width, height);
467 }
468 
470 {
471  _GLFWwindow* window = (_GLFWwindow*) handle;
472 
474 
475  if (window->monitor)
476  {
477  window->videoMode.width = width;
478  window->videoMode.height = height;
479  }
480 
481  _glfwPlatformSetWindowSize(window, width, height);
482 }
483 
485 {
486  _GLFWwindow* window = (_GLFWwindow*) handle;
487 
488  if (width)
489  *width = 0;
490  if (height)
491  *height = 0;
492 
494  _glfwPlatformGetFramebufferSize(window, width, height);
495 }
496 
498  int* left, int* top,
499  int* right, int* bottom)
500 {
501  _GLFWwindow* window = (_GLFWwindow*) handle;
502 
503  if (left)
504  *left = 0;
505  if (top)
506  *top = 0;
507  if (right)
508  *right = 0;
509  if (bottom)
510  *bottom = 0;
511 
513  _glfwPlatformGetWindowFrameSize(window, left, top, right, bottom);
514 }
515 
517 {
518  _GLFWwindow* window = (_GLFWwindow*) handle;
521 }
522 
524 {
525  _GLFWwindow* window = (_GLFWwindow*) handle;
528 }
529 
531 {
532  _GLFWwindow* window = (_GLFWwindow*) handle;
533 
535 
536  if (window->monitor)
537  return;
538 
539  _glfwPlatformShowWindow(window);
540 }
541 
543 {
544  _GLFWwindow* window = (_GLFWwindow*) handle;
545 
547 
548  if (window->monitor)
549  return;
550 
551  _glfwPlatformHideWindow(window);
552 }
553 
554 GLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib)
555 {
556  _GLFWwindow* window = (_GLFWwindow*) handle;
557 
559 
560  switch (attrib)
561  {
562  case GLFW_FOCUSED:
563  return _glfwPlatformWindowFocused(window);
564  case GLFW_ICONIFIED:
565  return _glfwPlatformWindowIconified(window);
566  case GLFW_VISIBLE:
567  return _glfwPlatformWindowVisible(window);
568  case GLFW_RESIZABLE:
569  return window->resizable;
570  case GLFW_DECORATED:
571  return window->decorated;
572  case GLFW_FLOATING:
573  return window->floating;
574  case GLFW_CLIENT_API:
575  return window->context.api;
577  return window->context.major;
579  return window->context.minor;
581  return window->context.revision;
583  return window->context.robustness;
585  return window->context.forward;
587  return window->context.debug;
588  case GLFW_OPENGL_PROFILE:
589  return window->context.profile;
591  return window->context.release;
592  }
593 
594  _glfwInputError(GLFW_INVALID_ENUM, "Invalid window attribute");
595  return 0;
596 }
597 
599 {
600  _GLFWwindow* window = (_GLFWwindow*) handle;
602  return (GLFWmonitor*) window->monitor;
603 }
604 
606 {
607  _GLFWwindow* window = (_GLFWwindow*) handle;
609  window->userPointer = pointer;
610 }
611 
613 {
614  _GLFWwindow* window = (_GLFWwindow*) handle;
616  return window->userPointer;
617 }
618 
620  GLFWwindowposfun cbfun)
621 {
622  _GLFWwindow* window = (_GLFWwindow*) handle;
624  _GLFW_SWAP_POINTERS(window->callbacks.pos, cbfun);
625  return cbfun;
626 }
627 
629  GLFWwindowsizefun cbfun)
630 {
631  _GLFWwindow* window = (_GLFWwindow*) handle;
633  _GLFW_SWAP_POINTERS(window->callbacks.size, cbfun);
634  return cbfun;
635 }
636 
638  GLFWwindowclosefun cbfun)
639 {
640  _GLFWwindow* window = (_GLFWwindow*) handle;
642  _GLFW_SWAP_POINTERS(window->callbacks.close, cbfun);
643  return cbfun;
644 }
645 
647  GLFWwindowrefreshfun cbfun)
648 {
649  _GLFWwindow* window = (_GLFWwindow*) handle;
651  _GLFW_SWAP_POINTERS(window->callbacks.refresh, cbfun);
652  return cbfun;
653 }
654 
656  GLFWwindowfocusfun cbfun)
657 {
658  _GLFWwindow* window = (_GLFWwindow*) handle;
660  _GLFW_SWAP_POINTERS(window->callbacks.focus, cbfun);
661  return cbfun;
662 }
663 
665  GLFWwindowiconifyfun cbfun)
666 {
667  _GLFWwindow* window = (_GLFWwindow*) handle;
669  _GLFW_SWAP_POINTERS(window->callbacks.iconify, cbfun);
670  return cbfun;
671 }
672 
675 {
676  _GLFWwindow* window = (_GLFWwindow*) handle;
678  _GLFW_SWAP_POINTERS(window->callbacks.fbsize, cbfun);
679  return cbfun;
680 }
681 
683 {
686 }
687 
689 {
691 
692  if (!_glfw.windowListHead)
693  return;
694 
696 }
697 
699 {
701 
702  if (!_glfw.windowListHead)
703  return;
704 
706 }
707 
int redBits
Definition: glfw3.h:993
GLsizei const void * pointer
Definition: glext.h:378
int revision
Definition: internal.h:258
GLFWwindowposfun pos
Definition: internal.h:273
void(* GLFWwindowiconifyfun)(GLFWwindow *, int)
The function signature for window iconify/restore callbacks.
Definition: glfw3.h:826
#define GLFW_BLUE_BITS
Definition: glfw3.h:602
GLboolean debug
Definition: internal.h:191
PFNGLCLEARPROC Clear
Definition: internal.h:270
int height
Definition: glfw3.h:990
GLboolean _glfwIsValidContext(const _GLFWctxconfig *ctxconfig)
Checks whether the current context fulfils the specified hard constraints.
Definition: context.c:478
_GLFWwindow * share
Definition: internal.h:195
#define GLFW_ICONIFIED
Definition: glfw3.h:593
#define GLFW_CONTEXT_REVISION
Definition: glfw3.h:620
GLFWAPI void glfwGetWindowSize(GLFWwindow *handle, int *width, int *height)
Retrieves the size of the client area of the specified window.
Definition: window.c:456
GLboolean floating
Definition: internal.h:240
#define GLFW_CONTEXT_ROBUSTNESS
Definition: glfw3.h:621
void _glfwPlatformSwapBuffers(_GLFWwindow *window)
Swaps the front and back buffers of the specified window.
Definition: wgl_context.c:600
int blueBits
Definition: glfw3.h:999
_GLFWfbconfig framebuffer
Definition: internal.h:333
GLFWAPI int glfwGetWindowAttrib(GLFWwindow *handle, int attrib)
Returns an attribute of the specified window.
Definition: window.c:554
_GLFWwindow * _glfwPlatformGetCurrentContext(void)
Returns the window whose context is current on the calling thread.
Definition: win32_tls.c:65
void _glfwPlatformGetWindowSize(_GLFWwindow *window, int *width, int *height)
Retrieves the size of the client area of the specified window.
Definition: win32_window.c:895
#define GLFW_FOCUSED
Definition: glfw3.h:592
GLFWAPI void glfwSetWindowTitle(GLFWwindow *handle, const char *title)
Sets the title of the specified window.
Definition: window.c:420
GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow *handle, GLFWwindowsizefun cbfun)
Sets the size callback for the specified window.
Definition: window.c:628
#define GLFWAPI
Definition: glfw3.h:185
#define GLFW_STEREO
Definition: glfw3.h:611
#define GLFW_RESIZABLE
Definition: glfw3.h:594
int _glfwPlatformWindowFocused(_GLFWwindow *window)
Returns whether the window is focused.
Definition: win32_window.c:976
void _glfwInputWindowIconify(_GLFWwindow *window, int iconified)
Notifies shared code of a window iconification event.
Definition: window.c:85
GLint GLint GLsizei GLsizei height
Definition: glext.h:112
struct _GLFWwindow::@1 callbacks
#define _GLFW_REQUIRE_INIT()
Definition: internal.h:131
GLint GLint GLint GLint GLint GLint y
Definition: glext.h:114
GLFWAPI void glfwHideWindow(GLFWwindow *handle)
Hides the specified window.
Definition: window.c:542
void _glfwInputWindowSize(_GLFWwindow *window, int width, int height)
Notifies shared code of a window resize event.
Definition: window.c:79
int width
Definition: glfw3.h:987
Window configuration.
Definition: internal.h:164
GLFWwindowclosefun close
Definition: internal.h:275
#define GLFW_REFRESH_RATE
Definition: glfw3.h:614
void _glfwPlatformGetWindowPos(_GLFWwindow *window, int *xpos, int *ypos)
Retrieves the position of the client area of the specified window.
Definition: win32_window.c:875
GLFWAPI void * glfwGetWindowUserPointer(GLFWwindow *handle)
Returns the user pointer of the specified window.
Definition: window.c:612
int accumGreenBits
Definition: internal.h:216
_GLFWctxconfig context
Definition: internal.h:335
GLFWAPI void glfwPostEmptyEvent(void)
Posts an empty event to the event queue.
Definition: window.c:698
GLFWframebuffersizefun fbsize
Definition: internal.h:279
int refreshRate
Definition: glfw3.h:1002
#define GLFW_ACCUM_GREEN_BITS
Definition: glfw3.h:607
#define GLFW_CLIENT_API
Definition: glfw3.h:617
#define GLFW_ACCUM_BLUE_BITS
Definition: glfw3.h:608
void _glfwPlatformGetWindowFrameSize(_GLFWwindow *window, int *left, int *top, int *right, int *bottom)
Retrieves the size of the frame of the window.
Definition: win32_window.c:926
GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow *handle, GLFWframebuffersizefun cbfun)
Sets the framebuffer resize callback for the specified window.
Definition: window.c:673
#define GLFW_OPENGL_API
Definition: glfw3.h:627
void _glfwInputWindowFocus(_GLFWwindow *window, GLboolean focused)
Notifies shared code of a window focus event.
Definition: window.c:39
void _glfwPlatformPostEmptyEvent(void)
Posts an empty event to the event queue.
void _glfwPlatformPollEvents(void)
Processes all pending events.
Definition: win32_window.c:991
int stencilBits
Definition: internal.h:214
_GLFWwindow * windowListHead
Definition: internal.h:343
_GLFWlibrary _glfw
All global data protected by _glfwInitialized. This should only be touched after a call to glfwInit t...
void _glfwPlatformSetWindowSize(_GLFWwindow *window, int width, int height)
Sets the size of the client area of the specified window.
Definition: win32_window.c:906
#define GLFW_ALPHA_BITS
Definition: glfw3.h:603
void _glfwPlatformDestroyWindow(_GLFWwindow *window)
Definition: win32_window.c:853
struct GLFWmonitor GLFWmonitor
Opaque monitor object.
Definition: glfw3.h:714
GLboolean autoIconify
Definition: internal.h:239
const char * title
Definition: internal.h:168
#define GLFW_DONT_CARE
Definition: glfw3.h:692
struct GLFWwindow GLFWwindow
Opaque window object.
Definition: glfw3.h:722
int release
Definition: internal.h:262
GLFWvidmode videoMode
Definition: internal.h:243
void _glfwInputWindowCloseRequest(_GLFWwindow *window)
Notifies shared code of a window close request event.
Definition: window.c:103
int greenBits
Definition: glfw3.h:996
Monitor structure.
Definition: internal.h:299
GLboolean closed
Definition: internal.h:241
#define GLFW_RELEASE
The key or mouse button was released.
Definition: glfw3.h:225
#define GLFW_OPENGL_FORWARD_COMPAT
Definition: glfw3.h:622
GLFWwindowrefreshfun refresh
Definition: internal.h:276
#define _GLFW_SWAP_POINTERS(x, y)
Definition: internal.h:145
GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow *handle, GLFWwindowiconifyfun cbfun)
Sets the iconify callback for the specified window.
Definition: window.c:664
void _glfwPlatformGetFramebufferSize(_GLFWwindow *window, int *width, int *height)
Retrieves the size of the framebuffer of the specified window.
Definition: win32_window.c:921
void _glfwPlatformSetWindowPos(_GLFWwindow *window, int xpos, int ypos)
Sets the position of the client area of the specified window.
Definition: win32_window.c:886
int profile
Definition: internal.h:260
int _glfwPlatformWindowIconified(_GLFWwindow *window)
Returns whether the window is iconified.
Definition: win32_window.c:981
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
Definition: internal.h:137
char keys[GLFW_KEY_LAST+1]
Definition: internal.h:253
GLFWAPI void glfwSetWindowUserPointer(GLFWwindow *handle, void *pointer)
Sets the user pointer of the specified window.
Definition: window.c:605
int refreshRate
Definition: internal.h:336
_GLFWwindow * cursorWindow
Definition: internal.h:344
GLboolean visible
Definition: internal.h:170
typedef GLboolean(APIENTRYP PFNGLISQUERYPROC)(GLuint id)
GLint GLint bottom
Definition: glext.h:1947
#define GLFW_CURSOR_NORMAL
Definition: glfw3.h:642
#define GLFW_GREEN_BITS
Definition: glfw3.h:601
#define GLFW_FLOATING
Definition: glfw3.h:598
double cursorPosY
Definition: internal.h:250
GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow *handle, GLFWwindowrefreshfun cbfun)
Sets the refresh callback for the specified window.
Definition: window.c:646
GLboolean forward
Definition: internal.h:190
void _glfwPlatformIconifyWindow(_GLFWwindow *window)
Iconifies the specified window.
Definition: win32_window.c:948
void _glfwInputWindowDamage(_GLFWwindow *window)
Notifies shared code of a window damage event.
Definition: window.c:97
_GLFWmonitor * monitor
Definition: internal.h:175
int robustness
Definition: internal.h:261
GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow *handle, GLFWwindowposfun cbfun)
Sets the position callback for the specified window.
Definition: window.c:619
void _glfwPlatformSetCursorPos(_GLFWwindow *window, double xpos, double ypos)
Sets the position of the cursor, relative to the client area of the window.
int cursorMode
Definition: internal.h:251
void(* GLFWwindowsizefun)(GLFWwindow *, int, int)
The function signature for window resize callbacks.
Definition: glfw3.h:773
GLFWwindowsizefun size
Definition: internal.h:274
GLFWAPI void glfwIconifyWindow(GLFWwindow *handle)
Iconifies the specified window.
Definition: window.c:516
void * userPointer
Definition: internal.h:242
void glfwDefaultWindowHints(void)
Resets all window hints to their default values.
Definition: window.c:235
struct _GLFWlibrary::@2 hints
int accumBlueBits
Definition: internal.h:217
struct _GLFWwindow * next
Definition: internal.h:234
GLFWAPI void glfwWindowHint(int target, int hint)
Sets the specified window hint to the desired value.
Definition: window.c:267
int _glfwPlatformWindowVisible(_GLFWwindow *window)
Returns whether the window is visible.
Definition: win32_window.c:986
GLenum target
Definition: glext.h:1549
GLFWAPI void glfwGetWindowFrameSize(GLFWwindow *handle, int *left, int *top, int *right, int *bottom)
Retrieves the size of the frame of the window.
Definition: window.c:497
#define GLFW_CONTEXT_RELEASE_BEHAVIOR
Definition: glfw3.h:625
void(* GLFWframebuffersizefun)(GLFWwindow *, int, int)
The function signature for framebuffer resize callbacks.
Definition: glfw3.h:841
GLint left
Definition: glext.h:1947
struct _GLFWwindow::@0 context
_GLFWwndconfig window
Definition: internal.h:334
GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow *handle, GLFWwindowfocusfun cbfun)
Sets the focus callback for the specified window.
Definition: window.c:655
int auxBuffers
Definition: internal.h:219
GLdouble GLdouble right
Definition: glext.h:6472
void _glfwInputMouseClick(_GLFWwindow *window, int button, int action, int mods)
Notifies shared code of a mouse button click event.
Definition: input.c:180
void _glfwInputWindowPos(_GLFWwindow *window, int x, int y)
Notifies shared code of a window movement event.
Definition: window.c:73
#define GLFW_CONTEXT_VERSION_MAJOR
Definition: glfw3.h:618
GLsizei const GLfloat * value
Definition: glext.h:693
#define GLFW_SRGB_CAPABLE
Definition: glfw3.h:613
#define GLFW_DECORATED
Definition: glfw3.h:596
void(* GLFWwindowposfun)(GLFWwindow *, int, int)
The function signature for window position callbacks.
Definition: glfw3.h:759
GLFWAPI GLFWmonitor * glfwGetWindowMonitor(GLFWwindow *handle)
Returns the monitor that the window uses for full screen mode.
Definition: window.c:598
GLFWAPI void glfwSetWindowSize(GLFWwindow *handle, int width, int height)
Sets the size of the client area of the specified window.
Definition: window.c:469
GLboolean decorated
Definition: internal.h:171
GLFWAPI void glfwSetWindowPos(GLFWwindow *handle, int xpos, int ypos)
Sets the position of the client area of the specified window.
Definition: window.c:440
void _glfwPlatformShowWindow(_GLFWwindow *window)
Makes the specified window visible.
Definition: win32_window.c:958
GLFWAPI void glfwSetWindowShouldClose(GLFWwindow *handle, int value)
Sets the close flag of the specified window.
Definition: window.c:413
#define GLFW_ACCUM_RED_BITS
Definition: glfw3.h:606
#define GLFW_SAMPLES
Definition: glfw3.h:612
GLFWAPI void glfwWaitEvents(void)
Waits until events are queued and processes them.
Definition: window.c:688
GLboolean resizable
Definition: internal.h:237
double cursorPosX
Definition: internal.h:250
GLboolean forward
Definition: internal.h:259
GLFWAPI GLFWwindow * glfwCreateWindow(int width, int height, const char *title, GLFWmonitor *monitor, GLFWwindow *share)
Creates a window and its associated context.
Definition: window.c:116
#define GLFW_INVALID_ENUM
One of the arguments to the function was an invalid enum value.
Definition: glfw3.h:498
GLboolean floating
Definition: internal.h:174
#define GLFW_RED_BITS
Definition: glfw3.h:600
#define GLFW_INVALID_VALUE
One of the arguments to the function was an invalid value.
Definition: glfw3.h:510
GLboolean autoIconify
Definition: internal.h:173
GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig *ctxconfig)
Retrieves the attributes of the current context.
Definition: context.c:354
void _glfwPlatformUnhideWindow(_GLFWwindow *window)
Definition: win32_window.c:966
#define GLFW_KEY_LAST
Definition: glfw3.h:391
#define GLFW_OPENGL_DEBUG_CONTEXT
Definition: glfw3.h:623
void _glfwPlatformMakeContextCurrent(_GLFWwindow *window)
Makes the context of the specified window current for the calling thread.
Definition: wgl_context.c:590
GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig *ctxconfig)
Checks whether the desired context attributes are valid.
Definition: context.c:90
#define GLFW_DEPTH_BITS
Definition: glfw3.h:604
GLFWAPI void glfwGetWindowPos(GLFWwindow *handle, int *xpos, int *ypos)
Retrieves the position of the client area of the specified window.
Definition: window.c:427
GLint GLint GLsizei width
Definition: glext.h:112
void _glfwInputKey(_GLFWwindow *window, int key, int scancode, int action, int mods)
Notifies shared code of a physical key event.
Definition: input.c:134
GLFWAPI void glfwDestroyWindow(GLFWwindow *handle)
Destroys the specified window and its context.
Definition: window.c:369
GLFWAPI void glfwGetFramebufferSize(GLFWwindow *handle, int *width, int *height)
Retrieves the size of the framebuffer of the specified window.
Definition: window.c:484
GLFWAPI void glfwShowWindow(GLFWwindow *handle)
Makes the specified window visible.
Definition: window.c:530
GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow *handle, GLFWwindowclosefun cbfun)
Sets the close callback for the specified window.
Definition: window.c:637
void _glfwPlatformHideWindow(_GLFWwindow *window)
Hides the specified window.
Definition: win32_window.c:971
void(* GLFWwindowclosefun)(GLFWwindow *)
The function signature for window close callbacks.
Definition: glfw3.h:785
void _glfwPlatformWaitEvents(void)
Waits until events are queued and processes them.
void _glfwInputError(int error, const char *format,...)
Notifies shared code of an error.
#define GLFW_MOUSE_BUTTON_LAST
Definition: glfw3.h:431
#define GLFW_DOUBLEBUFFER
Definition: glfw3.h:615
void _glfwInputFramebufferSize(_GLFWwindow *window, int width, int height)
Notifies shared code of a framebuffer resize event.
Definition: window.c:91
GLFWAPI void glfwPollEvents(void)
Processes all pending events.
Definition: window.c:682
#define GLFW_OPENGL_PROFILE
Definition: glfw3.h:624
int accumAlphaBits
Definition: internal.h:218
char mouseButtons[GLFW_MOUSE_BUTTON_LAST+1]
Definition: internal.h:252
#define GLFW_AUTO_ICONIFY
Definition: glfw3.h:597
#define GLFW_CONTEXT_VERSION_MINOR
Definition: glfw3.h:619
#define GLFW_STENCIL_BITS
Definition: glfw3.h:605
Context configuration.
Definition: internal.h:185
Window and context structure.
Definition: internal.h:232
Framebuffer configuration.
Definition: internal.h:207
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:6472
#define GLFW_AUX_BUFFERS
Definition: glfw3.h:610
GLFWAPI void glfwRestoreWindow(GLFWwindow *handle)
Restores the specified window.
Definition: window.c:523
GLboolean resizable
Definition: internal.h:169
#define GLFW_PRESS
The key or mouse button was pressed.
Definition: glfw3.h:232
_GLFWmonitor * monitor
Definition: internal.h:244
void _glfwPlatformSetWindowTitle(_GLFWwindow *window, const char *title)
Sets the title of the specified window.
Definition: win32_window.c:861
GLFWwindowiconifyfun iconify
Definition: internal.h:278
GLint GLint GLint GLint GLint x
Definition: glext.h:114
#define GLFW_ACCUM_ALPHA_BITS
Definition: glfw3.h:609
void(* GLFWwindowrefreshfun)(GLFWwindow *)
The function signature for window content refresh callbacks.
Definition: glfw3.h:797
GLFWwindowfocusfun focus
Definition: internal.h:277
void _glfwPlatformRestoreWindow(_GLFWwindow *window)
Restores the specified window.
Definition: win32_window.c:953
int accumRedBits
Definition: internal.h:215
GLboolean debug
Definition: internal.h:259
GLboolean decorated
Definition: internal.h:238
#define GLFW_VISIBLE
Definition: glfw3.h:595
int doublebuffer
Definition: internal.h:223
int _glfwPlatformCreateWindow(_GLFWwindow *window, const _GLFWwndconfig *wndconfig, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
Definition: win32_window.c:797
void(* GLFWwindowfocusfun)(GLFWwindow *, int)
The function signature for window focus/defocus callbacks.
Definition: glfw3.h:811
GLFWAPI int glfwWindowShouldClose(GLFWwindow *handle)
Checks the close flag of the specified window.
Definition: window.c:406
GLboolean focused
Definition: internal.h:172


librealsense
Author(s): Sergey Dorodnicov , Mark Horn , Reagan Lopez
autogenerated on Fri Mar 13 2020 03:16:18