internal.h
Go to the documentation of this file.
00001 //========================================================================
00002 // GLFW 3.1 - www.glfw.org
00003 //------------------------------------------------------------------------
00004 // Copyright (c) 2002-2006 Marcus Geelnard
00005 // Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
00006 //
00007 // This software is provided 'as-is', without any express or implied
00008 // warranty. In no event will the authors be held liable for any damages
00009 // arising from the use of this software.
00010 //
00011 // Permission is granted to anyone to use this software for any purpose,
00012 // including commercial applications, and to alter it and redistribute it
00013 // freely, subject to the following restrictions:
00014 //
00015 // 1. The origin of this software must not be misrepresented; you must not
00016 //    claim that you wrote the original software. If you use this software
00017 //    in a product, an acknowledgment in the product documentation would
00018 //    be appreciated but is not required.
00019 //
00020 // 2. Altered source versions must be plainly marked as such, and must not
00021 //    be misrepresented as being the original software.
00022 //
00023 // 3. This notice may not be removed or altered from any source
00024 //    distribution.
00025 //
00026 //========================================================================
00027 
00028 #ifndef _glfw3_internal_h_
00029 #define _glfw3_internal_h_
00030 
00031 
00032 #if defined(_GLFW_USE_CONFIG_H)
00033  #include "glfw_config.h"
00034 #endif
00035 
00036 #define _GLFW_VERSION_NUMBER "3.1.2"
00037 
00038 #if defined(GLFW_INCLUDE_GLCOREARB) || \
00039     defined(GLFW_INCLUDE_ES1)       || \
00040     defined(GLFW_INCLUDE_ES2)       || \
00041     defined(GLFW_INCLUDE_ES3)       || \
00042     defined(GLFW_INCLUDE_NONE)      || \
00043     defined(GLFW_INCLUDE_GLEXT)     || \
00044     defined(GLFW_INCLUDE_GLU)       || \
00045     defined(GLFW_DLL)
00046  #error "You may not define any header option macros when compiling GLFW"
00047 #endif
00048 
00049 #if defined(_GLFW_USE_OPENGL)
00050  // This is the default for glfw3.h
00051 #elif defined(_GLFW_USE_GLESV1)
00052  #define GLFW_INCLUDE_ES1
00053 #elif defined(_GLFW_USE_GLESV2)
00054  #define GLFW_INCLUDE_ES2
00055 #else
00056  #error "No supported client library selected"
00057 #endif
00058 
00059 // Disable the inclusion of the platform glext.h by gl.h to allow proper
00060 // inclusion of our own, newer glext.h below
00061 #define GL_GLEXT_LEGACY
00062 
00063 #include "../include/GLFW/glfw3.h"
00064 
00065 #if defined(_GLFW_USE_OPENGL)
00066  // This path may need to be changed if you build GLFW using your own setup
00067  // GLFW comes with its own copy of glext.h since it uses fairly new extensions
00068  // and not all development environments come with an up-to-date version
00069  #include "../deps/GL/glext.h"
00070 #endif
00071 
00072 typedef void (APIENTRY * PFNGLCLEARPROC)(GLbitfield);
00073 typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGPROC)(GLenum);
00074 typedef void (APIENTRY * PFNGLGETINTEGERVPROC)(GLenum,GLint*);
00075 
00076 typedef struct _GLFWwndconfig   _GLFWwndconfig;
00077 typedef struct _GLFWctxconfig   _GLFWctxconfig;
00078 typedef struct _GLFWfbconfig    _GLFWfbconfig;
00079 typedef struct _GLFWwindow      _GLFWwindow;
00080 typedef struct _GLFWlibrary     _GLFWlibrary;
00081 typedef struct _GLFWmonitor     _GLFWmonitor;
00082 typedef struct _GLFWcursor      _GLFWcursor;
00083 
00084 #if defined(_GLFW_COCOA)
00085  #include "cocoa_platform.h"
00086 #elif defined(_GLFW_WIN32)
00087  #include "win32_platform.h"
00088 #elif defined(_GLFW_X11)
00089  #include "x11_platform.h"
00090 #elif defined(_GLFW_WAYLAND)
00091  #include "wl_platform.h"
00092 #elif defined(_GLFW_MIR)
00093  #include "mir_platform.h"
00094 #else
00095  #error "No supported window creation API selected"
00096 #endif
00097 
00098 
00099 //========================================================================
00100 // Doxygen group definitions
00101 //========================================================================
00102 
00126 //========================================================================
00127 // Helper macros
00128 //========================================================================
00129 
00130 // Checks for whether the library has been initialized
00131 #define _GLFW_REQUIRE_INIT()                         \
00132     if (!_glfwInitialized)                           \
00133     {                                                \
00134         _glfwInputError(GLFW_NOT_INITIALIZED, NULL); \
00135         return;                                      \
00136     }
00137 #define _GLFW_REQUIRE_INIT_OR_RETURN(x)              \
00138     if (!_glfwInitialized)                           \
00139     {                                                \
00140         _glfwInputError(GLFW_NOT_INITIALIZED, NULL); \
00141         return x;                                    \
00142     }
00143 
00144 // Swaps the provided pointers
00145 #define _GLFW_SWAP_POINTERS(x, y) \
00146     {                             \
00147         void* t;                  \
00148         t = x;                    \
00149         x = y;                    \
00150         y = t;                    \
00151     }
00152 
00153 
00154 //========================================================================
00155 // Platform-independent structures
00156 //========================================================================
00157 
00164 struct _GLFWwndconfig
00165 {
00166     int           width;
00167     int           height;
00168     const char*   title;
00169     GLboolean     resizable;
00170     GLboolean     visible;
00171     GLboolean     decorated;
00172     GLboolean     focused;
00173     GLboolean     autoIconify;
00174     GLboolean     floating;
00175     _GLFWmonitor* monitor;
00176 };
00177 
00178 
00185 struct _GLFWctxconfig
00186 {
00187     int           api;
00188     int           major;
00189     int           minor;
00190     GLboolean     forward;
00191     GLboolean     debug;
00192     int           profile;
00193     int           robustness;
00194     int           release;
00195     _GLFWwindow*  share;
00196 };
00197 
00198 
00207 struct _GLFWfbconfig
00208 {
00209     int         redBits;
00210     int         greenBits;
00211     int         blueBits;
00212     int         alphaBits;
00213     int         depthBits;
00214     int         stencilBits;
00215     int         accumRedBits;
00216     int         accumGreenBits;
00217     int         accumBlueBits;
00218     int         accumAlphaBits;
00219     int         auxBuffers;
00220     int         stereo;
00221     int         samples;
00222     int         sRGB;
00223     int         doublebuffer;
00224 
00225     // This is defined in the context API's context.h
00226     _GLFW_PLATFORM_FBCONFIG;
00227 };
00228 
00229 
00232 struct _GLFWwindow
00233 {
00234     struct _GLFWwindow* next;
00235 
00236     // Window settings and state
00237     GLboolean           resizable;
00238     GLboolean           decorated;
00239     GLboolean           autoIconify;
00240     GLboolean           floating;
00241     GLboolean           closed;
00242     void*               userPointer;
00243     GLFWvidmode         videoMode;
00244     _GLFWmonitor*       monitor;
00245     _GLFWcursor*        cursor;
00246 
00247     // Window input state
00248     GLboolean           stickyKeys;
00249     GLboolean           stickyMouseButtons;
00250     double              cursorPosX, cursorPosY;
00251     int                 cursorMode;
00252     char                mouseButtons[GLFW_MOUSE_BUTTON_LAST + 1];
00253     char                keys[GLFW_KEY_LAST + 1];
00254 
00255     // OpenGL extensions and context attributes
00256     struct {
00257         int             api;
00258         int             major, minor, revision;
00259         GLboolean       forward, debug;
00260         int             profile;
00261         int             robustness;
00262         int             release;
00263     } context;
00264 
00265 #if defined(_GLFW_USE_OPENGL)
00266     PFNGLGETSTRINGIPROC GetStringi;
00267 #endif
00268     PFNGLGETINTEGERVPROC GetIntegerv;
00269     PFNGLGETSTRINGPROC  GetString;
00270     PFNGLCLEARPROC      Clear;
00271 
00272     struct {
00273         GLFWwindowposfun        pos;
00274         GLFWwindowsizefun       size;
00275         GLFWwindowclosefun      close;
00276         GLFWwindowrefreshfun    refresh;
00277         GLFWwindowfocusfun      focus;
00278         GLFWwindowiconifyfun    iconify;
00279         GLFWframebuffersizefun  fbsize;
00280         GLFWmousebuttonfun      mouseButton;
00281         GLFWcursorposfun        cursorPos;
00282         GLFWcursorenterfun      cursorEnter;
00283         GLFWscrollfun           scroll;
00284         GLFWkeyfun              key;
00285         GLFWcharfun             character;
00286         GLFWcharmodsfun         charmods;
00287         GLFWdropfun             drop;
00288     } callbacks;
00289 
00290     // This is defined in the window API's platform.h
00291     _GLFW_PLATFORM_WINDOW_STATE;
00292     // This is defined in the context API's context.h
00293     _GLFW_PLATFORM_CONTEXT_STATE;
00294 };
00295 
00296 
00299 struct _GLFWmonitor
00300 {
00301     char*           name;
00302 
00303     // Physical dimensions in millimeters.
00304     int             widthMM, heightMM;
00305 
00306     GLFWvidmode*    modes;
00307     int             modeCount;
00308     GLFWvidmode     currentMode;
00309 
00310     GLFWgammaramp   originalRamp;
00311     GLFWgammaramp   currentRamp;
00312 
00313     // This is defined in the window API's platform.h
00314     _GLFW_PLATFORM_MONITOR_STATE;
00315 };
00316 
00317 
00320 struct _GLFWcursor
00321 {
00322     _GLFWcursor*    next;
00323 
00324     // This is defined in the window API's platform.h
00325     _GLFW_PLATFORM_CURSOR_STATE;
00326 };
00327 
00330 struct _GLFWlibrary
00331 {
00332     struct {
00333         _GLFWfbconfig   framebuffer;
00334         _GLFWwndconfig  window;
00335         _GLFWctxconfig  context;
00336         int             refreshRate;
00337     } hints;
00338 
00339     double              cursorPosX, cursorPosY;
00340 
00341     _GLFWcursor*        cursorListHead;
00342 
00343     _GLFWwindow*        windowListHead;
00344     _GLFWwindow*        cursorWindow;
00345 
00346     _GLFWmonitor**      monitors;
00347     int                 monitorCount;
00348 
00349     struct {
00350         GLFWmonitorfun  monitor;
00351     } callbacks;
00352 
00353     // This is defined in the window API's platform.h
00354     _GLFW_PLATFORM_LIBRARY_WINDOW_STATE;
00355     // This is defined in the context API's context.h
00356     _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE;
00357     // This is defined in the platform's time.h
00358     _GLFW_PLATFORM_LIBRARY_TIME_STATE;
00359     // This is defined in the platform's joystick.h
00360     _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE;
00361     // This is defined in the platform's tls.h
00362     _GLFW_PLATFORM_LIBRARY_TLS_STATE;
00363 };
00364 
00365 
00366 //========================================================================
00367 // Global state shared between compilation units of GLFW
00368 //========================================================================
00369 
00372 extern GLboolean _glfwInitialized;
00373 
00378 extern _GLFWlibrary _glfw;
00379 
00380 
00381 //========================================================================
00382 // Platform API functions
00383 //========================================================================
00384 
00389 int _glfwPlatformInit(void);
00390 
00394 void _glfwPlatformTerminate(void);
00395 
00403 const char* _glfwPlatformGetVersionString(void);
00404 
00408 void _glfwPlatformGetCursorPos(_GLFWwindow* window, double* xpos, double* ypos);
00409 
00413 void _glfwPlatformSetCursorPos(_GLFWwindow* window, double xpos, double ypos);
00414 
00419 void _glfwPlatformApplyCursorMode(_GLFWwindow* window);
00420 
00424 _GLFWmonitor** _glfwPlatformGetMonitors(int* count);
00425 
00434 GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second);
00435 
00439 void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos);
00440 
00444 GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count);
00445 
00448 void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode);
00449 
00453 void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp);
00454 
00458 void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp);
00459 
00463 void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string);
00464 
00471 const char* _glfwPlatformGetClipboardString(_GLFWwindow* window);
00472 
00476 int _glfwPlatformJoystickPresent(int joy);
00477 
00481 const float* _glfwPlatformGetJoystickAxes(int joy, int* count);
00482 
00486 const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count);
00487 
00491 const char* _glfwPlatformGetJoystickName(int joy);
00492 
00496 double _glfwPlatformGetTime(void);
00497 
00501 void _glfwPlatformSetTime(double time);
00502 
00505 int _glfwPlatformCreateWindow(_GLFWwindow* window,
00506                               const _GLFWwndconfig* wndconfig,
00507                               const _GLFWctxconfig* ctxconfig,
00508                               const _GLFWfbconfig* fbconfig);
00509 
00512 void _glfwPlatformDestroyWindow(_GLFWwindow* window);
00513 
00517 void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title);
00518 
00522 void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos);
00523 
00527 void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos);
00528 
00532 void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height);
00533 
00537 void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height);
00538 
00542 void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height);
00543 
00547 void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window, int* left, int* top, int* right, int* bottom);
00548 
00552 void _glfwPlatformIconifyWindow(_GLFWwindow* window);
00553 
00557 void _glfwPlatformRestoreWindow(_GLFWwindow* window);
00558 
00562 void _glfwPlatformShowWindow(_GLFWwindow* window);
00563 
00566 void _glfwPlatformUnhideWindow(_GLFWwindow* window);
00567 
00571 void _glfwPlatformHideWindow(_GLFWwindow* window);
00572 
00576 int _glfwPlatformWindowFocused(_GLFWwindow* window);
00577 
00581 int _glfwPlatformWindowIconified(_GLFWwindow* window);
00582 
00586 int _glfwPlatformWindowVisible(_GLFWwindow* window);
00587 
00591 void _glfwPlatformPollEvents(void);
00592 
00596 void _glfwPlatformWaitEvents(void);
00597 
00601 void _glfwPlatformPostEmptyEvent(void);
00602 
00606 void _glfwPlatformMakeContextCurrent(_GLFWwindow* window);
00607 
00611 _GLFWwindow* _glfwPlatformGetCurrentContext(void);
00612 
00616 void _glfwPlatformSwapBuffers(_GLFWwindow* window);
00617 
00621 void _glfwPlatformSwapInterval(int interval);
00622 
00626 int _glfwPlatformExtensionSupported(const char* extension);
00627 
00631 GLFWglproc _glfwPlatformGetProcAddress(const char* procname);
00632 
00636 int _glfwPlatformCreateCursor(_GLFWcursor* cursor, const GLFWimage* image, int xhot, int yhot);
00637 
00641 int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape);
00642 
00646 void _glfwPlatformDestroyCursor(_GLFWcursor* cursor);
00647 
00651 void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor);
00652 
00653 
00654 //========================================================================
00655 // Event API functions
00656 //========================================================================
00657 
00664 void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean focused);
00665 
00672 void _glfwInputWindowPos(_GLFWwindow* window, int xpos, int ypos);
00673 
00680 void _glfwInputWindowSize(_GLFWwindow* window, int width, int height);
00681 
00688 void _glfwInputFramebufferSize(_GLFWwindow* window, int width, int height);
00689 
00696 void _glfwInputWindowIconify(_GLFWwindow* window, int iconified);
00697 
00701 void _glfwInputWindowDamage(_GLFWwindow* window);
00702 
00707 void _glfwInputWindowCloseRequest(_GLFWwindow* window);
00708 
00717 void _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int mods);
00718 
00727 void _glfwInputChar(_GLFWwindow* window, unsigned int codepoint, int mods, int plain);
00728 
00735 void _glfwInputScroll(_GLFWwindow* window, double x, double y);
00736 
00743 void _glfwInputMouseClick(_GLFWwindow* window, int button, int action, int mods);
00744 
00753 void _glfwInputCursorMotion(_GLFWwindow* window, double x, double y);
00754 
00761 void _glfwInputCursorEnter(_GLFWwindow* window, int entered);
00762 
00765 void _glfwInputMonitorChange(void);
00766 
00773 void _glfwInputError(int error, const char* format, ...);
00774 
00781 void _glfwInputDrop(_GLFWwindow* window, int count, const char** names);
00782 
00783 
00784 //========================================================================
00785 // Utility functions
00786 //========================================================================
00787 
00790 const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor,
00791                                         const GLFWvidmode* desired);
00792 
00796 int _glfwCompareVideoModes(const GLFWvidmode* first, const GLFWvidmode* second);
00797 
00801 void _glfwSplitBPP(int bpp, int* red, int* green, int* blue);
00802 
00809 int _glfwStringInExtensionString(const char* string, const char* extensions);
00810 
00819 const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
00820                                          const _GLFWfbconfig* alternatives,
00821                                          unsigned int count);
00822 
00828 GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig);
00829 
00840 GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig);
00841 
00849 GLboolean _glfwIsValidContext(const _GLFWctxconfig* ctxconfig);
00850 
00853 void _glfwAllocGammaArrays(GLFWgammaramp* ramp, unsigned int size);
00854 
00857 void _glfwFreeGammaArrays(GLFWgammaramp* ramp);
00858 
00867 _GLFWmonitor* _glfwAllocMonitor(const char* name, int widthMM, int heightMM);
00868 
00872 void _glfwFreeMonitor(_GLFWmonitor* monitor);
00873 
00876 void _glfwFreeMonitors(_GLFWmonitor** monitors, int count);
00877 
00878 #endif // _glfw3_internal_h_


librealsense
Author(s): Sergey Dorodnicov , Mark Horn , Reagan Lopez
autogenerated on Tue Jun 25 2019 19:54:39