2010-09-07 15:34:51 +00:00
|
|
|
//========================================================================
|
2016-08-18 21:42:15 +00:00
|
|
|
// GLFW 3.3 - www.glfw.org
|
2010-09-07 15:34:51 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// Copyright (c) 2002-2006 Marcus Geelnard
|
2016-11-21 15:23:59 +00:00
|
|
|
// Copyright (c) 2006-2016 Camilla Löwy <elmindreda@glfw.org>
|
2010-09-07 15:34:51 +00:00
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
//========================================================================
|
|
|
|
|
2017-11-15 03:21:41 +00:00
|
|
|
#pragma once
|
|
|
|
|
2013-11-20 10:49:44 +00:00
|
|
|
#if defined(_GLFW_USE_CONFIG_H)
|
|
|
|
#include "glfw_config.h"
|
|
|
|
#endif
|
2013-01-15 21:43:44 +00:00
|
|
|
|
2015-03-17 15:33:21 +00:00
|
|
|
#if defined(GLFW_INCLUDE_GLCOREARB) || \
|
|
|
|
defined(GLFW_INCLUDE_ES1) || \
|
|
|
|
defined(GLFW_INCLUDE_ES2) || \
|
|
|
|
defined(GLFW_INCLUDE_ES3) || \
|
2017-01-02 04:58:41 +00:00
|
|
|
defined(GLFW_INCLUDE_ES31) || \
|
|
|
|
defined(GLFW_INCLUDE_ES32) || \
|
2015-03-17 15:33:21 +00:00
|
|
|
defined(GLFW_INCLUDE_NONE) || \
|
|
|
|
defined(GLFW_INCLUDE_GLEXT) || \
|
|
|
|
defined(GLFW_INCLUDE_GLU) || \
|
2016-08-04 23:32:23 +00:00
|
|
|
defined(GLFW_INCLUDE_VULKAN) || \
|
2015-03-17 15:33:21 +00:00
|
|
|
defined(GLFW_DLL)
|
2015-12-13 13:07:27 +00:00
|
|
|
#error "You must not define any header option macros when compiling GLFW"
|
2015-03-17 15:33:21 +00:00
|
|
|
#endif
|
|
|
|
|
2015-08-23 23:27:20 +00:00
|
|
|
#define GLFW_INCLUDE_NONE
|
2013-05-22 20:46:34 +00:00
|
|
|
#include "../include/GLFW/glfw3.h"
|
2013-01-15 21:43:44 +00:00
|
|
|
|
2016-12-05 00:19:48 +00:00
|
|
|
#define _GLFW_INSERT_FIRST 0
|
|
|
|
#define _GLFW_INSERT_LAST 1
|
|
|
|
|
2017-01-05 18:44:15 +00:00
|
|
|
#define _GLFW_POLL_PRESENCE 0
|
|
|
|
#define _GLFW_POLL_AXES 1
|
|
|
|
#define _GLFW_POLL_BUTTONS 2
|
2017-06-18 13:13:25 +00:00
|
|
|
#define _GLFW_POLL_ALL (_GLFW_POLL_AXES | _GLFW_POLL_BUTTONS)
|
2017-01-05 18:44:15 +00:00
|
|
|
|
2017-08-17 12:25:10 +00:00
|
|
|
#define _GLFW_MESSAGE_SIZE 1024
|
|
|
|
|
2015-08-10 18:19:04 +00:00
|
|
|
typedef int GLFWbool;
|
|
|
|
|
2017-05-25 16:23:09 +00:00
|
|
|
typedef struct _GLFWerror _GLFWerror;
|
2017-02-14 14:43:31 +00:00
|
|
|
typedef struct _GLFWinitconfig _GLFWinitconfig;
|
2015-08-10 18:19:04 +00:00
|
|
|
typedef struct _GLFWwndconfig _GLFWwndconfig;
|
|
|
|
typedef struct _GLFWctxconfig _GLFWctxconfig;
|
|
|
|
typedef struct _GLFWfbconfig _GLFWfbconfig;
|
|
|
|
typedef struct _GLFWcontext _GLFWcontext;
|
|
|
|
typedef struct _GLFWwindow _GLFWwindow;
|
|
|
|
typedef struct _GLFWlibrary _GLFWlibrary;
|
|
|
|
typedef struct _GLFWmonitor _GLFWmonitor;
|
|
|
|
typedef struct _GLFWcursor _GLFWcursor;
|
2017-06-18 13:13:25 +00:00
|
|
|
typedef struct _GLFWmapelement _GLFWmapelement;
|
|
|
|
typedef struct _GLFWmapping _GLFWmapping;
|
2017-01-05 18:44:15 +00:00
|
|
|
typedef struct _GLFWjoystick _GLFWjoystick;
|
2017-03-08 12:58:09 +00:00
|
|
|
typedef struct _GLFWtls _GLFWtls;
|
2017-05-25 16:23:09 +00:00
|
|
|
typedef struct _GLFWmutex _GLFWmutex;
|
2015-08-10 18:19:04 +00:00
|
|
|
|
2016-03-28 11:19:31 +00:00
|
|
|
typedef void (* _GLFWmakecontextcurrentfun)(_GLFWwindow*);
|
|
|
|
typedef void (* _GLFWswapbuffersfun)(_GLFWwindow*);
|
|
|
|
typedef void (* _GLFWswapintervalfun)(int);
|
|
|
|
typedef int (* _GLFWextensionsupportedfun)(const char*);
|
|
|
|
typedef GLFWglproc (* _GLFWgetprocaddressfun)(const char*);
|
|
|
|
typedef void (* _GLFWdestroycontextfun)(_GLFWwindow*);
|
|
|
|
|
2015-08-23 23:27:20 +00:00
|
|
|
#define GL_VERSION 0x1f02
|
|
|
|
#define GL_NONE 0
|
|
|
|
#define GL_COLOR_BUFFER_BIT 0x00004000
|
2016-10-13 15:24:51 +00:00
|
|
|
#define GL_UNSIGNED_BYTE 0x1401
|
2015-08-23 23:27:20 +00:00
|
|
|
#define GL_EXTENSIONS 0x1f03
|
|
|
|
#define GL_NUM_EXTENSIONS 0x821d
|
|
|
|
#define GL_CONTEXT_FLAGS 0x821e
|
|
|
|
#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001
|
|
|
|
#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
|
|
|
|
#define GL_CONTEXT_PROFILE_MASK 0x9126
|
|
|
|
#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
|
|
|
|
#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
|
|
|
|
#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
|
|
|
|
#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
|
|
|
|
#define GL_NO_RESET_NOTIFICATION_ARB 0x8261
|
|
|
|
#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82fb
|
|
|
|
#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82fc
|
2015-08-10 10:46:14 +00:00
|
|
|
#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008
|
2015-08-23 23:27:20 +00:00
|
|
|
|
|
|
|
typedef int GLint;
|
|
|
|
typedef unsigned int GLuint;
|
|
|
|
typedef unsigned int GLenum;
|
|
|
|
typedef unsigned int GLbitfield;
|
|
|
|
typedef unsigned char GLubyte;
|
2013-01-15 21:43:44 +00:00
|
|
|
|
2015-08-11 22:59:26 +00:00
|
|
|
typedef void (APIENTRY * PFNGLCLEARPROC)(GLbitfield);
|
|
|
|
typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGPROC)(GLenum);
|
|
|
|
typedef void (APIENTRY * PFNGLGETINTEGERVPROC)(GLenum,GLint*);
|
2015-08-23 23:27:20 +00:00
|
|
|
typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGIPROC)(GLenum,GLuint);
|
2015-08-11 22:59:26 +00:00
|
|
|
|
2015-08-10 18:19:04 +00:00
|
|
|
#define VK_NULL_HANDLE 0
|
2013-01-15 21:43:44 +00:00
|
|
|
|
2016-02-16 20:40:01 +00:00
|
|
|
typedef void* VkInstance;
|
|
|
|
typedef void* VkPhysicalDevice;
|
2016-03-23 09:09:07 +00:00
|
|
|
typedef uint64_t VkSurfaceKHR;
|
2016-03-23 09:24:01 +00:00
|
|
|
typedef uint32_t VkFlags;
|
|
|
|
typedef uint32_t VkBool32;
|
2015-08-10 18:19:04 +00:00
|
|
|
|
|
|
|
typedef enum VkStructureType
|
|
|
|
{
|
|
|
|
VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
|
|
|
|
VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
|
|
|
|
VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
|
|
|
|
VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
|
|
|
|
VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
|
2016-10-13 23:46:56 +00:00
|
|
|
VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000053000,
|
2015-08-10 18:19:04 +00:00
|
|
|
VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF
|
|
|
|
} VkStructureType;
|
|
|
|
|
|
|
|
typedef enum VkResult
|
|
|
|
{
|
|
|
|
VK_SUCCESS = 0,
|
|
|
|
VK_NOT_READY = 1,
|
|
|
|
VK_TIMEOUT = 2,
|
|
|
|
VK_EVENT_SET = 3,
|
|
|
|
VK_EVENT_RESET = 4,
|
|
|
|
VK_INCOMPLETE = 5,
|
|
|
|
VK_ERROR_OUT_OF_HOST_MEMORY = -1,
|
|
|
|
VK_ERROR_OUT_OF_DEVICE_MEMORY = -2,
|
|
|
|
VK_ERROR_INITIALIZATION_FAILED = -3,
|
|
|
|
VK_ERROR_DEVICE_LOST = -4,
|
|
|
|
VK_ERROR_MEMORY_MAP_FAILED = -5,
|
|
|
|
VK_ERROR_LAYER_NOT_PRESENT = -6,
|
|
|
|
VK_ERROR_EXTENSION_NOT_PRESENT = -7,
|
|
|
|
VK_ERROR_FEATURE_NOT_PRESENT = -8,
|
|
|
|
VK_ERROR_INCOMPATIBLE_DRIVER = -9,
|
|
|
|
VK_ERROR_TOO_MANY_OBJECTS = -10,
|
|
|
|
VK_ERROR_FORMAT_NOT_SUPPORTED = -11,
|
|
|
|
VK_ERROR_SURFACE_LOST_KHR = -1000000000,
|
|
|
|
VK_SUBOPTIMAL_KHR = 1000001003,
|
|
|
|
VK_ERROR_OUT_OF_DATE_KHR = -1000001004,
|
|
|
|
VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001,
|
|
|
|
VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001,
|
|
|
|
VK_ERROR_VALIDATION_FAILED_EXT = -1000011001,
|
|
|
|
VK_RESULT_MAX_ENUM = 0x7FFFFFFF
|
|
|
|
} VkResult;
|
|
|
|
|
|
|
|
typedef struct VkAllocationCallbacks VkAllocationCallbacks;
|
|
|
|
|
|
|
|
typedef struct VkExtensionProperties
|
|
|
|
{
|
|
|
|
char extensionName[256];
|
2016-03-23 09:24:01 +00:00
|
|
|
uint32_t specVersion;
|
2015-08-10 18:19:04 +00:00
|
|
|
} VkExtensionProperties;
|
|
|
|
|
|
|
|
typedef void (APIENTRY * PFN_vkVoidFunction)(void);
|
|
|
|
|
2016-08-03 18:20:30 +00:00
|
|
|
#if defined(_GLFW_VULKAN_STATIC)
|
|
|
|
PFN_vkVoidFunction vkGetInstanceProcAddr(VkInstance,const char*);
|
|
|
|
VkResult vkEnumerateInstanceExtensionProperties(const char*,uint32_t*,VkExtensionProperties*);
|
|
|
|
#else
|
|
|
|
typedef PFN_vkVoidFunction (APIENTRY * PFN_vkGetInstanceProcAddr)(VkInstance,const char*);
|
|
|
|
typedef VkResult (APIENTRY * PFN_vkEnumerateInstanceExtensionProperties)(const char*,uint32_t*,VkExtensionProperties*);
|
|
|
|
#define vkEnumerateInstanceExtensionProperties _glfw.vk.EnumerateInstanceExtensionProperties
|
|
|
|
#define vkGetInstanceProcAddr _glfw.vk.GetInstanceProcAddr
|
|
|
|
#endif
|
2015-08-23 17:30:04 +00:00
|
|
|
|
2013-01-15 21:43:44 +00:00
|
|
|
#if defined(_GLFW_COCOA)
|
|
|
|
#include "cocoa_platform.h"
|
|
|
|
#elif defined(_GLFW_WIN32)
|
|
|
|
#include "win32_platform.h"
|
|
|
|
#elif defined(_GLFW_X11)
|
|
|
|
#include "x11_platform.h"
|
2014-03-17 21:53:43 +00:00
|
|
|
#elif defined(_GLFW_WAYLAND)
|
2014-04-08 15:20:42 +00:00
|
|
|
#include "wl_platform.h"
|
2014-11-06 08:15:37 +00:00
|
|
|
#elif defined(_GLFW_MIR)
|
|
|
|
#include "mir_platform.h"
|
2016-08-30 22:53:19 +00:00
|
|
|
#elif defined(_GLFW_OSMESA)
|
2017-02-28 19:27:10 +00:00
|
|
|
#include "null_platform.h"
|
2013-01-15 21:43:44 +00:00
|
|
|
#else
|
|
|
|
#error "No supported window creation API selected"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2013-01-02 01:21:38 +00:00
|
|
|
//========================================================================
|
|
|
|
// Doxygen group definitions
|
|
|
|
//========================================================================
|
|
|
|
|
2013-02-14 12:14:17 +00:00
|
|
|
/*! @defgroup platform Platform interface
|
|
|
|
* @brief The interface implemented by the platform-specific code.
|
2013-01-02 01:21:38 +00:00
|
|
|
*
|
|
|
|
* The platform API is the interface exposed by the platform-specific code for
|
|
|
|
* each platform and is called by the shared code of the public API It mirrors
|
|
|
|
* the public API except it uses objects instead of handles.
|
|
|
|
*/
|
2013-02-14 12:14:17 +00:00
|
|
|
/*! @defgroup event Event interface
|
|
|
|
* @brief The interface used by the platform-specific code to report events.
|
2013-01-02 01:21:38 +00:00
|
|
|
*
|
|
|
|
* The event API is used by the platform-specific code to notify the shared
|
|
|
|
* code of events that can be translated into state changes and/or callback
|
|
|
|
* calls.
|
|
|
|
*/
|
|
|
|
/*! @defgroup utility Utility functions
|
2013-02-14 12:14:17 +00:00
|
|
|
* @brief Various utility functions for internal use.
|
2013-01-02 01:21:38 +00:00
|
|
|
*
|
|
|
|
* These functions are shared code and may be used by any part of GLFW
|
2015-12-13 13:07:27 +00:00
|
|
|
* Each platform may add its own utility functions, but those must only be
|
2013-01-02 01:21:38 +00:00
|
|
|
* called by the platform-specific code
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2010-09-07 15:34:51 +00:00
|
|
|
//========================================================================
|
2013-01-15 21:43:44 +00:00
|
|
|
// Helper macros
|
2010-09-07 15:34:51 +00:00
|
|
|
//========================================================================
|
|
|
|
|
2015-11-05 11:08:27 +00:00
|
|
|
// Constructs a version number string from the public header macros
|
|
|
|
#define _GLFW_CONCAT_VERSION(m, n, r) #m "." #n "." #r
|
|
|
|
#define _GLFW_MAKE_VERSION(m, n, r) _GLFW_CONCAT_VERSION(m, n, r)
|
|
|
|
#define _GLFW_VERSION_NUMBER _GLFW_MAKE_VERSION(GLFW_VERSION_MAJOR, \
|
|
|
|
GLFW_VERSION_MINOR, \
|
|
|
|
GLFW_VERSION_REVISION)
|
|
|
|
|
2015-01-05 20:55:15 +00:00
|
|
|
// Checks for whether the library has been initialized
|
2013-02-19 23:28:08 +00:00
|
|
|
#define _GLFW_REQUIRE_INIT() \
|
2017-02-06 14:58:15 +00:00
|
|
|
if (!_glfw.initialized) \
|
2013-02-19 23:28:08 +00:00
|
|
|
{ \
|
|
|
|
_glfwInputError(GLFW_NOT_INITIALIZED, NULL); \
|
|
|
|
return; \
|
|
|
|
}
|
|
|
|
#define _GLFW_REQUIRE_INIT_OR_RETURN(x) \
|
2017-02-06 14:58:15 +00:00
|
|
|
if (!_glfw.initialized) \
|
2013-02-19 23:28:08 +00:00
|
|
|
{ \
|
|
|
|
_glfwInputError(GLFW_NOT_INITIALIZED, NULL); \
|
|
|
|
return x; \
|
|
|
|
}
|
|
|
|
|
2013-07-30 12:43:01 +00:00
|
|
|
// Swaps the provided pointers
|
|
|
|
#define _GLFW_SWAP_POINTERS(x, y) \
|
|
|
|
{ \
|
|
|
|
void* t; \
|
|
|
|
t = x; \
|
|
|
|
x = y; \
|
|
|
|
y = t; \
|
|
|
|
}
|
|
|
|
|
2010-09-07 15:34:51 +00:00
|
|
|
|
2012-04-22 19:49:38 +00:00
|
|
|
//========================================================================
|
2014-09-02 17:42:43 +00:00
|
|
|
// Platform-independent structures
|
2013-01-02 01:21:38 +00:00
|
|
|
//========================================================================
|
|
|
|
|
2017-05-25 16:23:09 +00:00
|
|
|
struct _GLFWerror
|
|
|
|
{
|
|
|
|
_GLFWerror* next;
|
|
|
|
int code;
|
2017-08-17 12:25:10 +00:00
|
|
|
char description[_GLFW_MESSAGE_SIZE];
|
2017-05-25 16:23:09 +00:00
|
|
|
};
|
|
|
|
|
2017-02-14 14:43:31 +00:00
|
|
|
/*! @brief Initialization configuration.
|
|
|
|
*
|
|
|
|
* Parameters relating to the initialization of the library.
|
|
|
|
*/
|
|
|
|
struct _GLFWinitconfig
|
|
|
|
{
|
2017-03-01 22:27:20 +00:00
|
|
|
GLFWbool hatButtons;
|
2017-02-14 14:43:31 +00:00
|
|
|
struct {
|
|
|
|
GLFWbool menubar;
|
|
|
|
GLFWbool chdir;
|
|
|
|
} ns;
|
|
|
|
};
|
|
|
|
|
2014-03-06 19:05:32 +00:00
|
|
|
/*! @brief Window configuration.
|
2013-01-02 01:21:38 +00:00
|
|
|
*
|
2014-03-06 19:05:32 +00:00
|
|
|
* Parameters relating to the creation of the window but not directly related
|
2014-05-21 09:19:38 +00:00
|
|
|
* to the framebuffer. This is used to pass window creation parameters from
|
2014-03-06 19:05:32 +00:00
|
|
|
* shared code to the platform API.
|
2013-01-02 01:21:38 +00:00
|
|
|
*/
|
2010-10-04 16:17:53 +00:00
|
|
|
struct _GLFWwndconfig
|
2010-09-09 18:18:10 +00:00
|
|
|
{
|
2012-11-25 13:53:33 +00:00
|
|
|
int width;
|
|
|
|
int height;
|
2010-10-04 16:17:53 +00:00
|
|
|
const char* title;
|
2015-08-23 17:30:04 +00:00
|
|
|
GLFWbool resizable;
|
|
|
|
GLFWbool visible;
|
|
|
|
GLFWbool decorated;
|
|
|
|
GLFWbool focused;
|
|
|
|
GLFWbool autoIconify;
|
|
|
|
GLFWbool floating;
|
2015-10-13 10:50:59 +00:00
|
|
|
GLFWbool maximized;
|
2016-08-18 15:47:54 +00:00
|
|
|
GLFWbool centerCursor;
|
2016-12-06 23:41:54 +00:00
|
|
|
struct {
|
|
|
|
GLFWbool retina;
|
2017-12-12 15:45:38 +00:00
|
|
|
char frameName[256];
|
2016-12-06 23:41:54 +00:00
|
|
|
} ns;
|
2017-12-12 09:54:18 +00:00
|
|
|
struct {
|
|
|
|
char className[256];
|
|
|
|
char instanceName[256];
|
|
|
|
} x11;
|
2014-03-06 19:05:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*! @brief Context configuration.
|
|
|
|
*
|
|
|
|
* Parameters relating to the creation of the context but not directly related
|
|
|
|
* to the framebuffer. This is used to pass context creation parameters from
|
|
|
|
* shared code to the platform API.
|
|
|
|
*/
|
|
|
|
struct _GLFWctxconfig
|
|
|
|
{
|
2016-03-28 11:19:31 +00:00
|
|
|
int client;
|
|
|
|
int source;
|
2014-03-06 19:05:32 +00:00
|
|
|
int major;
|
|
|
|
int minor;
|
2015-08-23 17:30:04 +00:00
|
|
|
GLFWbool forward;
|
|
|
|
GLFWbool debug;
|
2015-08-10 10:46:14 +00:00
|
|
|
GLFWbool noerror;
|
2014-03-06 19:05:32 +00:00
|
|
|
int profile;
|
|
|
|
int robustness;
|
2014-08-21 17:21:45 +00:00
|
|
|
int release;
|
2010-10-04 16:17:53 +00:00
|
|
|
_GLFWwindow* share;
|
2017-01-27 11:02:09 +00:00
|
|
|
struct {
|
|
|
|
GLFWbool offline;
|
|
|
|
} nsgl;
|
2010-10-04 16:17:53 +00:00
|
|
|
};
|
2010-09-07 15:34:51 +00:00
|
|
|
|
2013-01-02 01:21:38 +00:00
|
|
|
/*! @brief Framebuffer configuration.
|
|
|
|
*
|
2013-05-13 13:49:59 +00:00
|
|
|
* This describes buffers and their sizes. It also contains
|
2015-01-05 20:55:15 +00:00
|
|
|
* a platform-specific ID used to map back to the backend API object.
|
2013-05-13 13:49:59 +00:00
|
|
|
*
|
|
|
|
* It is used to pass framebuffer parameters from shared code to the platform
|
|
|
|
* API and also to enumerate and select available framebuffer configs.
|
2013-01-02 01:21:38 +00:00
|
|
|
*/
|
2010-10-04 16:17:53 +00:00
|
|
|
struct _GLFWfbconfig
|
2010-09-09 18:18:10 +00:00
|
|
|
{
|
2010-09-07 15:34:51 +00:00
|
|
|
int redBits;
|
|
|
|
int greenBits;
|
|
|
|
int blueBits;
|
|
|
|
int alphaBits;
|
|
|
|
int depthBits;
|
|
|
|
int stencilBits;
|
|
|
|
int accumRedBits;
|
|
|
|
int accumGreenBits;
|
|
|
|
int accumBlueBits;
|
|
|
|
int accumAlphaBits;
|
|
|
|
int auxBuffers;
|
2015-12-10 16:10:05 +00:00
|
|
|
GLFWbool stereo;
|
2010-09-07 15:34:51 +00:00
|
|
|
int samples;
|
2015-12-10 16:10:05 +00:00
|
|
|
GLFWbool sRGB;
|
|
|
|
GLFWbool doublebuffer;
|
2017-09-19 16:27:45 +00:00
|
|
|
GLFWbool transparent;
|
2016-03-28 18:11:22 +00:00
|
|
|
uintptr_t handle;
|
2010-10-04 16:17:53 +00:00
|
|
|
};
|
2010-09-07 15:34:51 +00:00
|
|
|
|
2015-11-09 15:48:55 +00:00
|
|
|
/*! @brief Context structure.
|
|
|
|
*/
|
|
|
|
struct _GLFWcontext
|
|
|
|
{
|
2016-03-28 11:19:31 +00:00
|
|
|
int client;
|
|
|
|
int source;
|
2015-11-09 15:48:55 +00:00
|
|
|
int major, minor, revision;
|
|
|
|
GLFWbool forward, debug, noerror;
|
|
|
|
int profile;
|
|
|
|
int robustness;
|
|
|
|
int release;
|
|
|
|
|
|
|
|
PFNGLGETSTRINGIPROC GetStringi;
|
|
|
|
PFNGLGETINTEGERVPROC GetIntegerv;
|
|
|
|
PFNGLGETSTRINGPROC GetString;
|
|
|
|
|
2016-05-25 12:43:51 +00:00
|
|
|
_GLFWmakecontextcurrentfun makeCurrent;
|
2016-03-28 11:19:31 +00:00
|
|
|
_GLFWswapbuffersfun swapBuffers;
|
|
|
|
_GLFWswapintervalfun swapInterval;
|
|
|
|
_GLFWextensionsupportedfun extensionSupported;
|
|
|
|
_GLFWgetprocaddressfun getProcAddress;
|
2016-05-25 12:43:51 +00:00
|
|
|
_GLFWdestroycontextfun destroy;
|
2016-03-28 11:19:31 +00:00
|
|
|
|
2015-11-09 15:48:55 +00:00
|
|
|
// This is defined in the context API's context.h
|
|
|
|
_GLFW_PLATFORM_CONTEXT_STATE;
|
2016-03-28 11:19:31 +00:00
|
|
|
// This is defined in egl_context.h
|
|
|
|
_GLFW_EGL_CONTEXT_STATE;
|
2017-02-28 18:23:25 +00:00
|
|
|
// This is defined in osmesa_context.h
|
|
|
|
_GLFW_OSMESA_CONTEXT_STATE;
|
2015-11-09 15:48:55 +00:00
|
|
|
};
|
|
|
|
|
2013-01-02 01:21:38 +00:00
|
|
|
/*! @brief Window and context structure.
|
|
|
|
*/
|
2010-10-04 16:17:53 +00:00
|
|
|
struct _GLFWwindow
|
2010-09-09 18:18:10 +00:00
|
|
|
{
|
2010-09-09 22:06:23 +00:00
|
|
|
struct _GLFWwindow* next;
|
|
|
|
|
2010-09-09 18:18:10 +00:00
|
|
|
// Window settings and state
|
2015-08-23 17:30:04 +00:00
|
|
|
GLFWbool resizable;
|
|
|
|
GLFWbool decorated;
|
|
|
|
GLFWbool autoIconify;
|
|
|
|
GLFWbool floating;
|
2016-12-08 13:53:01 +00:00
|
|
|
GLFWbool shouldClose;
|
2013-01-02 15:48:02 +00:00
|
|
|
void* userPointer;
|
2013-01-02 16:29:24 +00:00
|
|
|
GLFWvidmode videoMode;
|
2013-01-02 15:48:02 +00:00
|
|
|
_GLFWmonitor* monitor;
|
2013-12-04 13:19:22 +00:00
|
|
|
_GLFWcursor* cursor;
|
2010-09-09 16:15:32 +00:00
|
|
|
|
2016-02-23 11:26:42 +00:00
|
|
|
int minwidth, minheight;
|
|
|
|
int maxwidth, maxheight;
|
|
|
|
int numer, denom;
|
|
|
|
|
2015-08-23 17:30:04 +00:00
|
|
|
GLFWbool stickyKeys;
|
|
|
|
GLFWbool stickyMouseButtons;
|
2017-11-29 19:42:37 +00:00
|
|
|
GLFWbool lockKeyMods;
|
2013-01-02 15:48:02 +00:00
|
|
|
int cursorMode;
|
2014-05-18 19:28:11 +00:00
|
|
|
char mouseButtons[GLFW_MOUSE_BUTTON_LAST + 1];
|
|
|
|
char keys[GLFW_KEY_LAST + 1];
|
2016-05-24 10:23:58 +00:00
|
|
|
// Virtual cursor position when cursor is disabled
|
|
|
|
double virtualCursorPosX, virtualCursorPosY;
|
2010-09-09 16:15:32 +00:00
|
|
|
|
2015-11-09 15:48:55 +00:00
|
|
|
_GLFWcontext context;
|
2010-09-09 16:15:32 +00:00
|
|
|
|
2013-01-15 20:34:26 +00:00
|
|
|
struct {
|
2013-06-03 10:51:57 +00:00
|
|
|
GLFWwindowposfun pos;
|
|
|
|
GLFWwindowsizefun size;
|
|
|
|
GLFWwindowclosefun close;
|
|
|
|
GLFWwindowrefreshfun refresh;
|
|
|
|
GLFWwindowfocusfun focus;
|
|
|
|
GLFWwindowiconifyfun iconify;
|
2016-06-16 11:09:28 +00:00
|
|
|
GLFWwindowmaximizefun maximize;
|
2013-06-03 10:51:57 +00:00
|
|
|
GLFWframebuffersizefun fbsize;
|
|
|
|
GLFWmousebuttonfun mouseButton;
|
|
|
|
GLFWcursorposfun cursorPos;
|
|
|
|
GLFWcursorenterfun cursorEnter;
|
|
|
|
GLFWscrollfun scroll;
|
|
|
|
GLFWkeyfun key;
|
|
|
|
GLFWcharfun character;
|
2014-06-12 21:04:20 +00:00
|
|
|
GLFWcharmodsfun charmods;
|
2013-07-10 09:42:14 +00:00
|
|
|
GLFWdropfun drop;
|
2013-01-15 20:34:26 +00:00
|
|
|
} callbacks;
|
2012-10-28 12:45:11 +00:00
|
|
|
|
2013-01-02 01:21:38 +00:00
|
|
|
// This is defined in the window API's platform.h
|
2010-09-09 16:15:32 +00:00
|
|
|
_GLFW_PLATFORM_WINDOW_STATE;
|
2010-10-04 16:17:53 +00:00
|
|
|
};
|
2010-09-09 16:15:32 +00:00
|
|
|
|
2013-01-02 01:21:38 +00:00
|
|
|
/*! @brief Monitor structure.
|
|
|
|
*/
|
2011-10-03 07:24:35 +00:00
|
|
|
struct _GLFWmonitor
|
2011-05-07 08:53:50 +00:00
|
|
|
{
|
2013-01-02 15:48:02 +00:00
|
|
|
char* name;
|
2017-12-07 15:19:57 +00:00
|
|
|
void* userPointer;
|
2012-09-13 15:46:40 +00:00
|
|
|
|
2013-01-02 15:48:02 +00:00
|
|
|
// Physical dimensions in millimeters.
|
|
|
|
int widthMM, heightMM;
|
2011-10-02 20:13:47 +00:00
|
|
|
|
2016-02-23 11:34:35 +00:00
|
|
|
// The window whose video mode is current on this monitor
|
|
|
|
_GLFWwindow* window;
|
|
|
|
|
2013-01-02 15:48:02 +00:00
|
|
|
GLFWvidmode* modes;
|
|
|
|
int modeCount;
|
2013-05-22 20:16:43 +00:00
|
|
|
GLFWvidmode currentMode;
|
2012-08-03 00:57:33 +00:00
|
|
|
|
2013-02-12 12:50:41 +00:00
|
|
|
GLFWgammaramp originalRamp;
|
2013-05-19 13:46:44 +00:00
|
|
|
GLFWgammaramp currentRamp;
|
2013-02-12 12:50:41 +00:00
|
|
|
|
2013-01-02 01:21:38 +00:00
|
|
|
// This is defined in the window API's platform.h
|
2011-10-03 07:24:35 +00:00
|
|
|
_GLFW_PLATFORM_MONITOR_STATE;
|
2011-05-07 08:53:50 +00:00
|
|
|
};
|
|
|
|
|
2013-12-04 13:19:22 +00:00
|
|
|
/*! @brief Cursor structure
|
|
|
|
*/
|
|
|
|
struct _GLFWcursor
|
|
|
|
{
|
|
|
|
_GLFWcursor* next;
|
|
|
|
|
|
|
|
// This is defined in the window API's platform.h
|
|
|
|
_GLFW_PLATFORM_CURSOR_STATE;
|
|
|
|
};
|
|
|
|
|
2017-06-18 13:13:25 +00:00
|
|
|
/*! @brief Gamepad mapping element structure
|
|
|
|
*/
|
|
|
|
struct _GLFWmapelement
|
|
|
|
{
|
|
|
|
uint8_t type;
|
|
|
|
uint8_t value;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*! @brief Gamepad mapping structure
|
|
|
|
*/
|
|
|
|
struct _GLFWmapping
|
|
|
|
{
|
|
|
|
char name[128];
|
|
|
|
char guid[33];
|
|
|
|
_GLFWmapelement buttons[15];
|
|
|
|
_GLFWmapelement axes[6];
|
|
|
|
};
|
|
|
|
|
2017-01-05 18:44:15 +00:00
|
|
|
/*! @brief Joystick structure
|
|
|
|
*/
|
|
|
|
struct _GLFWjoystick
|
|
|
|
{
|
|
|
|
GLFWbool present;
|
|
|
|
float* axes;
|
|
|
|
int axisCount;
|
|
|
|
unsigned char* buttons;
|
|
|
|
int buttonCount;
|
2017-03-01 22:27:20 +00:00
|
|
|
unsigned char* hats;
|
|
|
|
int hatCount;
|
2017-01-05 18:44:15 +00:00
|
|
|
char* name;
|
2017-12-07 15:19:57 +00:00
|
|
|
void* userPointer;
|
2017-06-18 13:13:25 +00:00
|
|
|
char guid[33];
|
|
|
|
_GLFWmapping* mapping;
|
2017-01-05 18:44:15 +00:00
|
|
|
|
|
|
|
// This is defined in the joystick API's joystick.h
|
|
|
|
_GLFW_PLATFORM_JOYSTICK_STATE;
|
|
|
|
};
|
|
|
|
|
2017-03-08 12:58:09 +00:00
|
|
|
/*! @brief Thread local storage structure.
|
|
|
|
*/
|
|
|
|
struct _GLFWtls
|
|
|
|
{
|
2017-05-25 17:25:47 +00:00
|
|
|
// This is defined in the platform's thread.h
|
2017-03-08 12:58:09 +00:00
|
|
|
_GLFW_PLATFORM_TLS_STATE;
|
|
|
|
};
|
|
|
|
|
2017-05-25 16:23:09 +00:00
|
|
|
/*! @brief Mutex structure.
|
|
|
|
*/
|
|
|
|
struct _GLFWmutex
|
|
|
|
{
|
2017-05-25 17:25:47 +00:00
|
|
|
// This is defined in the platform's thread.h
|
2017-05-25 16:23:09 +00:00
|
|
|
_GLFW_PLATFORM_MUTEX_STATE;
|
|
|
|
};
|
|
|
|
|
2013-01-02 01:21:38 +00:00
|
|
|
/*! @brief Library global data.
|
|
|
|
*/
|
2010-10-04 16:17:53 +00:00
|
|
|
struct _GLFWlibrary
|
2010-09-09 18:18:10 +00:00
|
|
|
{
|
2017-02-06 14:58:15 +00:00
|
|
|
GLFWbool initialized;
|
|
|
|
|
2013-04-24 21:47:08 +00:00
|
|
|
struct {
|
2017-02-14 14:43:31 +00:00
|
|
|
_GLFWinitconfig init;
|
2015-06-07 16:22:38 +00:00
|
|
|
_GLFWfbconfig framebuffer;
|
|
|
|
_GLFWwndconfig window;
|
|
|
|
_GLFWctxconfig context;
|
|
|
|
int refreshRate;
|
2013-04-24 21:47:08 +00:00
|
|
|
} hints;
|
2010-09-09 22:06:23 +00:00
|
|
|
|
2017-05-25 16:23:09 +00:00
|
|
|
_GLFWerror* errorListHead;
|
2015-06-07 16:22:38 +00:00
|
|
|
_GLFWcursor* cursorListHead;
|
|
|
|
_GLFWwindow* windowListHead;
|
2012-09-12 17:35:52 +00:00
|
|
|
|
2015-06-07 16:22:38 +00:00
|
|
|
_GLFWmonitor** monitors;
|
|
|
|
int monitorCount;
|
2013-07-30 15:06:06 +00:00
|
|
|
|
2017-01-05 18:44:15 +00:00
|
|
|
_GLFWjoystick joysticks[GLFW_JOYSTICK_LAST + 1];
|
2017-06-18 13:13:25 +00:00
|
|
|
_GLFWmapping* mappings;
|
|
|
|
int mappingCount;
|
2017-01-05 18:44:15 +00:00
|
|
|
|
2017-05-25 16:23:09 +00:00
|
|
|
_GLFWtls errorSlot;
|
|
|
|
_GLFWtls contextSlot;
|
|
|
|
_GLFWmutex errorLock;
|
2017-03-08 12:58:09 +00:00
|
|
|
|
2017-03-18 22:09:34 +00:00
|
|
|
struct {
|
|
|
|
uint64_t offset;
|
|
|
|
// This is defined in the platform's time.h
|
|
|
|
_GLFW_PLATFORM_LIBRARY_TIMER_STATE;
|
|
|
|
} timer;
|
|
|
|
|
2015-08-10 18:19:04 +00:00
|
|
|
struct {
|
|
|
|
GLFWbool available;
|
|
|
|
void* handle;
|
2016-08-22 18:25:52 +00:00
|
|
|
char* extensions[2];
|
2016-08-04 22:23:16 +00:00
|
|
|
#if !defined(_GLFW_VULKAN_STATIC)
|
|
|
|
PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties;
|
|
|
|
PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
|
|
|
|
#endif
|
2015-08-10 18:19:04 +00:00
|
|
|
GLFWbool KHR_surface;
|
2016-09-14 13:21:52 +00:00
|
|
|
#if defined(_GLFW_WIN32)
|
2015-08-10 18:19:04 +00:00
|
|
|
GLFWbool KHR_win32_surface;
|
2016-10-13 23:46:56 +00:00
|
|
|
#elif defined(_GLFW_COCOA)
|
|
|
|
GLFWbool MVK_macos_surface;
|
2016-09-14 13:21:52 +00:00
|
|
|
#elif defined(_GLFW_X11)
|
2015-08-10 18:19:04 +00:00
|
|
|
GLFWbool KHR_xlib_surface;
|
|
|
|
GLFWbool KHR_xcb_surface;
|
2016-09-14 13:21:52 +00:00
|
|
|
#elif defined(_GLFW_WAYLAND)
|
2015-08-10 18:19:04 +00:00
|
|
|
GLFWbool KHR_wayland_surface;
|
2016-09-14 13:21:52 +00:00
|
|
|
#elif defined(_GLFW_MIR)
|
2015-08-10 18:19:04 +00:00
|
|
|
GLFWbool KHR_mir_surface;
|
2016-09-14 13:21:52 +00:00
|
|
|
#endif
|
2015-08-10 18:19:04 +00:00
|
|
|
} vk;
|
|
|
|
|
2013-07-30 15:06:06 +00:00
|
|
|
struct {
|
|
|
|
GLFWmonitorfun monitor;
|
2015-12-13 16:38:50 +00:00
|
|
|
GLFWjoystickfun joystick;
|
2013-07-30 15:06:06 +00:00
|
|
|
} callbacks;
|
2010-10-24 16:28:55 +00:00
|
|
|
|
2013-01-02 01:21:38 +00:00
|
|
|
// This is defined in the window API's platform.h
|
2012-04-22 13:53:02 +00:00
|
|
|
_GLFW_PLATFORM_LIBRARY_WINDOW_STATE;
|
2014-04-08 14:25:35 +00:00
|
|
|
// This is defined in the context API's context.h
|
2014-04-08 14:29:38 +00:00
|
|
|
_GLFW_PLATFORM_LIBRARY_CONTEXT_STATE;
|
2014-03-19 14:27:49 +00:00
|
|
|
// This is defined in the platform's joystick.h
|
|
|
|
_GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE;
|
2016-03-28 11:19:31 +00:00
|
|
|
// This is defined in egl_context.h
|
|
|
|
_GLFW_EGL_LIBRARY_CONTEXT_STATE;
|
2017-02-28 18:23:25 +00:00
|
|
|
// This is defined in osmesa_context.h
|
|
|
|
_GLFW_OSMESA_LIBRARY_CONTEXT_STATE;
|
2010-10-04 16:17:53 +00:00
|
|
|
};
|
2010-09-09 16:15:32 +00:00
|
|
|
|
|
|
|
|
2013-01-02 01:21:38 +00:00
|
|
|
//========================================================================
|
2012-08-26 18:11:32 +00:00
|
|
|
// Global state shared between compilation units of GLFW
|
2013-01-02 01:21:38 +00:00
|
|
|
//========================================================================
|
|
|
|
|
2017-02-06 14:58:15 +00:00
|
|
|
/*! @brief All global data shared between compilation units.
|
2013-01-02 01:21:38 +00:00
|
|
|
*/
|
2013-01-02 00:40:42 +00:00
|
|
|
extern _GLFWlibrary _glfw;
|
2010-09-09 16:15:32 +00:00
|
|
|
|
2010-09-07 15:34:51 +00:00
|
|
|
|
|
|
|
//========================================================================
|
2013-01-02 01:21:38 +00:00
|
|
|
// Platform API functions
|
2010-09-07 15:34:51 +00:00
|
|
|
//========================================================================
|
|
|
|
|
2017-02-28 21:28:36 +00:00
|
|
|
/*! @addtogroup platform @{ */
|
2013-01-02 01:21:38 +00:00
|
|
|
|
2017-02-28 21:28:36 +00:00
|
|
|
int _glfwPlatformInit(void);
|
2012-12-30 00:15:48 +00:00
|
|
|
void _glfwPlatformTerminate(void);
|
2010-09-13 16:05:59 +00:00
|
|
|
const char* _glfwPlatformGetVersionString(void);
|
2010-09-09 19:06:59 +00:00
|
|
|
|
2014-02-11 17:24:01 +00:00
|
|
|
void _glfwPlatformGetCursorPos(_GLFWwindow* window, double* xpos, double* ypos);
|
2013-04-04 14:16:21 +00:00
|
|
|
void _glfwPlatformSetCursorPos(_GLFWwindow* window, double xpos, double ypos);
|
2015-07-02 11:04:56 +00:00
|
|
|
void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode);
|
2017-02-28 21:28:36 +00:00
|
|
|
int _glfwPlatformCreateCursor(_GLFWcursor* cursor, const GLFWimage* image, int xhot, int yhot);
|
|
|
|
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape);
|
|
|
|
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor);
|
|
|
|
void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor);
|
2010-09-07 15:34:51 +00:00
|
|
|
|
2017-07-11 21:00:17 +00:00
|
|
|
const char* _glfwPlatformGetScancodeName(int scancode);
|
2016-09-06 13:40:31 +00:00
|
|
|
int _glfwPlatformGetKeyScancode(int key);
|
2016-08-11 17:11:40 +00:00
|
|
|
|
2013-02-20 15:00:53 +00:00
|
|
|
void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos);
|
2017-08-29 17:19:00 +00:00
|
|
|
void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor, float* xscale, float* yscale);
|
2012-08-03 00:57:33 +00:00
|
|
|
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count);
|
2012-08-29 23:53:23 +00:00
|
|
|
void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode);
|
2013-02-12 12:50:41 +00:00
|
|
|
void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp);
|
|
|
|
void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp);
|
2010-10-13 02:04:43 +00:00
|
|
|
|
2017-11-04 20:11:58 +00:00
|
|
|
void _glfwPlatformSetClipboardString(const char* string);
|
|
|
|
const char* _glfwPlatformGetClipboardString(void);
|
2011-09-21 09:09:47 +00:00
|
|
|
|
2017-07-09 12:01:48 +00:00
|
|
|
int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode);
|
2017-06-18 13:13:25 +00:00
|
|
|
void _glfwPlatformUpdateGamepadGUID(char* guid);
|
2010-09-07 15:34:51 +00:00
|
|
|
|
2016-03-23 09:09:07 +00:00
|
|
|
uint64_t _glfwPlatformGetTimerValue(void);
|
|
|
|
uint64_t _glfwPlatformGetTimerFrequency(void);
|
2010-09-07 15:34:51 +00:00
|
|
|
|
2013-01-02 01:21:38 +00:00
|
|
|
int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|
|
|
const _GLFWwndconfig* wndconfig,
|
2014-03-06 19:05:32 +00:00
|
|
|
const _GLFWctxconfig* ctxconfig,
|
2013-01-02 01:21:38 +00:00
|
|
|
const _GLFWfbconfig* fbconfig);
|
2012-08-06 15:56:41 +00:00
|
|
|
void _glfwPlatformDestroyWindow(_GLFWwindow* window);
|
2010-09-09 16:15:32 +00:00
|
|
|
void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title);
|
2016-03-07 13:55:30 +00:00
|
|
|
void _glfwPlatformSetWindowIcon(_GLFWwindow* window, int count, const GLFWimage* images);
|
2013-01-24 18:30:31 +00:00
|
|
|
void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos);
|
|
|
|
void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos);
|
2012-11-25 13:53:33 +00:00
|
|
|
void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height);
|
2010-09-09 16:15:32 +00:00
|
|
|
void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height);
|
2014-02-13 01:57:59 +00:00
|
|
|
void _glfwPlatformSetWindowSizeLimits(_GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight);
|
|
|
|
void _glfwPlatformSetWindowAspectRatio(_GLFWwindow* window, int numer, int denom);
|
2013-06-03 10:51:57 +00:00
|
|
|
void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height);
|
2014-03-25 20:30:13 +00:00
|
|
|
void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window, int* left, int* top, int* right, int* bottom);
|
2017-08-29 17:19:00 +00:00
|
|
|
void _glfwPlatformGetWindowContentScale(_GLFWwindow* window, float* xscale, float* yscale);
|
2010-09-09 16:15:32 +00:00
|
|
|
void _glfwPlatformIconifyWindow(_GLFWwindow* window);
|
|
|
|
void _glfwPlatformRestoreWindow(_GLFWwindow* window);
|
2015-10-13 10:50:59 +00:00
|
|
|
void _glfwPlatformMaximizeWindow(_GLFWwindow* window);
|
2012-08-21 18:01:57 +00:00
|
|
|
void _glfwPlatformShowWindow(_GLFWwindow* window);
|
|
|
|
void _glfwPlatformHideWindow(_GLFWwindow* window);
|
2017-05-11 12:36:56 +00:00
|
|
|
void _glfwPlatformRequestWindowAttention(_GLFWwindow* window);
|
2016-02-21 14:42:49 +00:00
|
|
|
void _glfwPlatformFocusWindow(_GLFWwindow* window);
|
2016-02-23 11:26:42 +00:00
|
|
|
void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, _GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate);
|
2014-12-26 11:25:48 +00:00
|
|
|
int _glfwPlatformWindowFocused(_GLFWwindow* window);
|
|
|
|
int _glfwPlatformWindowIconified(_GLFWwindow* window);
|
|
|
|
int _glfwPlatformWindowVisible(_GLFWwindow* window);
|
2015-10-13 10:50:59 +00:00
|
|
|
int _glfwPlatformWindowMaximized(_GLFWwindow* window);
|
2017-09-18 16:10:57 +00:00
|
|
|
int _glfwPlatformFramebufferTransparent(_GLFWwindow* window);
|
2017-09-25 21:14:45 +00:00
|
|
|
float _glfwPlatformGetWindowOpacity(_GLFWwindow* window);
|
2016-09-29 23:52:22 +00:00
|
|
|
void _glfwPlatformSetWindowResizable(_GLFWwindow* window, GLFWbool enabled);
|
|
|
|
void _glfwPlatformSetWindowDecorated(_GLFWwindow* window, GLFWbool enabled);
|
|
|
|
void _glfwPlatformSetWindowFloating(_GLFWwindow* window, GLFWbool enabled);
|
2017-09-25 21:14:45 +00:00
|
|
|
void _glfwPlatformSetWindowOpacity(_GLFWwindow* window, float opacity);
|
2016-09-29 23:52:22 +00:00
|
|
|
|
2010-09-09 16:15:32 +00:00
|
|
|
void _glfwPlatformPollEvents(void);
|
|
|
|
void _glfwPlatformWaitEvents(void);
|
2016-02-02 20:11:16 +00:00
|
|
|
void _glfwPlatformWaitEventsTimeout(double timeout);
|
2014-02-10 17:16:58 +00:00
|
|
|
void _glfwPlatformPostEmptyEvent(void);
|
|
|
|
|
2016-08-22 18:25:52 +00:00
|
|
|
void _glfwPlatformGetRequiredInstanceExtensions(char** extensions);
|
2016-03-23 09:24:01 +00:00
|
|
|
int _glfwPlatformGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily);
|
2015-08-10 18:19:04 +00:00
|
|
|
VkResult _glfwPlatformCreateWindowSurface(VkInstance instance, _GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface);
|
|
|
|
|
2017-03-08 12:58:09 +00:00
|
|
|
GLFWbool _glfwPlatformCreateTls(_GLFWtls* tls);
|
|
|
|
void _glfwPlatformDestroyTls(_GLFWtls* tls);
|
|
|
|
void* _glfwPlatformGetTls(_GLFWtls* tls);
|
|
|
|
void _glfwPlatformSetTls(_GLFWtls* tls, void* value);
|
2017-05-25 16:23:09 +00:00
|
|
|
|
|
|
|
GLFWbool _glfwPlatformCreateMutex(_GLFWmutex* mutex);
|
|
|
|
void _glfwPlatformDestroyMutex(_GLFWmutex* mutex);
|
|
|
|
void _glfwPlatformLockMutex(_GLFWmutex* mutex);
|
|
|
|
void _glfwPlatformUnlockMutex(_GLFWmutex* mutex);
|
2017-03-08 12:58:09 +00:00
|
|
|
|
2017-02-28 21:28:36 +00:00
|
|
|
/*! @} */
|
|
|
|
|
2014-09-02 17:42:43 +00:00
|
|
|
|
2010-09-07 15:34:51 +00:00
|
|
|
//========================================================================
|
2013-01-02 01:21:38 +00:00
|
|
|
// Event API functions
|
2010-09-07 15:34:51 +00:00
|
|
|
//========================================================================
|
|
|
|
|
2017-02-06 16:31:25 +00:00
|
|
|
/*! @brief Notifies shared code that a window has lost or received input focus.
|
2013-01-02 01:21:38 +00:00
|
|
|
* @param[in] window The window that received the event.
|
2015-08-23 17:30:04 +00:00
|
|
|
* @param[in] focused `GLFW_TRUE` if the window received focus, or `GLFW_FALSE`
|
2013-01-02 01:21:38 +00:00
|
|
|
* if it lost focus.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
2015-08-23 17:30:04 +00:00
|
|
|
void _glfwInputWindowFocus(_GLFWwindow* window, GLFWbool focused);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
2017-02-06 16:31:25 +00:00
|
|
|
/*! @brief Notifies shared code that a window has moved.
|
2013-01-02 01:21:38 +00:00
|
|
|
* @param[in] window The window that received the event.
|
2013-02-14 12:14:17 +00:00
|
|
|
* @param[in] xpos The new x-coordinate of the client area of the window.
|
|
|
|
* @param[in] ypos The new y-coordinate of the client area of the window.
|
2013-01-02 01:21:38 +00:00
|
|
|
* @ingroup event
|
|
|
|
*/
|
2013-02-14 12:14:17 +00:00
|
|
|
void _glfwInputWindowPos(_GLFWwindow* window, int xpos, int ypos);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
2017-02-06 16:31:25 +00:00
|
|
|
/*! @brief Notifies shared code that a window has been resized.
|
2013-01-02 01:21:38 +00:00
|
|
|
* @param[in] window The window that received the event.
|
|
|
|
* @param[in] width The new width of the client area of the window.
|
|
|
|
* @param[in] height The new height of the client area of the window.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
2011-10-09 15:10:40 +00:00
|
|
|
void _glfwInputWindowSize(_GLFWwindow* window, int width, int height);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
2017-02-06 16:31:25 +00:00
|
|
|
/*! @brief Notifies shared code that a window framebuffer has been resized.
|
2013-06-03 10:51:57 +00:00
|
|
|
* @param[in] window The window that received the event.
|
|
|
|
* @param[in] width The new width, in pixels, of the framebuffer.
|
|
|
|
* @param[in] height The new height, in pixels, of the framebuffer.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
|
|
|
void _glfwInputFramebufferSize(_GLFWwindow* window, int width, int height);
|
|
|
|
|
2017-02-06 16:31:25 +00:00
|
|
|
/*! @brief Notifies shared code that a window has been iconified or restored.
|
2013-01-02 01:21:38 +00:00
|
|
|
* @param[in] window The window that received the event.
|
2015-08-23 17:30:04 +00:00
|
|
|
* @param[in] iconified `GLFW_TRUE` if the window was iconified, or
|
|
|
|
* `GLFW_FALSE` if it was restored.
|
2013-01-02 01:21:38 +00:00
|
|
|
* @ingroup event
|
|
|
|
*/
|
2015-11-05 07:58:40 +00:00
|
|
|
void _glfwInputWindowIconify(_GLFWwindow* window, GLFWbool iconified);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
2017-02-06 16:31:25 +00:00
|
|
|
/*! @brief Notifies shared code that a window has been maximized or restored.
|
2016-06-16 11:09:28 +00:00
|
|
|
* @param[in] window The window that received the event.
|
|
|
|
* @param[in] maximized `GLFW_TRUE` if the window was maximized, or
|
|
|
|
* `GLFW_FALSE` if it was restored.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
|
|
|
void _glfwInputWindowMaximize(_GLFWwindow* window, GLFWbool maximized);
|
|
|
|
|
2017-02-06 16:31:25 +00:00
|
|
|
/*! @brief Notifies shared code that a window's contents needs updating.
|
2013-01-02 01:21:38 +00:00
|
|
|
* @param[in] window The window that received the event.
|
|
|
|
*/
|
2011-10-09 19:12:13 +00:00
|
|
|
void _glfwInputWindowDamage(_GLFWwindow* window);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
2017-02-06 16:31:25 +00:00
|
|
|
/*! @brief Notifies shared code that the user wishes to close a window.
|
2013-01-02 01:21:38 +00:00
|
|
|
* @param[in] window The window that received the event.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
2012-08-10 11:31:15 +00:00
|
|
|
void _glfwInputWindowCloseRequest(_GLFWwindow* window);
|
2011-10-09 15:10:40 +00:00
|
|
|
|
2017-02-06 16:31:25 +00:00
|
|
|
/*! @brief Notifies shared code that a window has changed its desired monitor.
|
|
|
|
* @param[in] window The window that received the event.
|
|
|
|
* @param[in] monitor The new desired monitor, or `NULL`.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
2017-10-26 16:05:56 +00:00
|
|
|
void _glfwInputWindowMonitor(_GLFWwindow* window, _GLFWmonitor* monitor);
|
2016-02-23 11:26:42 +00:00
|
|
|
|
2013-01-02 01:21:38 +00:00
|
|
|
/*! @brief Notifies shared code of a physical key event.
|
|
|
|
* @param[in] window The window that received the event.
|
|
|
|
* @param[in] key The key that was pressed or released.
|
2013-05-30 15:19:12 +00:00
|
|
|
* @param[in] scancode The system-specific scan code of the key.
|
2013-01-02 01:21:38 +00:00
|
|
|
* @param[in] action @ref GLFW_PRESS or @ref GLFW_RELEASE.
|
2012-12-09 18:19:00 +00:00
|
|
|
* @param[in] mods The modifiers pressed when the event was generated.
|
2013-01-02 01:21:38 +00:00
|
|
|
* @ingroup event
|
|
|
|
*/
|
2013-05-30 15:19:12 +00:00
|
|
|
void _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int mods);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
|
|
|
/*! @brief Notifies shared code of a Unicode character input event.
|
|
|
|
* @param[in] window The window that received the event.
|
2013-10-10 17:41:56 +00:00
|
|
|
* @param[in] codepoint The Unicode code point of the input character.
|
2014-06-12 21:04:20 +00:00
|
|
|
* @param[in] mods Bit field describing which modifier keys were held down.
|
2015-08-23 17:30:04 +00:00
|
|
|
* @param[in] plain `GLFW_TRUE` if the character is regular text input, or
|
|
|
|
* `GLFW_FALSE` otherwise.
|
2013-01-02 01:21:38 +00:00
|
|
|
* @ingroup event
|
|
|
|
*/
|
2015-11-05 07:58:40 +00:00
|
|
|
void _glfwInputChar(_GLFWwindow* window, unsigned int codepoint, int mods, GLFWbool plain);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
|
|
|
/*! @brief Notifies shared code of a scroll event.
|
|
|
|
* @param[in] window The window that received the event.
|
2016-05-25 12:43:51 +00:00
|
|
|
* @param[in] xoffset The scroll offset along the x-axis.
|
|
|
|
* @param[in] yoffset The scroll offset along the y-axis.
|
2013-01-02 01:21:38 +00:00
|
|
|
* @ingroup event
|
|
|
|
*/
|
2016-05-25 12:43:51 +00:00
|
|
|
void _glfwInputScroll(_GLFWwindow* window, double xoffset, double yoffset);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
|
|
|
/*! @brief Notifies shared code of a mouse button click event.
|
|
|
|
* @param[in] window The window that received the event.
|
|
|
|
* @param[in] button The button that was pressed or released.
|
|
|
|
* @param[in] action @ref GLFW_PRESS or @ref GLFW_RELEASE.
|
2017-02-06 16:31:25 +00:00
|
|
|
* @param[in] mods The modifiers pressed when the event was generated.
|
2013-01-02 01:21:38 +00:00
|
|
|
* @ingroup event
|
|
|
|
*/
|
2012-12-09 18:19:00 +00:00
|
|
|
void _glfwInputMouseClick(_GLFWwindow* window, int button, int action, int mods);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
|
|
|
/*! @brief Notifies shared code of a cursor motion event.
|
|
|
|
* @param[in] window The window that received the event.
|
2016-05-25 12:43:51 +00:00
|
|
|
* @param[in] xpos The new x-coordinate of the cursor, relative to the left
|
|
|
|
* edge of the client area of the window.
|
|
|
|
* @param[in] ypos The new y-coordinate of the cursor, relative to the top edge
|
2013-01-02 01:21:38 +00:00
|
|
|
* of the client area of the window.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
2016-05-25 12:43:51 +00:00
|
|
|
void _glfwInputCursorPos(_GLFWwindow* window, double xpos, double ypos);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
|
|
|
/*! @brief Notifies shared code of a cursor enter/leave event.
|
|
|
|
* @param[in] window The window that received the event.
|
2015-08-23 17:30:04 +00:00
|
|
|
* @param[in] entered `GLFW_TRUE` if the cursor entered the client area of the
|
|
|
|
* window, or `GLFW_FALSE` if it left it.
|
2013-01-02 01:21:38 +00:00
|
|
|
* @ingroup event
|
|
|
|
*/
|
2015-11-05 07:58:40 +00:00
|
|
|
void _glfwInputCursorEnter(_GLFWwindow* window, GLFWbool entered);
|
2010-09-07 15:34:51 +00:00
|
|
|
|
2017-02-06 16:31:25 +00:00
|
|
|
/*! @brief Notifies shared code of a monitor connection or disconnection.
|
|
|
|
* @param[in] monitor The monitor that was connected or disconnected.
|
|
|
|
* @param[in] action One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.
|
|
|
|
* @param[in] placement `_GLFW_INSERT_FIRST` or `_GLFW_INSERT_LAST`.
|
|
|
|
* @ingroup event
|
2013-01-02 01:21:38 +00:00
|
|
|
*/
|
2017-01-10 14:46:00 +00:00
|
|
|
void _glfwInputMonitor(_GLFWmonitor* monitor, int action, int placement);
|
2012-09-12 17:35:52 +00:00
|
|
|
|
2017-02-06 16:31:25 +00:00
|
|
|
/*! @brief Notifies shared code that a full screen window has acquired or
|
|
|
|
* released a monitor.
|
|
|
|
* @param[in] monitor The monitor that was acquired or released.
|
|
|
|
* @param[in] window The window that acquired the monitor, or `NULL`.
|
|
|
|
* @ingroup event
|
2016-02-23 11:34:35 +00:00
|
|
|
*/
|
2017-01-10 14:46:00 +00:00
|
|
|
void _glfwInputMonitorWindow(_GLFWmonitor* monitor, _GLFWwindow* window);
|
2016-02-23 11:34:35 +00:00
|
|
|
|
2013-01-02 01:21:38 +00:00
|
|
|
/*! @brief Notifies shared code of an error.
|
2017-05-25 16:23:09 +00:00
|
|
|
* @param[in] code The error code most suitable for the error.
|
2013-03-12 14:33:05 +00:00
|
|
|
* @param[in] format The `printf` style format string of the error
|
2013-01-02 01:21:38 +00:00
|
|
|
* description.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
2015-10-24 21:52:29 +00:00
|
|
|
#if defined(__GNUC__)
|
2017-05-25 16:23:09 +00:00
|
|
|
void _glfwInputError(int code, const char* format, ...) __attribute__((format(printf, 2, 3)));
|
2015-10-24 21:52:29 +00:00
|
|
|
#else
|
2017-05-25 16:23:09 +00:00
|
|
|
void _glfwInputError(int code, const char* format, ...);
|
2015-10-23 23:53:03 +00:00
|
|
|
#endif
|
2012-12-31 20:05:28 +00:00
|
|
|
|
2017-02-06 16:31:25 +00:00
|
|
|
/*! @brief Notifies shared code of files or directories dropped on a window.
|
2013-07-10 09:42:14 +00:00
|
|
|
* @param[in] window The window that received the event.
|
2013-12-22 18:28:46 +00:00
|
|
|
* @param[in] count The number of dropped objects.
|
|
|
|
* @param[in] names The names of the dropped objects.
|
2013-07-10 09:42:14 +00:00
|
|
|
* @ingroup event
|
|
|
|
*/
|
2013-12-22 18:28:46 +00:00
|
|
|
void _glfwInputDrop(_GLFWwindow* window, int count, const char** names);
|
2013-07-10 09:42:14 +00:00
|
|
|
|
2017-02-06 16:31:25 +00:00
|
|
|
/*! @brief Notifies shared code of a joystick connection or disconnection.
|
2017-07-09 12:01:48 +00:00
|
|
|
* @param[in] js The joystick that was connected or disconnected.
|
2015-12-13 16:38:50 +00:00
|
|
|
* @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
2017-07-09 12:01:48 +00:00
|
|
|
void _glfwInputJoystick(_GLFWjoystick* js, int event);
|
2017-01-05 18:44:15 +00:00
|
|
|
|
|
|
|
/*! @brief Notifies shared code of the new value of a joystick axis.
|
2017-07-09 12:01:48 +00:00
|
|
|
* @param[in] js The joystick whose axis to update.
|
2017-01-05 18:44:15 +00:00
|
|
|
* @param[in] axis The index of the axis to update.
|
|
|
|
* @param[in] value The new value of the axis.
|
|
|
|
*/
|
2017-07-09 12:01:48 +00:00
|
|
|
void _glfwInputJoystickAxis(_GLFWjoystick* js, int axis, float value);
|
2017-01-05 18:44:15 +00:00
|
|
|
|
|
|
|
/*! @brief Notifies shared code of the new value of a joystick button.
|
2017-07-09 12:01:48 +00:00
|
|
|
* @param[in] js The joystick whose button to update.
|
2017-01-05 18:44:15 +00:00
|
|
|
* @param[in] button The index of the button to update.
|
|
|
|
* @param[in] value The new value of the button.
|
|
|
|
*/
|
2017-07-09 12:01:48 +00:00
|
|
|
void _glfwInputJoystickButton(_GLFWjoystick* js, int button, char value);
|
2015-12-13 16:38:50 +00:00
|
|
|
|
2017-03-01 22:27:20 +00:00
|
|
|
/*! @brief Notifies shared code of the new value of a joystick hat.
|
2017-07-09 12:01:48 +00:00
|
|
|
* @param[in] js The joystick whose hat to update.
|
2017-03-01 22:27:20 +00:00
|
|
|
* @param[in] button The index of the hat to update.
|
|
|
|
* @param[in] value The new value of the hat.
|
|
|
|
*/
|
2017-07-09 12:01:48 +00:00
|
|
|
void _glfwInputJoystickHat(_GLFWjoystick* js, int hat, char value);
|
2017-03-01 22:27:20 +00:00
|
|
|
|
2012-08-27 01:25:58 +00:00
|
|
|
|
|
|
|
//========================================================================
|
2013-01-02 01:21:38 +00:00
|
|
|
// Utility functions
|
2012-08-27 01:25:58 +00:00
|
|
|
//========================================================================
|
|
|
|
|
2017-02-28 21:29:10 +00:00
|
|
|
/*! @brief Chooses the video mode most closely matching the desired one.
|
|
|
|
* @ingroup utility
|
2013-01-02 01:21:38 +00:00
|
|
|
*/
|
2013-01-02 16:29:24 +00:00
|
|
|
const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor,
|
|
|
|
const GLFWvidmode* desired);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
|
|
|
/*! @brief Performs lexical comparison between two @ref GLFWvidmode structures.
|
|
|
|
* @ingroup utility
|
|
|
|
*/
|
2012-08-27 01:25:58 +00:00
|
|
|
int _glfwCompareVideoModes(const GLFWvidmode* first, const GLFWvidmode* second);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
|
|
|
/*! @brief Splits a color depth into red, green and blue bit depths.
|
|
|
|
* @ingroup utility
|
|
|
|
*/
|
2012-08-27 01:25:58 +00:00
|
|
|
void _glfwSplitBPP(int bpp, int* red, int* green, int* blue);
|
|
|
|
|
2013-01-02 01:21:38 +00:00
|
|
|
/*! @brief Searches an extension string for the specified extension.
|
|
|
|
* @param[in] string The extension string to search.
|
2013-02-14 12:14:17 +00:00
|
|
|
* @param[in] extensions The extension to search for.
|
2015-08-23 17:30:04 +00:00
|
|
|
* @return `GLFW_TRUE` if the extension was found, or `GLFW_FALSE` otherwise.
|
2013-01-02 01:21:38 +00:00
|
|
|
* @ingroup utility
|
|
|
|
*/
|
2015-11-05 07:58:40 +00:00
|
|
|
GLFWbool _glfwStringInExtensionString(const char* string, const char* extensions);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
2013-05-13 13:49:59 +00:00
|
|
|
/*! @brief Chooses the framebuffer config that best matches the desired one.
|
|
|
|
* @param[in] desired The desired framebuffer config.
|
|
|
|
* @param[in] alternatives The framebuffer configs supported by the system.
|
|
|
|
* @param[in] count The number of entries in the alternatives array.
|
|
|
|
* @return The framebuffer config most closely matching the desired one, or @c
|
|
|
|
* NULL if none fulfilled the hard constraints of the desired values.
|
|
|
|
* @ingroup utility
|
|
|
|
*/
|
|
|
|
const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
|
|
|
|
const _GLFWfbconfig* alternatives,
|
|
|
|
unsigned int count);
|
|
|
|
|
2013-05-27 13:30:32 +00:00
|
|
|
/*! @brief Retrieves the attributes of the current context.
|
2014-03-06 19:05:32 +00:00
|
|
|
* @param[in] ctxconfig The desired context attributes.
|
2015-08-23 17:30:04 +00:00
|
|
|
* @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if the context is
|
|
|
|
* unusable.
|
2013-01-02 01:21:38 +00:00
|
|
|
* @ingroup utility
|
|
|
|
*/
|
2017-12-24 09:07:56 +00:00
|
|
|
GLFWbool _glfwRefreshContextAttribs(_GLFWwindow* window,
|
|
|
|
const _GLFWctxconfig* ctxconfig);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
2013-05-27 13:30:32 +00:00
|
|
|
/*! @brief Checks whether the desired context attributes are valid.
|
2014-03-06 19:05:32 +00:00
|
|
|
* @param[in] ctxconfig The context attributes to check.
|
2015-08-23 17:30:04 +00:00
|
|
|
* @return `GLFW_TRUE` if the context attributes are valid, or `GLFW_FALSE`
|
2013-01-02 01:21:38 +00:00
|
|
|
* otherwise.
|
|
|
|
* @ingroup utility
|
|
|
|
*
|
|
|
|
* This function checks things like whether the specified client API version
|
|
|
|
* exists and whether all relevant options have supported and non-conflicting
|
|
|
|
* values.
|
|
|
|
*/
|
2015-08-23 17:30:04 +00:00
|
|
|
GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
2017-02-28 21:29:10 +00:00
|
|
|
/*! @brief Allocates red, green and blue value arrays of the specified size.
|
|
|
|
* @ingroup utility
|
2013-05-19 13:46:44 +00:00
|
|
|
*/
|
2013-07-04 12:51:52 +00:00
|
|
|
void _glfwAllocGammaArrays(GLFWgammaramp* ramp, unsigned int size);
|
2013-05-19 13:46:44 +00:00
|
|
|
|
2017-02-28 21:29:10 +00:00
|
|
|
/*! @brief Frees the red, green and blue value arrays and clears the struct.
|
|
|
|
* @ingroup utility
|
2013-05-19 13:46:44 +00:00
|
|
|
*/
|
2013-07-04 12:51:52 +00:00
|
|
|
void _glfwFreeGammaArrays(GLFWgammaramp* ramp);
|
2013-05-19 13:46:44 +00:00
|
|
|
|
2013-11-24 22:31:26 +00:00
|
|
|
/*! @brief Allocates and returns a monitor object with the specified name
|
|
|
|
* and dimensions.
|
|
|
|
* @param[in] name The name of the monitor.
|
|
|
|
* @param[in] widthMM The width, in mm, of the monitor's display area.
|
|
|
|
* @param[in] heightMM The height, in mm, of the monitor's display area.
|
|
|
|
* @return The newly created object.
|
|
|
|
* @ingroup utility
|
2013-01-02 01:21:38 +00:00
|
|
|
*/
|
2014-01-21 14:23:11 +00:00
|
|
|
_GLFWmonitor* _glfwAllocMonitor(const char* name, int widthMM, int heightMM);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
2013-11-24 22:31:26 +00:00
|
|
|
/*! @brief Frees a monitor object and any data associated with it.
|
|
|
|
* @ingroup utility
|
2013-01-02 01:21:38 +00:00
|
|
|
*/
|
2014-01-21 14:23:11 +00:00
|
|
|
void _glfwFreeMonitor(_GLFWmonitor* monitor);
|
2013-01-02 01:21:38 +00:00
|
|
|
|
2017-02-28 21:29:10 +00:00
|
|
|
/*! @brief Returns an available joystick object with arrays and name allocated.
|
|
|
|
* @ingroup utility
|
2017-01-05 18:44:15 +00:00
|
|
|
*/
|
2017-06-18 13:13:25 +00:00
|
|
|
_GLFWjoystick* _glfwAllocJoystick(const char* name,
|
|
|
|
const char* guid,
|
|
|
|
int axisCount,
|
|
|
|
int buttonCount,
|
|
|
|
int hatCount);
|
2017-01-05 18:44:15 +00:00
|
|
|
|
2017-02-28 21:29:10 +00:00
|
|
|
/*! @brief Frees arrays and name and flags the joystick object as unused.
|
|
|
|
* @ingroup utility
|
2017-01-05 18:44:15 +00:00
|
|
|
*/
|
|
|
|
void _glfwFreeJoystick(_GLFWjoystick* js);
|
|
|
|
|
2015-08-10 18:19:04 +00:00
|
|
|
/*! @ingroup utility
|
|
|
|
*/
|
2016-10-31 00:42:04 +00:00
|
|
|
GLFWbool _glfwInitVulkan(int mode);
|
2015-08-10 18:19:04 +00:00
|
|
|
|
|
|
|
/*! @ingroup utility
|
|
|
|
*/
|
|
|
|
void _glfwTerminateVulkan(void);
|
|
|
|
|
|
|
|
/*! @ingroup utility
|
|
|
|
*/
|
|
|
|
const char* _glfwGetVulkanResultString(VkResult result);
|
|
|
|
|