2010-09-07 15:34:51 +00:00
|
|
|
//========================================================================
|
2011-03-06 00:46:39 +00:00
|
|
|
// GLFW - An OpenGL library
|
2010-09-07 15:34:51 +00:00
|
|
|
// Platform: Any
|
2010-09-07 15:41:26 +00:00
|
|
|
// API version: 3.0
|
2010-09-07 15:34:51 +00:00
|
|
|
// WWW: http://www.glfw.org/
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// Copyright (c) 2002-2006 Marcus Geelnard
|
|
|
|
// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.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 _internal_h_
|
|
|
|
#define _internal_h_
|
|
|
|
|
|
|
|
|
|
|
|
//========================================================================
|
|
|
|
// Input handling definitions
|
|
|
|
//========================================================================
|
|
|
|
|
|
|
|
// Internal key and button state/action definitions
|
|
|
|
#define GLFW_STICK 2
|
|
|
|
|
|
|
|
|
2012-04-22 19:49:38 +00:00
|
|
|
//========================================================================
|
|
|
|
// Internal type declarations
|
|
|
|
//========================================================================
|
|
|
|
|
|
|
|
typedef struct _GLFWhints _GLFWhints;
|
|
|
|
typedef struct _GLFWwndconfig _GLFWwndconfig;
|
|
|
|
typedef struct _GLFWfbconfig _GLFWfbconfig;
|
|
|
|
typedef struct _GLFWwindow _GLFWwindow;
|
|
|
|
typedef struct _GLFWlibrary _GLFWlibrary;
|
2012-07-10 22:33:19 +00:00
|
|
|
typedef struct _GLFWmonitor _GLFWmonitor;
|
2012-04-22 19:49:38 +00:00
|
|
|
|
|
|
|
|
2010-09-09 16:15:32 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// Platform specific definitions goes in platform.h (which also includes
|
|
|
|
// glfw.h)
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
2010-09-16 22:54:11 +00:00
|
|
|
#include "config.h"
|
2010-11-17 13:52:47 +00:00
|
|
|
|
2011-07-26 13:16:34 +00:00
|
|
|
#include "../include/GL/glfw3.h"
|
2011-09-22 12:15:07 +00:00
|
|
|
|
|
|
|
// This path may need to be changed if you build GLFW using your own setup
|
|
|
|
// We ship and use our own copy of glext.h since GLFW uses fairly new
|
|
|
|
// extensions and not all operating systems come with an up-to-date version
|
2011-09-06 15:32:41 +00:00
|
|
|
#include "../support/GL/glext.h"
|
2010-09-09 16:15:32 +00:00
|
|
|
|
2012-11-27 14:02:26 +00:00
|
|
|
#if defined(_GLFW_COCOA)
|
2012-02-05 15:56:26 +00:00
|
|
|
#include "cocoa_platform.h"
|
2012-11-27 14:02:26 +00:00
|
|
|
#elif defined(_GLFW_WIN32)
|
2012-02-05 15:56:26 +00:00
|
|
|
#include "win32_platform.h"
|
2012-11-27 14:02:26 +00:00
|
|
|
#elif defined(_GLFW_X11)
|
2012-02-05 15:56:26 +00:00
|
|
|
#include "x11_platform.h"
|
2011-07-26 13:16:34 +00:00
|
|
|
#else
|
2012-12-02 18:01:20 +00:00
|
|
|
#error "No supported window creation API selected"
|
2011-07-26 13:16:34 +00:00
|
|
|
#endif
|
2010-09-09 16:15:32 +00:00
|
|
|
|
2010-10-04 16:17:53 +00:00
|
|
|
|
2010-09-07 15:34:51 +00:00
|
|
|
//------------------------------------------------------------------------
|
2012-08-06 15:56:41 +00:00
|
|
|
// Window hints, set by glfwWindowHint and consumed by glfwCreateWindow
|
2010-09-09 18:18:10 +00:00
|
|
|
// A bucket of semi-random stuff lumped together for historical reasons
|
2010-09-07 15:34:51 +00:00
|
|
|
// This is used only by the platform independent code and only to store
|
2012-08-06 15:56:41 +00:00
|
|
|
// parameters passed to us by glfwWindowHint
|
2010-09-07 15:34:51 +00:00
|
|
|
//------------------------------------------------------------------------
|
2010-10-04 16:17:53 +00:00
|
|
|
struct _GLFWhints
|
2010-09-09 18:18:10 +00:00
|
|
|
{
|
2010-09-09 17:58:51 +00:00
|
|
|
int redBits;
|
|
|
|
int greenBits;
|
|
|
|
int blueBits;
|
|
|
|
int alphaBits;
|
|
|
|
int depthBits;
|
|
|
|
int stencilBits;
|
2010-09-07 15:34:51 +00:00
|
|
|
int accumRedBits;
|
|
|
|
int accumGreenBits;
|
|
|
|
int accumBlueBits;
|
|
|
|
int accumAlphaBits;
|
|
|
|
int auxBuffers;
|
2010-10-25 10:36:14 +00:00
|
|
|
GLboolean stereo;
|
2011-11-02 15:56:34 +00:00
|
|
|
GLboolean resizable;
|
2012-08-21 19:18:09 +00:00
|
|
|
GLboolean visible;
|
2010-09-07 15:34:51 +00:00
|
|
|
int samples;
|
2012-12-02 15:10:00 +00:00
|
|
|
GLboolean sRGB;
|
2012-09-30 13:32:50 +00:00
|
|
|
int clientAPI;
|
2010-09-07 15:34:51 +00:00
|
|
|
int glMajor;
|
|
|
|
int glMinor;
|
2010-10-25 10:36:14 +00:00
|
|
|
GLboolean glForward;
|
|
|
|
GLboolean glDebug;
|
2010-09-07 15:34:51 +00:00
|
|
|
int glProfile;
|
2011-03-07 19:51:34 +00:00
|
|
|
int glRobustness;
|
2012-10-27 22:23:28 +00:00
|
|
|
int positionX;
|
|
|
|
int positionY;
|
2010-10-04 16:17:53 +00:00
|
|
|
};
|
2010-09-07 15:34:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// Parameters relating to the creation of the context and window but not
|
|
|
|
// directly related to the properties of the framebuffer
|
|
|
|
// This is used to pass window and context creation parameters from the
|
|
|
|
// platform independent code to the platform specific code
|
|
|
|
//------------------------------------------------------------------------
|
2010-10-04 16:17:53 +00:00
|
|
|
struct _GLFWwndconfig
|
2010-09-09 18:18:10 +00:00
|
|
|
{
|
2010-10-04 16:17:53 +00:00
|
|
|
const char* title;
|
2011-11-02 15:56:34 +00:00
|
|
|
GLboolean resizable;
|
2012-08-21 19:18:09 +00:00
|
|
|
GLboolean visible;
|
2012-10-27 22:23:28 +00:00
|
|
|
int positionX;
|
|
|
|
int positionY;
|
2012-09-30 13:32:50 +00:00
|
|
|
int clientAPI;
|
2010-10-04 16:17:53 +00:00
|
|
|
int glMajor;
|
|
|
|
int glMinor;
|
2010-10-25 10:36:14 +00:00
|
|
|
GLboolean glForward;
|
|
|
|
GLboolean glDebug;
|
2010-10-04 16:17:53 +00:00
|
|
|
int glProfile;
|
2011-03-07 19:51:34 +00:00
|
|
|
int glRobustness;
|
2012-09-27 19:37:36 +00:00
|
|
|
_GLFWmonitor* monitor;
|
2010-10-04 16:17:53 +00:00
|
|
|
_GLFWwindow* share;
|
|
|
|
};
|
2010-09-07 15:34:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// Framebuffer configuration descriptor, i.e. buffers and their sizes
|
|
|
|
// Also a platform specific ID used to map back to the actual backend APIs
|
|
|
|
// This is used to pass framebuffer parameters from the platform independent
|
|
|
|
// code to the platform specific code, and also to enumerate and select
|
|
|
|
// available framebuffer configurations
|
|
|
|
//------------------------------------------------------------------------
|
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;
|
2010-10-25 10:36:14 +00:00
|
|
|
GLboolean stereo;
|
2010-09-07 15:34:51 +00:00
|
|
|
int samples;
|
2012-12-02 15:10:00 +00:00
|
|
|
GLboolean sRGB;
|
2010-09-07 15:34:51 +00:00
|
|
|
GLFWintptr platformID;
|
2010-10-04 16:17:53 +00:00
|
|
|
};
|
2010-09-07 15:34:51 +00:00
|
|
|
|
|
|
|
|
2010-09-09 16:15:32 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// Window 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
|
|
|
|
GLboolean iconified; // GL_TRUE if this window is iconified
|
2010-09-16 04:02:44 +00:00
|
|
|
GLboolean closeRequested; // GL_TRUE if this window should be closed
|
2010-09-09 18:18:10 +00:00
|
|
|
int width, height;
|
2010-09-14 01:53:22 +00:00
|
|
|
int positionX, positionY;
|
2012-10-31 15:11:09 +00:00
|
|
|
int mode; // GLFW_WINDOWED or GLFW_FULLSCREEN
|
2011-11-02 15:56:34 +00:00
|
|
|
GLboolean resizable; // GL_TRUE if user may resize this window
|
2012-08-21 19:18:09 +00:00
|
|
|
GLboolean visible; // GL_TRUE if this window is visible
|
2010-09-09 20:44:38 +00:00
|
|
|
void* userPointer;
|
2012-09-27 19:37:36 +00:00
|
|
|
_GLFWmonitor* monitor;
|
2010-09-09 16:15:32 +00:00
|
|
|
|
2010-09-09 18:18:10 +00:00
|
|
|
// Window input state
|
2010-09-09 16:15:32 +00:00
|
|
|
GLboolean stickyKeys;
|
|
|
|
GLboolean stickyMouseButtons;
|
2011-10-13 13:20:59 +00:00
|
|
|
int cursorPosX, cursorPosY;
|
2011-09-06 11:55:29 +00:00
|
|
|
int cursorMode;
|
2012-03-28 19:54:09 +00:00
|
|
|
double scrollX, scrollY;
|
2010-09-09 16:15:32 +00:00
|
|
|
char mouseButton[GLFW_MOUSE_BUTTON_LAST + 1];
|
|
|
|
char key[GLFW_KEY_LAST + 1];
|
|
|
|
|
|
|
|
// OpenGL extensions and context attributes
|
2012-09-30 13:32:50 +00:00
|
|
|
int clientAPI;
|
2010-09-09 16:15:32 +00:00
|
|
|
int glMajor, glMinor, glRevision;
|
2010-10-25 10:36:14 +00:00
|
|
|
GLboolean glForward, glDebug;
|
|
|
|
int glProfile;
|
2011-03-07 19:51:34 +00:00
|
|
|
int glRobustness;
|
2010-09-09 16:15:32 +00:00
|
|
|
PFNGLGETSTRINGIPROC GetStringi;
|
|
|
|
|
2012-11-30 12:56:42 +00:00
|
|
|
GLFWwindowposfun windowPosCallback;
|
2012-10-28 12:45:11 +00:00
|
|
|
GLFWwindowsizefun windowSizeCallback;
|
|
|
|
GLFWwindowclosefun windowCloseCallback;
|
|
|
|
GLFWwindowrefreshfun windowRefreshCallback;
|
|
|
|
GLFWwindowfocusfun windowFocusCallback;
|
|
|
|
GLFWwindowiconifyfun windowIconifyCallback;
|
|
|
|
GLFWmousebuttonfun mouseButtonCallback;
|
|
|
|
GLFWcursorposfun cursorPosCallback;
|
|
|
|
GLFWcursorenterfun cursorEnterCallback;
|
|
|
|
GLFWscrollfun scrollCallback;
|
|
|
|
GLFWkeyfun keyCallback;
|
|
|
|
GLFWcharfun charCallback;
|
|
|
|
|
2010-10-14 14:40:10 +00:00
|
|
|
// These are defined in the current port's platform.h
|
2010-09-09 16:15:32 +00:00
|
|
|
_GLFW_PLATFORM_WINDOW_STATE;
|
2010-09-09 18:36:23 +00:00
|
|
|
_GLFW_PLATFORM_CONTEXT_STATE;
|
2010-10-04 16:17:53 +00:00
|
|
|
};
|
2010-09-09 16:15:32 +00:00
|
|
|
|
|
|
|
|
2011-05-07 08:53:50 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// Display structure
|
|
|
|
//------------------------------------------------------------------------
|
2011-10-03 07:24:35 +00:00
|
|
|
struct _GLFWmonitor
|
2011-05-07 08:53:50 +00:00
|
|
|
{
|
|
|
|
void* userPointer;
|
|
|
|
|
2011-10-06 21:28:56 +00:00
|
|
|
char* name;
|
2012-09-13 15:46:40 +00:00
|
|
|
|
|
|
|
GLboolean primary;
|
|
|
|
|
2011-05-07 08:53:50 +00:00
|
|
|
// physical dimensions in millimeters.
|
|
|
|
int physicalWidth;
|
|
|
|
int physicalHeight;
|
|
|
|
// logical orientation of the screen on the desktop
|
2012-10-22 00:39:22 +00:00
|
|
|
int positionX;
|
|
|
|
int positionY;
|
2011-10-02 20:13:47 +00:00
|
|
|
|
2012-08-03 00:57:33 +00:00
|
|
|
GLFWvidmode* modes;
|
2012-12-27 17:37:55 +00:00
|
|
|
int modeCount;
|
2012-08-03 00:57:33 +00:00
|
|
|
|
2011-10-02 20:13:47 +00:00
|
|
|
// These are defined in the current port's platform.h
|
2011-10-03 07:24:35 +00:00
|
|
|
_GLFW_PLATFORM_MONITOR_STATE;
|
2011-05-07 08:53:50 +00:00
|
|
|
};
|
|
|
|
|
2010-09-09 16:15:32 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// Library global data
|
|
|
|
//------------------------------------------------------------------------
|
2010-10-04 16:17:53 +00:00
|
|
|
struct _GLFWlibrary
|
2010-09-09 18:18:10 +00:00
|
|
|
{
|
2010-10-13 02:04:43 +00:00
|
|
|
_GLFWhints hints;
|
2010-09-09 22:06:23 +00:00
|
|
|
|
2010-10-13 02:04:43 +00:00
|
|
|
_GLFWwindow* windowListHead;
|
2012-11-22 16:04:44 +00:00
|
|
|
_GLFWwindow* focusedWindow;
|
2012-09-12 17:35:52 +00:00
|
|
|
|
|
|
|
_GLFWmonitor** monitors;
|
|
|
|
int monitorCount;
|
2012-10-31 23:07:01 +00:00
|
|
|
GLFWmonitorfun monitorCallback;
|
2010-10-24 16:28:55 +00:00
|
|
|
|
2010-10-13 02:04:43 +00:00
|
|
|
GLFWgammaramp currentRamp;
|
|
|
|
GLFWgammaramp originalRamp;
|
|
|
|
int originalRampSize;
|
2012-05-24 09:46:51 +00:00
|
|
|
GLboolean rampChanged;
|
2010-09-09 16:15:32 +00:00
|
|
|
|
2010-10-14 14:40:10 +00:00
|
|
|
// This is defined in the current port's platform.h
|
2012-04-22 13:53:02 +00:00
|
|
|
_GLFW_PLATFORM_LIBRARY_WINDOW_STATE;
|
|
|
|
_GLFW_PLATFORM_LIBRARY_OPENGL_STATE;
|
2010-10-04 16:17:53 +00:00
|
|
|
};
|
2010-09-09 16:15:32 +00:00
|
|
|
|
|
|
|
|
2012-08-26 18:11:32 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// Global state shared between compilation units of GLFW
|
|
|
|
// These are exported from and documented in init.c
|
|
|
|
//------------------------------------------------------------------------
|
2012-08-26 16:42:15 +00:00
|
|
|
extern GLboolean _glfwInitialized;
|
|
|
|
extern _GLFWlibrary _glfwLibrary;
|
2010-09-09 16:15:32 +00:00
|
|
|
|
2010-09-07 15:34:51 +00:00
|
|
|
|
|
|
|
//========================================================================
|
2012-08-27 01:25:58 +00:00
|
|
|
// Prototypes for the platform API
|
|
|
|
// This 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
|
2010-09-07 15:34:51 +00:00
|
|
|
//========================================================================
|
|
|
|
|
2012-08-27 01:25:58 +00:00
|
|
|
// Platform init and version
|
2010-09-08 15:30:21 +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
|
|
|
|
2012-08-27 01:25:58 +00:00
|
|
|
// Input mode support
|
2012-06-22 11:53:02 +00:00
|
|
|
void _glfwPlatformSetCursorPos(_GLFWwindow* window, int x, int y);
|
2012-04-06 12:37:31 +00:00
|
|
|
void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode);
|
2010-09-07 15:34:51 +00:00
|
|
|
|
2012-09-12 17:35:52 +00:00
|
|
|
// Monitor support
|
|
|
|
_GLFWmonitor** _glfwPlatformGetMonitors(int* count);
|
|
|
|
void _glfwPlatformDestroyMonitor(_GLFWmonitor* monitor);
|
|
|
|
|
2012-08-27 01:25:58 +00:00
|
|
|
// Video mode support
|
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);
|
2010-09-07 15:34:51 +00:00
|
|
|
|
2012-08-27 01:25:58 +00:00
|
|
|
// Gamma ramp support
|
2010-10-13 20:42:31 +00:00
|
|
|
void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp);
|
2010-10-13 02:04:43 +00:00
|
|
|
void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp);
|
|
|
|
|
2012-08-27 01:25:58 +00:00
|
|
|
// Clipboard support
|
2012-04-09 14:00:54 +00:00
|
|
|
void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string);
|
2012-04-11 22:51:58 +00:00
|
|
|
const char* _glfwPlatformGetClipboardString(_GLFWwindow* window);
|
2011-09-21 09:09:47 +00:00
|
|
|
|
2012-08-27 01:25:58 +00:00
|
|
|
// Joystick input
|
2010-09-08 15:30:21 +00:00
|
|
|
int _glfwPlatformGetJoystickParam(int joy, int param);
|
2012-08-29 16:31:12 +00:00
|
|
|
int _glfwPlatformGetJoystickAxes(int joy, float* axes, int numaxes);
|
2010-09-08 15:30:21 +00:00
|
|
|
int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons, int numbuttons);
|
2012-09-06 23:01:34 +00:00
|
|
|
const char* _glfwPlatformGetJoystickName(int joy);
|
2010-09-07 15:34:51 +00:00
|
|
|
|
2012-08-27 01:25:58 +00:00
|
|
|
// Time input
|
2010-09-08 15:30:21 +00:00
|
|
|
double _glfwPlatformGetTime(void);
|
|
|
|
void _glfwPlatformSetTime(double time);
|
2010-09-07 15:34:51 +00:00
|
|
|
|
|
|
|
// Window management
|
2012-08-06 15:56:41 +00:00
|
|
|
int _glfwPlatformCreateWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* fbconfig);
|
|
|
|
void _glfwPlatformDestroyWindow(_GLFWwindow* window);
|
2010-09-09 16:15:32 +00:00
|
|
|
void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title);
|
|
|
|
void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height);
|
|
|
|
void _glfwPlatformIconifyWindow(_GLFWwindow* window);
|
|
|
|
void _glfwPlatformRestoreWindow(_GLFWwindow* window);
|
2012-08-21 18:01:57 +00:00
|
|
|
void _glfwPlatformShowWindow(_GLFWwindow* window);
|
|
|
|
void _glfwPlatformHideWindow(_GLFWwindow* window);
|
2010-09-09 16:15:32 +00:00
|
|
|
|
2012-08-27 01:25:58 +00:00
|
|
|
// Event processing
|
2010-09-09 16:15:32 +00:00
|
|
|
void _glfwPlatformPollEvents(void);
|
|
|
|
void _glfwPlatformWaitEvents(void);
|
|
|
|
|
|
|
|
// OpenGL context management
|
2011-07-27 14:01:27 +00:00
|
|
|
void _glfwPlatformMakeContextCurrent(_GLFWwindow* window);
|
2012-08-12 12:13:18 +00:00
|
|
|
_GLFWwindow* _glfwPlatformGetCurrentContext(void);
|
2012-08-06 16:13:37 +00:00
|
|
|
void _glfwPlatformSwapBuffers(_GLFWwindow* window);
|
2010-09-08 15:30:21 +00:00
|
|
|
void _glfwPlatformSwapInterval(int interval);
|
2010-09-09 16:15:32 +00:00
|
|
|
int _glfwPlatformExtensionSupported(const char* extension);
|
2012-06-04 22:16:40 +00:00
|
|
|
GLFWglproc _glfwPlatformGetProcAddress(const char* procname);
|
2010-09-07 15:34:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
//========================================================================
|
2012-08-27 01:25:58 +00:00
|
|
|
// Prototypes for the event API
|
|
|
|
// This 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,
|
|
|
|
// instead of directly calling callbacks or modifying shared state
|
2010-09-07 15:34:51 +00:00
|
|
|
//========================================================================
|
|
|
|
|
2012-01-31 14:27:15 +00:00
|
|
|
// Window event notification (window.c)
|
2012-11-22 16:04:44 +00:00
|
|
|
void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean focused);
|
2011-10-09 15:10:40 +00:00
|
|
|
void _glfwInputWindowPos(_GLFWwindow* window, int x, int y);
|
|
|
|
void _glfwInputWindowSize(_GLFWwindow* window, int width, int height);
|
|
|
|
void _glfwInputWindowIconify(_GLFWwindow* window, int iconified);
|
2012-08-21 19:18:09 +00:00
|
|
|
void _glfwInputWindowVisibility(_GLFWwindow* window, int visible);
|
2011-10-09 19:12:13 +00:00
|
|
|
void _glfwInputWindowDamage(_GLFWwindow* window);
|
2012-08-10 11:31:15 +00:00
|
|
|
void _glfwInputWindowCloseRequest(_GLFWwindow* window);
|
2011-10-09 15:10:40 +00:00
|
|
|
|
2012-01-31 14:27:15 +00:00
|
|
|
// Input event notification (input.c)
|
2010-09-09 16:15:32 +00:00
|
|
|
void _glfwInputKey(_GLFWwindow* window, int key, int action);
|
2010-09-09 17:33:37 +00:00
|
|
|
void _glfwInputChar(_GLFWwindow* window, int character);
|
2012-03-28 19:54:09 +00:00
|
|
|
void _glfwInputScroll(_GLFWwindow* window, double x, double y);
|
2010-09-09 16:15:32 +00:00
|
|
|
void _glfwInputMouseClick(_GLFWwindow* window, int button, int action);
|
2011-10-09 15:10:40 +00:00
|
|
|
void _glfwInputCursorMotion(_GLFWwindow* window, int x, int y);
|
2012-01-30 21:59:38 +00:00
|
|
|
void _glfwInputCursorEnter(_GLFWwindow* window, int entered);
|
2010-09-07 15:34:51 +00:00
|
|
|
|
2012-09-12 17:35:52 +00:00
|
|
|
// Monitor event notification (monitor.c)
|
|
|
|
void _glfwInputMonitorChange(void);
|
|
|
|
|
2012-08-27 01:25:58 +00:00
|
|
|
|
|
|
|
//========================================================================
|
|
|
|
// Prototypes for internal utility functions
|
|
|
|
// These functions are shared code and may be used by any part of GLFW
|
|
|
|
// Each platform may add its own utility functions, but those may only be
|
|
|
|
// called by the platform-specific code
|
|
|
|
//========================================================================
|
|
|
|
|
|
|
|
// Fullscren management (fullscreen.c)
|
|
|
|
int _glfwCompareVideoModes(const GLFWvidmode* first, const GLFWvidmode* second);
|
|
|
|
void _glfwSplitBPP(int bpp, int* red, int* green, int* blue);
|
|
|
|
|
|
|
|
// Error handling (init.c)
|
|
|
|
void _glfwSetError(int error, const char* format, ...);
|
|
|
|
|
2011-03-07 12:56:28 +00:00
|
|
|
// OpenGL context helpers (opengl.c)
|
2010-09-08 15:30:21 +00:00
|
|
|
int _glfwStringInExtensionString(const char* string, const GLubyte* extensions);
|
|
|
|
const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
|
|
|
|
const _GLFWfbconfig* alternatives,
|
|
|
|
unsigned int count);
|
2012-08-02 12:42:24 +00:00
|
|
|
GLboolean _glfwRefreshContextParams(void);
|
2011-03-07 13:55:11 +00:00
|
|
|
GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig);
|
2012-08-02 12:42:24 +00:00
|
|
|
GLboolean _glfwIsValidContext(_GLFWwndconfig* wndconfig);
|
2010-09-07 15:34:51 +00:00
|
|
|
|
2012-01-30 11:04:16 +00:00
|
|
|
// Monitor management (monitor.c)
|
2012-09-12 17:35:52 +00:00
|
|
|
_GLFWmonitor* _glfwCreateMonitor(const char* name,
|
2012-09-13 15:46:40 +00:00
|
|
|
GLboolean primary,
|
2012-09-12 17:35:52 +00:00
|
|
|
int physicalWidth, int physicalHeight,
|
2012-10-22 00:39:22 +00:00
|
|
|
int x, int y);
|
2012-09-12 17:35:52 +00:00
|
|
|
void _glfwDestroyMonitor(_GLFWmonitor* monitor);
|
|
|
|
void _glfwDestroyMonitors(void);
|
2010-09-07 15:34:51 +00:00
|
|
|
|
|
|
|
#endif // _internal_h_
|