mirror of
https://github.com/glfw/glfw.git
synced 2026-08-29 03:04:14 +02:00
Merge branch 'master' into multi-monitor
Conflicts: .gitignore examples/CMakeLists.txt include/GL/glfw3.h src/CMakeLists.txt src/internal.h src/win32_platform.h src/win32_window.c src/x11_fullscreen.c src/x11_platform.h tests/listmodes.c
This commit is contained in:
@@ -67,6 +67,12 @@ extern "C" {
|
||||
#endif
|
||||
#endif /* APIENTRY */
|
||||
|
||||
/* TEMPORARY MinGW-w64 hacks.
|
||||
*/
|
||||
#if __MINGW64__
|
||||
#define WINAPI
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
/* The following three defines are here solely to make some Windows-based
|
||||
* <GL/gl.h> files happy. Theoretically we could include <windows.h>, but
|
||||
@@ -113,7 +119,11 @@ extern "C" {
|
||||
|
||||
/* ---------------- GLFW related system specific defines ----------------- */
|
||||
|
||||
#if defined(_WIN32) && defined(GLFW_BUILD_DLL)
|
||||
#if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL)
|
||||
#error "You must not have both GLFW_DLL and _GLFW_BUILD_DLL defined"
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(_GLFW_BUILD_DLL)
|
||||
|
||||
/* We are building a Win32 DLL */
|
||||
#define GLFWAPI __declspec(dllexport)
|
||||
@@ -136,15 +146,7 @@ extern "C" {
|
||||
|
||||
/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */
|
||||
|
||||
/* Include the declaration of the size_t type used below.
|
||||
*/
|
||||
#include <stddef.h>
|
||||
|
||||
/* Include standard OpenGL headers: GLFW uses GL_FALSE/GL_TRUE, and it is
|
||||
* convenient for the user to only have to include <GL/glfw.h>. This also
|
||||
* solves the problem with Windows <GL/gl.h> and <GL/glu.h> needing some
|
||||
* special defines which normally requires the user to include <windows.h>
|
||||
* (which is not a nice solution for portable programs).
|
||||
/* Include the chosen OpenGL header and, optionally, the GLU header.
|
||||
*/
|
||||
#if defined(__APPLE_CC__)
|
||||
#if defined(GLFW_INCLUDE_GL3)
|
||||
@@ -153,7 +155,7 @@ extern "C" {
|
||||
#define GL_GLEXT_LEGACY
|
||||
#include <OpenGL/gl.h>
|
||||
#endif
|
||||
#ifndef GLFW_NO_GLU
|
||||
#if defined(GLFW_INCLUDE_GLU)
|
||||
#include <OpenGL/glu.h>
|
||||
#endif
|
||||
#else
|
||||
@@ -162,7 +164,7 @@ extern "C" {
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
#ifndef GLFW_NO_GLU
|
||||
#if defined(GLFW_INCLUDE_GLU)
|
||||
#include <GL/glu.h>
|
||||
#endif
|
||||
#endif
|
||||
@@ -455,6 +457,7 @@ extern "C" {
|
||||
#define GLFW_VERSION_UNAVAILABLE 0x00070007
|
||||
#define GLFW_PLATFORM_ERROR 0x00070008
|
||||
#define GLFW_WINDOW_NOT_ACTIVE 0x00070009
|
||||
#define GLFW_FORMAT_UNAVAILABLE 0x0007000A
|
||||
|
||||
/* Gamma ramps */
|
||||
#define GLFW_GAMMA_RAMP_SIZE 256
|
||||
@@ -475,6 +478,9 @@ extern "C" {
|
||||
/* Monitor handle type */
|
||||
typedef void* GLFWmonitor;
|
||||
|
||||
/* OpenGL function pointer type */
|
||||
typedef void (*GLFWglproc)(void);
|
||||
|
||||
/* Window handle type */
|
||||
typedef void* GLFWwindow;
|
||||
|
||||
@@ -486,12 +492,11 @@ typedef void (* GLFWwindowrefreshfun)(GLFWwindow);
|
||||
typedef void (* GLFWwindowfocusfun)(GLFWwindow,int);
|
||||
typedef void (* GLFWwindowiconifyfun)(GLFWwindow,int);
|
||||
typedef void (* GLFWmousebuttonfun)(GLFWwindow,int,int);
|
||||
typedef void (* GLFWmouseposfun)(GLFWwindow,int,int);
|
||||
typedef void (* GLFWscrollfun)(GLFWwindow,int,int);
|
||||
typedef void (* GLFWcursorposfun)(GLFWwindow,int,int);
|
||||
typedef void (* GLFWcursorenterfun)(GLFWwindow,int);
|
||||
typedef void (* GLFWscrollfun)(GLFWwindow,double,double);
|
||||
typedef void (* GLFWkeyfun)(GLFWwindow,int,int);
|
||||
typedef void (* GLFWcharfun)(GLFWwindow,int);
|
||||
typedef void* (* GLFWmallocfun)(size_t);
|
||||
typedef void (* GLFWfreefun)(void*);
|
||||
typedef void (* GLFWmonitordevicefun)(GLFWmonitor,int);
|
||||
|
||||
/* The video mode structure used by glfwGetVideoModes */
|
||||
@@ -512,20 +517,13 @@ typedef struct
|
||||
unsigned short blue[GLFW_GAMMA_RAMP_SIZE];
|
||||
} GLFWgammaramp;
|
||||
|
||||
/* Custom memory allocator interface */
|
||||
typedef struct
|
||||
{
|
||||
GLFWmallocfun malloc;
|
||||
GLFWfreefun free;
|
||||
} GLFWallocator;
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Prototypes
|
||||
*************************************************************************/
|
||||
|
||||
/* Initialization, termination and version querying */
|
||||
GLFWAPI int glfwInit(GLFWallocator* allocator);
|
||||
GLFWAPI int glfwInit(void);
|
||||
GLFWAPI void glfwTerminate(void);
|
||||
GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);
|
||||
GLFWAPI const char* glfwGetVersionString(void);
|
||||
@@ -586,13 +584,14 @@ GLFWAPI int glfwGetInputMode(GLFWwindow window, int mode);
|
||||
GLFWAPI void glfwSetInputMode(GLFWwindow window, int mode, int value);
|
||||
GLFWAPI int glfwGetKey(GLFWwindow window, int key);
|
||||
GLFWAPI int glfwGetMouseButton(GLFWwindow window, int button);
|
||||
GLFWAPI void glfwGetMousePos(GLFWwindow window, int* xpos, int* ypos);
|
||||
GLFWAPI void glfwSetMousePos(GLFWwindow window, int xpos, int ypos);
|
||||
GLFWAPI void glfwGetScrollOffset(GLFWwindow window, int* xoffset, int* yoffset);
|
||||
GLFWAPI void glfwGetCursorPos(GLFWwindow window, int* xpos, int* ypos);
|
||||
GLFWAPI void glfwSetCursorPos(GLFWwindow window, int xpos, int ypos);
|
||||
GLFWAPI void glfwGetScrollOffset(GLFWwindow window, double* xoffset, double* yoffset);
|
||||
GLFWAPI void glfwSetKeyCallback(GLFWkeyfun cbfun);
|
||||
GLFWAPI void glfwSetCharCallback(GLFWcharfun cbfun);
|
||||
GLFWAPI void glfwSetMouseButtonCallback(GLFWmousebuttonfun cbfun);
|
||||
GLFWAPI void glfwSetMousePosCallback(GLFWmouseposfun cbfun);
|
||||
GLFWAPI void glfwSetCursorPosCallback(GLFWcursorposfun cbfun);
|
||||
GLFWAPI void glfwSetCursorEnterCallback(GLFWcursorenterfun cbfun);
|
||||
GLFWAPI void glfwSetScrollCallback(GLFWscrollfun cbfun);
|
||||
|
||||
/* Joystick input */
|
||||
@@ -600,6 +599,10 @@ GLFWAPI int glfwGetJoystickParam(int joy, int param);
|
||||
GLFWAPI int glfwGetJoystickPos(int joy, float* pos, int numaxes);
|
||||
GLFWAPI int glfwGetJoystickButtons(int joy, unsigned char* buttons, int numbuttons);
|
||||
|
||||
/* Clipboard */
|
||||
GLFWAPI void glfwSetClipboardString(GLFWwindow window, const char* string);
|
||||
GLFWAPI const char* glfwGetClipboardString(GLFWwindow window);
|
||||
|
||||
/* Time */
|
||||
GLFWAPI double glfwGetTime(void);
|
||||
GLFWAPI void glfwSetTime(double time);
|
||||
@@ -610,7 +613,7 @@ GLFWAPI GLFWwindow glfwGetCurrentContext(void);
|
||||
GLFWAPI void glfwSwapBuffers(void);
|
||||
GLFWAPI void glfwSwapInterval(int interval);
|
||||
GLFWAPI int glfwExtensionSupported(const char* extension);
|
||||
GLFWAPI void* glfwGetProcAddress(const char* procname);
|
||||
GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname);
|
||||
GLFWAPI void glfwCopyContext(GLFWwindow src, GLFWwindow dst, unsigned long mask);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user