/*************************************************************************
* GLFW 3.3 - www.glfw.org
* A library for OpenGL, window and input
*------------------------------------------------------------------------
* Copyright (c) 2002-2006 Marcus Geelnard
* Copyright (c) 2006-2019 Camilla Löwy <elmindreda@glfw.org>
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would
* be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*
*************************************************************************/
#ifndef _glfw3_h_
#define _glfw3_h_
#ifdef __cplusplus
extern "C" {
#endif
/*************************************************************************
* Doxygen documentation
*************************************************************************/
/*! @file glfw3.h
* @brief The header of the GLFW 3 API.
*
* This is the header file of the GLFW 3 API. It defines all its types and
* declares all its functions.
*
* For more information about how to use this file, see @ref build_include.
*/
/*! @defgroup context Context reference
* @brief Functions and types related to OpenGL and OpenGL ES contexts.
*
* This is the reference documentation for OpenGL and OpenGL ES context related
* functions. For more task-oriented information, see the @ref context_guide.
*/
/*! @defgroup vulkan Vulkan reference
* @brief Functions and types related to Vulkan.
*
* This is the reference documentation for Vulkan related functions and types.
* For more task-oriented information, see the @ref vulkan_guide.
*/
/*! @defgroup init Initialization, version and error reference
* @brief Functions and types related to initialization and error handling.
*
* This is the reference documentation for initialization and termination of
* the library, version management and error handling. For more task-oriented
* information, see the @ref intro_guide.
*/
/*! @defgroup input Input reference
* @brief Functions and types related to input handling.
*
* This is the reference documentation for input related functions and types.
* For more task-oriented information, see the @ref input_guide.
*/
/*! @defgroup monitor Monitor reference
* @brief Functions and types related to monitors.
*
* This is the reference documentation for monitor related functions and types.
* For more task-oriented information, see the @ref monitor_guide.
*/
/*! @defgroup window Window reference
* @brief Functions and types related to windows.
*
* This is the reference documentation for window related functions and types,
* including creation, deletion and event polling. For more task-oriented
* information, see the @ref window_guide.
*/
/*************************************************************************
* Compiler- and platform-specific preprocessor work
*************************************************************************/
/* If we are we on Windows, we want a single define for it.
*/
#if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__))
#define _WIN32
#endif /* _WIN32 */
/* It is customary to use APIENTRY for OpenGL function pointer declarations on
* all platforms. Additionally, the Windows OpenGL header needs APIENTRY.
*/
#ifndef APIENTRY
#ifdef _WIN32
#define APIENTRY __stdcall
#else
#define APIENTRY
#endif
#define GLFW_APIENTRY_DEFINED
#endif /* APIENTRY */
/* Some Windows OpenGL headers need this.
*/
#if !defined(WINGDIAPI) && defined(_WIN32)
#define WINGDIAPI __declspec(dllimport)
#define GLFW_WINGDIAPI_DEFINED
#endif /* WINGDIAPI */
/* Some Windows GLU headers need this.
*/
#if !defined(CALLBACK) && defined(_WIN32)
#define CALLBACK __stdcall
#define GLFW_CALLBACK_DEFINED
#endif /* CALLBACK */
/* Include because most Windows GLU headers need wchar_t and
* the macOS OpenGL header blocks the definition of ptrdiff_t by glext.h.
* Include it unconditionally to avoid surprising side-effects.
*/
#include <stddef.h>
/* Include because it is needed by Vulkan and related functions.
* Include it unconditionally to avoid surprising side-effects.
*/
#include <stdint.h>
/* Include the chosen OpenGL or OpenGL ES headers.
*/
#if defined(GLFW_INCLUDE_ES1)
#include <GLES/gl.h>
#if defined(GLFW_INCLUDE_GLEXT)
#include <GLES/glext.h>
#endif
#elif defined(GLFW_INCLUDE_ES2)
#include <GLES2/gl2.h>
#if defined(GLFW_INCLUDE_GLEXT)
#include <GLES2/gl2ext.h>
#endif
#elif defined(GLFW_INCLUDE_ES3)
#include <GLES3/gl3.h>
#if defined(GLFW_INCLUDE_GLEXT)
#include <GLES2/gl2ext.h>
#endif
#elif defined(GLFW_INCLUDE_ES31)
#include <GLES3/gl31.h>
#if defined(GLFW_INCLUDE_GLEXT)
#include <GLES2/gl2ext.h>
#endif
#elif defined(GLFW_INCLUDE_ES32)
#include <GLES3/gl32.h>
#if defined(GLFW_INCLUDE_GLEXT)
#include <GLES2/gl2ext.h>
#endif
#elif defined(GLFW_INCLUDE_GLCOREARB)
#if defined(__APPLE__)
#include <OpenGL/gl3.h>
#if defined(GLFW_INCLUDE_GLEXT)
#include <OpenGL/gl3ext.h>
#endif /*GLFW_INCLUDE_GLEXT*/
#else /*__APPLE__*/
#include <GL/glcorearb.h>
#endif /*__APPLE__*/
#elif !defined(GLFW_INCLUDE_NONE)
#if defined(__APPLE__)
#if !defined(GLFW_INCLUDE_GLEXT)
#define GL_GLEXT_LEGACY
#endif
#include <OpenGL/gl.h>
#if defined(GLFW_INCLUDE_GLU)
#include <OpenGL/glu.h>
#endif
#else /*__APPLE__*/
#include <GL/gl.h>
#if defined(GLFW_INCLUDE_GLEXT)
#include <GL/glext.h>
#endif
#if defined(GLFW_INCLUDE_GLU)
#include <GL/glu.h>
#endif
#endif /*__APPLE__*/
#endif /* OpenGL and OpenGL ES headers */
#if defined(GLFW_INCLUDE_VULKAN)
#include <vulkan/vulkan.h>
#endif /* Vulkan header */
#if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL)
/* GLFW_DLL must be defined by applications that are linking against the DLL
* version of the GLFW library. _GLFW_BUILD_DLL is defined by the GLFW
* configuration header when compiling the DLL version of the library.
*/
#error "You must not have both GLFW_DLL and _GLFW_BUILD_DLL defined"
#endif
/* GLFWAPI is used to declare public API functions for export
* from the DLL / shared library / dynamic library.
*/
#if defined(_WIN32) && defined(_GLFW_BUILD_DLL)
/* We are building GLFW as a Win32 DLL */
#define GLFWAPI __declspec(dllexport)
#elif defined(_WIN32) && defined(GLFW_DLL)
/* We are calling GLFW as a Win32 DLL */
#define GLFWAPI __declspec(dllimport)
#elif defined(__GNUC__) && defined(_GLFW_BUILD_DLL)
/* We are building GLFW as a shared / dynamic library */
#define GLFWAPI __attribute__((visibility("default")))
#else
/* We are building or calling GLFW as a static library */
#define GLFWAPI
#endif
/*************************************************************************
* GLFW API tokens
*************************************************************************/
/*! @name GLFW version macros
* @{ */
/*! @brief The major version number of the GLFW library.
*
* This is incremented when the API is changed in non-compatible ways.
* @ingroup init
*/
#define GLFW_VERSION_MAJOR 3
/*! @brief The minor version number of the GLFW library.
*
* This is incremented when features are added to the API but it remains
* backward-compatible.
* @ingroup init
*/
#define GLFW_VERSION_MINOR 3
/*!