mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 18:15:10 +00:00
Removed duplicate documentation.
The public, platform, native, event and utility functions are already documented in-source. Having duplicate documentation inevitably means having them contradict one another. Furthermore, most of the function descriptions simply repeated the name of the function.
This commit is contained in:
parent
75705ba2c5
commit
3e78570a31
@ -37,10 +37,6 @@
|
||||
////// GLFW public API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Set the clipboard contents
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetClipboardString(GLFWwindow* handle, const char* string)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -54,11 +50,6 @@ GLFWAPI void glfwSetClipboardString(GLFWwindow* handle, const char* string)
|
||||
_glfwPlatformSetClipboardString(window, string);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return the current clipboard contents
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI const char* glfwGetClipboardString(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
|
@ -37,10 +37,6 @@
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Set the clipboard contents
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string)
|
||||
{
|
||||
NSArray* types = [NSArray arrayWithObjects:NSStringPboardType, nil];
|
||||
@ -51,11 +47,6 @@ void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string)
|
||||
forType:NSStringPboardType];
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return the current clipboard contents
|
||||
//========================================================================
|
||||
|
||||
const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
|
||||
{
|
||||
NSPasteboard* pasteboard = [NSPasteboard generalPasteboard];
|
||||
|
@ -35,13 +35,9 @@
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
|
||||
|
||||
//************************************************************************
|
||||
//**** GLFW internal functions ****
|
||||
//************************************************************************
|
||||
|
||||
//========================================================================
|
||||
// Save the original gamma ramp so that it can be restored later
|
||||
//========================================================================
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp)
|
||||
{
|
||||
@ -66,11 +62,6 @@ void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Make the specified gamma ramp current
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp)
|
||||
{
|
||||
int i;
|
||||
|
@ -77,10 +77,6 @@ static void changeToResourcesDirectory(void)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Initialize the GLFW library
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformInit(void)
|
||||
{
|
||||
_glfw.ns.autoreleasePool = [[NSAutoreleasePool alloc] init];
|
||||
@ -119,11 +115,6 @@ int _glfwPlatformInit(void)
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Close window, if open, and shut down GLFW
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformTerminate(void)
|
||||
{
|
||||
// TODO: Probably other cleanup
|
||||
@ -150,11 +141,6 @@ void _glfwPlatformTerminate(void)
|
||||
_glfwTerminateContextAPI();
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the GLFW version string
|
||||
//========================================================================
|
||||
|
||||
const char* _glfwPlatformGetVersionString(void)
|
||||
{
|
||||
const char* version = _GLFW_VERSION_FULL
|
||||
|
@ -492,10 +492,6 @@ void _glfwTerminateJoysticks(void)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Determine joystick capabilities
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformGetJoystickParam(int joy, int param)
|
||||
{
|
||||
if (!_glfwJoysticks[joy].present)
|
||||
@ -523,11 +519,6 @@ int _glfwPlatformGetJoystickParam(int joy, int param)
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get joystick axis positions
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformGetJoystickAxes(int joy, float* axes, int numaxes)
|
||||
{
|
||||
int i;
|
||||
@ -567,11 +558,6 @@ int _glfwPlatformGetJoystickAxes(int joy, float* axes, int numaxes)
|
||||
return numaxes;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get joystick button states
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons,
|
||||
int numbuttons)
|
||||
{
|
||||
@ -625,11 +611,6 @@ int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons,
|
||||
return button;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get joystick name
|
||||
//========================================================================
|
||||
|
||||
const char* _glfwPlatformGetJoystickName(int joy)
|
||||
{
|
||||
return _glfwJoysticks[joy].name;
|
||||
|
@ -215,10 +215,6 @@ void _glfwRestoreVideoMode(_GLFWmonitor* monitor)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Return a list of available monitors
|
||||
//========================================================================
|
||||
|
||||
_GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
||||
{
|
||||
uint32_t i, found = 0, monitorCount;
|
||||
@ -265,20 +261,10 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
||||
return monitors;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Destroy a monitor struct
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformDestroyMonitor(_GLFWmonitor* monitor)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get a list of available video modes
|
||||
//========================================================================
|
||||
|
||||
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found)
|
||||
{
|
||||
CFArrayRef modes;
|
||||
@ -307,11 +293,6 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found)
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the current video mode for the specified monitor
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode *mode)
|
||||
{
|
||||
CGDisplayModeRef displayMode;
|
||||
|
@ -64,21 +64,12 @@ void _glfwInitTimer(void)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Return timer value in seconds
|
||||
//========================================================================
|
||||
|
||||
double _glfwPlatformGetTime(void)
|
||||
{
|
||||
return (double) (getRawTime() - _glfw.ns.timer.base) *
|
||||
_glfw.ns.timer.resolution;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set timer value in seconds
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetTime(double time)
|
||||
{
|
||||
_glfw.ns.timer.base = getRawTime() -
|
||||
|
@ -721,11 +721,6 @@ static GLboolean createWindow(_GLFWwindow* window,
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Here is where the window is created, and the OpenGL rendering context is
|
||||
// created
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig,
|
||||
const _GLFWfbconfig* fbconfig)
|
||||
@ -793,11 +788,6 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Properly kill the window / video display
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
||||
{
|
||||
[window->ns.object orderOut:nil];
|
||||
@ -824,73 +814,38 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
||||
// TODO: Probably more cleanup
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set the window title
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char *title)
|
||||
{
|
||||
[window->ns.object setTitle:[NSString stringWithUTF8String:title]];
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set the window size
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
|
||||
{
|
||||
[window->ns.object setContentSize:NSMakeSize(width, height)];
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Iconify the window
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformIconifyWindow(_GLFWwindow* window)
|
||||
{
|
||||
[window->ns.object miniaturize:nil];
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Restore (un-iconify) the window
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformRestoreWindow(_GLFWwindow* window)
|
||||
{
|
||||
[window->ns.object deminiaturize:nil];
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Show window
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformShowWindow(_GLFWwindow* window)
|
||||
{
|
||||
[window->ns.object makeKeyAndOrderFront:nil];
|
||||
_glfwInputWindowVisibility(window, GL_TRUE);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Hide window
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformHideWindow(_GLFWwindow* window)
|
||||
{
|
||||
[window->ns.object orderOut:nil];
|
||||
_glfwInputWindowVisibility(window, GL_FALSE);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Poll for new window and input events
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformPollEvents(void)
|
||||
{
|
||||
for (;;)
|
||||
@ -909,11 +864,6 @@ void _glfwPlatformPollEvents(void)
|
||||
_glfw.ns.autoreleasePool = [[NSAutoreleasePool alloc] init];
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Wait for new window and input events
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformWaitEvents(void)
|
||||
{
|
||||
// I wanted to pass NO to dequeue:, and rely on PollEvents to
|
||||
@ -928,11 +878,6 @@ void _glfwPlatformWaitEvents(void)
|
||||
_glfwPlatformPollEvents();
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set physical cursor position
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetCursorPos(_GLFWwindow* window, int x, int y)
|
||||
{
|
||||
if (window->monitor)
|
||||
@ -953,11 +898,6 @@ void _glfwPlatformSetCursorPos(_GLFWwindow* window, int x, int y)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set physical mouse cursor mode
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
|
||||
{
|
||||
switch (mode)
|
||||
@ -980,10 +920,6 @@ void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
|
||||
////// GLFW native API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Returns the Cocoa object of the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI id glfwGetCocoaWindow(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
|
@ -92,10 +92,6 @@ static GLboolean parseGLVersion(int* api, int* major, int* minor, int* rev)
|
||||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Checks whether the client API part of the window config is sane
|
||||
//========================================================================
|
||||
|
||||
GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig)
|
||||
{
|
||||
if (wndconfig->clientAPI != GLFW_OPENGL_API &&
|
||||
@ -210,11 +206,6 @@ GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig)
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Reads back context properties
|
||||
//========================================================================
|
||||
|
||||
GLboolean _glfwRefreshContextParams(void)
|
||||
{
|
||||
_GLFWwindow* window = _glfwPlatformGetCurrentContext();
|
||||
@ -315,11 +306,6 @@ GLboolean _glfwRefreshContextParams(void)
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Checks whether the current context fulfils the specified requirements
|
||||
//========================================================================
|
||||
|
||||
GLboolean _glfwIsValidContext(_GLFWwndconfig* wndconfig)
|
||||
{
|
||||
_GLFWwindow* window = _glfwPlatformGetCurrentContext();
|
||||
@ -342,13 +328,7 @@ GLboolean _glfwIsValidContext(_GLFWwndconfig* wndconfig)
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Check if a string can be found in a client API extension string
|
||||
//========================================================================
|
||||
|
||||
int _glfwStringInExtensionString(const char* string,
|
||||
const GLubyte* extensions)
|
||||
int _glfwStringInExtensionString(const char* string, const GLubyte* extensions)
|
||||
{
|
||||
const GLubyte* start;
|
||||
GLubyte* where;
|
||||
@ -382,10 +362,6 @@ int _glfwStringInExtensionString(const char* string,
|
||||
////// GLFW public API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Make the context associated with the specified window current
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwMakeContextCurrent(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -402,11 +378,6 @@ GLFWAPI void glfwMakeContextCurrent(GLFWwindow* handle)
|
||||
_glfwPlatformMakeContextCurrent(window);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Returns the window whose context is current
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI GLFWwindow* glfwGetCurrentContext(void)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
@ -418,11 +389,6 @@ GLFWAPI GLFWwindow* glfwGetCurrentContext(void)
|
||||
return (GLFWwindow*) _glfwPlatformGetCurrentContext();
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Swap buffers (double-buffering)
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSwapBuffers(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -436,11 +402,6 @@ GLFWAPI void glfwSwapBuffers(GLFWwindow* handle)
|
||||
_glfwPlatformSwapBuffers(window);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set double buffering swap interval (0 = vsync off)
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSwapInterval(int interval)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
@ -458,11 +419,6 @@ GLFWAPI void glfwSwapInterval(int interval)
|
||||
_glfwPlatformSwapInterval(interval);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Check if a client API extension is available at runtime
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI int glfwExtensionSupported(const char* extension)
|
||||
{
|
||||
const GLubyte* extensions;
|
||||
@ -523,12 +479,6 @@ GLFWAPI int glfwExtensionSupported(const char* extension)
|
||||
return _glfwPlatformExtensionSupported(extension);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the function pointer to a client API function
|
||||
// This can be used to get access to client API extension functions
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
|
@ -402,9 +402,9 @@ int _glfwAnalyzeContext(const _GLFWwindow* window,
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Make the OpenGL context associated with the specified window current
|
||||
//========================================================================
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
|
||||
{
|
||||
@ -438,41 +438,21 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
|
||||
_glfwCurrentWindow = window;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return the window object whose context is current
|
||||
//========================================================================
|
||||
|
||||
_GLFWwindow* _glfwPlatformGetCurrentContext(void)
|
||||
{
|
||||
return _glfwCurrentWindow;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Swap OpenGL buffers
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSwapBuffers(_GLFWwindow* window)
|
||||
{
|
||||
eglSwapBuffers(_glfw.egl.display, window->egl.surface);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set double buffering swap interval
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSwapInterval(int interval)
|
||||
{
|
||||
eglSwapInterval(_glfw.egl.display, interval);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Check if an OpenGL extension is available at runtime
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformExtensionSupported(const char* extension)
|
||||
{
|
||||
const char* extensions;
|
||||
@ -487,11 +467,6 @@ int _glfwPlatformExtensionSupported(const char* extension)
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the function pointer to an OpenGL function
|
||||
//========================================================================
|
||||
|
||||
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
||||
{
|
||||
return eglGetProcAddress(procname);
|
||||
@ -502,10 +477,6 @@ GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
||||
////// GLFW native API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Return the EGL display
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI EGLDisplay glfwGetEGLDisplay(void)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
@ -517,11 +488,6 @@ GLFWAPI EGLDisplay glfwGetEGLDisplay(void)
|
||||
return _glfw.egl.display;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return the WGL context of the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -535,10 +501,6 @@ GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* handle)
|
||||
return window->egl.context;
|
||||
}
|
||||
|
||||
//========================================================================
|
||||
// Return the EGL surface of the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
|
14
src/gamma.c
14
src/gamma.c
@ -37,10 +37,6 @@
|
||||
////// GLFW public API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Calculate a gamma ramp from the specified value and set it
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetGamma(float gamma)
|
||||
{
|
||||
int i, size = GLFW_GAMMA_RAMP_SIZE;
|
||||
@ -82,11 +78,6 @@ GLFWAPI void glfwSetGamma(float gamma)
|
||||
glfwSetGammaRamp(&ramp);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return the cached currently set gamma ramp
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwGetGammaRamp(GLFWgammaramp* ramp)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
@ -98,11 +89,6 @@ GLFWAPI void glfwGetGammaRamp(GLFWgammaramp* ramp)
|
||||
*ramp = _glfw.currentRamp;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Make the specified gamma ramp current
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetGammaRamp(const GLFWgammaramp* ramp)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
|
@ -542,10 +542,6 @@ void _glfwDestroyContext(_GLFWwindow* window)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Make the OpenGL context associated with the specified window current
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
|
||||
{
|
||||
if (window)
|
||||
@ -560,31 +556,16 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
|
||||
_glfwCurrentWindow = window;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return the window object whose context is current
|
||||
//========================================================================
|
||||
|
||||
_GLFWwindow* _glfwPlatformGetCurrentContext(void)
|
||||
{
|
||||
return _glfwCurrentWindow;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Swap OpenGL buffers
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSwapBuffers(_GLFWwindow* window)
|
||||
{
|
||||
glXSwapBuffers(_glfw.x11.display, window->x11.handle);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set double buffering swap interval
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSwapInterval(int interval)
|
||||
{
|
||||
_GLFWwindow* window = _glfwCurrentWindow;
|
||||
@ -604,11 +585,6 @@ void _glfwPlatformSwapInterval(int interval)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Check if an OpenGL extension is available at runtime
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformExtensionSupported(const char* extension)
|
||||
{
|
||||
const GLubyte* extensions;
|
||||
@ -625,11 +601,6 @@ int _glfwPlatformExtensionSupported(const char* extension)
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the function pointer to an OpenGL function
|
||||
//========================================================================
|
||||
|
||||
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
||||
{
|
||||
return _glfw_glXGetProcAddress((const GLubyte*) procname);
|
||||
@ -640,10 +611,6 @@ GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
||||
////// GLFW native API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Return the GLX context of the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
|
33
src/init.c
33
src/init.c
@ -87,13 +87,9 @@ static const char* getErrorString(int error)
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW internal API //////
|
||||
////// GLFW event API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Register error
|
||||
//========================================================================
|
||||
|
||||
void _glfwInputError(int error, const char* format, ...)
|
||||
{
|
||||
if (_glfwErrorCallback)
|
||||
@ -127,10 +123,6 @@ void _glfwInputError(int error, const char* format, ...)
|
||||
////// GLFW public API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Initialize various GLFW state
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI int glfwInit(void)
|
||||
{
|
||||
if (_glfwInitialized)
|
||||
@ -160,11 +152,6 @@ GLFWAPI int glfwInit(void)
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Close window and shut down library
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwTerminate(void)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
@ -181,12 +168,6 @@ GLFWAPI void glfwTerminate(void)
|
||||
_glfwInitialized = GL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get GLFW version
|
||||
// This function may be called without GLFW having been initialized
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev)
|
||||
{
|
||||
if (major != NULL)
|
||||
@ -199,23 +180,11 @@ GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev)
|
||||
*rev = GLFW_VERSION_REVISION;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the GLFW version string
|
||||
// This function may be called without GLFW having been initialized
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI const char* glfwGetVersionString(void)
|
||||
{
|
||||
return _glfwPlatformGetVersionString();
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Sets the callback function for GLFW errors
|
||||
// This function may be called without GLFW having been initialized
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetErrorCallback(GLFWerrorfun cbfun)
|
||||
{
|
||||
_glfwErrorCallback = cbfun;
|
||||
|
96
src/input.c
96
src/input.c
@ -116,13 +116,9 @@ static void setStickyMouseButtons(_GLFWwindow* window, int enabled)
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW internal API //////
|
||||
////// GLFW event API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Register keyboard activity
|
||||
//========================================================================
|
||||
|
||||
void _glfwInputKey(_GLFWwindow* window, int key, int action)
|
||||
{
|
||||
GLboolean repeated = GL_FALSE;
|
||||
@ -150,11 +146,6 @@ void _glfwInputKey(_GLFWwindow* window, int key, int action)
|
||||
window->callbacks.key((GLFWwindow*) window, key, action);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Register (keyboard) character activity
|
||||
//========================================================================
|
||||
|
||||
void _glfwInputChar(_GLFWwindow* window, int character)
|
||||
{
|
||||
// Valid Unicode (ISO 10646) character?
|
||||
@ -165,11 +156,6 @@ void _glfwInputChar(_GLFWwindow* window, int character)
|
||||
window->callbacks.character((GLFWwindow*) window, character);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Register scroll events
|
||||
//========================================================================
|
||||
|
||||
void _glfwInputScroll(_GLFWwindow* window, double xoffset, double yoffset)
|
||||
{
|
||||
window->scrollX += xoffset;
|
||||
@ -179,11 +165,6 @@ void _glfwInputScroll(_GLFWwindow* window, double xoffset, double yoffset)
|
||||
window->callbacks.scroll((GLFWwindow*) window, xoffset, yoffset);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Register mouse button clicks
|
||||
//========================================================================
|
||||
|
||||
void _glfwInputMouseClick(_GLFWwindow* window, int button, int action)
|
||||
{
|
||||
if (button < 0 || button > GLFW_MOUSE_BUTTON_LAST)
|
||||
@ -199,11 +180,6 @@ void _glfwInputMouseClick(_GLFWwindow* window, int button, int action)
|
||||
window->callbacks.mouseButton((GLFWwindow*) window, button, action);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Register cursor moves
|
||||
//========================================================================
|
||||
|
||||
void _glfwInputCursorMotion(_GLFWwindow* window, int x, int y)
|
||||
{
|
||||
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
|
||||
@ -231,11 +207,6 @@ void _glfwInputCursorMotion(_GLFWwindow* window, int x, int y)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Register cursor enter/leave events
|
||||
//========================================================================
|
||||
|
||||
void _glfwInputCursorEnter(_GLFWwindow* window, int entered)
|
||||
{
|
||||
if (window->callbacks.cursorEnter)
|
||||
@ -247,10 +218,6 @@ void _glfwInputCursorEnter(_GLFWwindow* window, int entered)
|
||||
////// GLFW public API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Returns the specified input mode of the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI int glfwGetInputMode(GLFWwindow* handle, int mode)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -275,11 +242,6 @@ GLFWAPI int glfwGetInputMode(GLFWwindow* handle, int mode)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Sets the specified input mode of the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -307,11 +269,6 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Returns the state of the specified key for the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI int glfwGetKey(GLFWwindow* handle, int key)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -338,11 +295,6 @@ GLFWAPI int glfwGetKey(GLFWwindow* handle, int key)
|
||||
return (int) window->key[key];
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Returns the state of the specified mouse button for the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI int glfwGetMouseButton(GLFWwindow* handle, int button)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -370,11 +322,6 @@ GLFWAPI int glfwGetMouseButton(GLFWwindow* handle, int button)
|
||||
return (int) window->mouseButton[button];
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Returns the last reported cursor position for the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwGetCursorPos(GLFWwindow* handle, int* xpos, int* ypos)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -392,12 +339,6 @@ GLFWAPI void glfwGetCursorPos(GLFWwindow* handle, int* xpos, int* ypos)
|
||||
*ypos = window->cursorPosY;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Sets the cursor position relative to the position of the client area of
|
||||
// the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetCursorPos(GLFWwindow* handle, int xpos, int ypos)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -427,11 +368,6 @@ GLFWAPI void glfwSetCursorPos(GLFWwindow* handle, int xpos, int ypos)
|
||||
_glfwPlatformSetCursorPos(window, xpos, ypos);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Returns the scroll offset for the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwGetScrollOffset(GLFWwindow* handle, double* xoffset, double* yoffset)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -449,11 +385,6 @@ GLFWAPI void glfwGetScrollOffset(GLFWwindow* handle, double* xoffset, double* yo
|
||||
*yoffset = window->scrollY;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set callback function for keyboard input
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetKeyCallback(GLFWwindow* handle, GLFWkeyfun cbfun)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -467,11 +398,6 @@ GLFWAPI void glfwSetKeyCallback(GLFWwindow* handle, GLFWkeyfun cbfun)
|
||||
window->callbacks.key = cbfun;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set callback function for character input
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetCharCallback(GLFWwindow* handle, GLFWcharfun cbfun)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -485,11 +411,6 @@ GLFWAPI void glfwSetCharCallback(GLFWwindow* handle, GLFWcharfun cbfun)
|
||||
window->callbacks.character = cbfun;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set callback function for mouse clicks
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetMouseButtonCallback(GLFWwindow* handle, GLFWmousebuttonfun cbfun)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -503,11 +424,6 @@ GLFWAPI void glfwSetMouseButtonCallback(GLFWwindow* handle, GLFWmousebuttonfun c
|
||||
window->callbacks.mouseButton = cbfun;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set callback function for mouse moves
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetCursorPosCallback(GLFWwindow* handle, GLFWcursorposfun cbfun)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -521,11 +437,6 @@ GLFWAPI void glfwSetCursorPosCallback(GLFWwindow* handle, GLFWcursorposfun cbfun
|
||||
window->callbacks.cursorPos = cbfun;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set callback function for cursor enter/leave events
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetCursorEnterCallback(GLFWwindow* handle, GLFWcursorenterfun cbfun)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -539,11 +450,6 @@ GLFWAPI void glfwSetCursorEnterCallback(GLFWwindow* handle, GLFWcursorenterfun c
|
||||
window->callbacks.cursorEnter = cbfun;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set callback function for scroll events
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetScrollCallback(GLFWwindow* handle, GLFWscrollfun cbfun)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
|
@ -35,10 +35,6 @@
|
||||
////// GLFW public API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Determine joystick capabilities
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI int glfwGetJoystickParam(int joy, int param)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
@ -56,11 +52,6 @@ GLFWAPI int glfwGetJoystickParam(int joy, int param)
|
||||
return _glfwPlatformGetJoystickParam(joy, param);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get joystick axis positions
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI int glfwGetJoystickAxes(int joy, float* axes, int numaxes)
|
||||
{
|
||||
int i;
|
||||
@ -90,11 +81,6 @@ GLFWAPI int glfwGetJoystickAxes(int joy, float* axes, int numaxes)
|
||||
return _glfwPlatformGetJoystickAxes(joy, axes, numaxes);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get joystick button states
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI int glfwGetJoystickButtons(int joy,
|
||||
unsigned char* buttons,
|
||||
int numbuttons)
|
||||
@ -126,11 +112,6 @@ GLFWAPI int glfwGetJoystickButtons(int joy,
|
||||
return _glfwPlatformGetJoystickButtons(joy, buttons, numbuttons);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get joystick name
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI const char* glfwGetJoystickName(int joy)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
|
@ -97,10 +97,6 @@ static int refreshVideoModes(_GLFWmonitor* monitor)
|
||||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Create a monitor struct from the specified information
|
||||
//========================================================================
|
||||
|
||||
_GLFWmonitor* _glfwCreateMonitor(const char* name,
|
||||
GLboolean primary,
|
||||
int widthMM, int heightMM,
|
||||
@ -123,11 +119,6 @@ _GLFWmonitor* _glfwCreateMonitor(const char* name,
|
||||
return monitor;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Destroy the specified monitor
|
||||
//========================================================================
|
||||
|
||||
void _glfwDestroyMonitor(_GLFWmonitor* monitor)
|
||||
{
|
||||
if (monitor == NULL)
|
||||
@ -140,11 +131,6 @@ void _glfwDestroyMonitor(_GLFWmonitor* monitor)
|
||||
free(monitor);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Enumerate monitors and notify user of changes
|
||||
//========================================================================
|
||||
|
||||
void _glfwInputMonitorChange(void)
|
||||
{
|
||||
int i, j, monitorCount;
|
||||
@ -203,11 +189,6 @@ void _glfwInputMonitorChange(void)
|
||||
_glfw.monitorCount = monitorCount;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Destroy all monitors
|
||||
//========================================================================
|
||||
|
||||
void _glfwDestroyMonitors(void)
|
||||
{
|
||||
int i;
|
||||
@ -220,11 +201,6 @@ void _glfwDestroyMonitors(void)
|
||||
_glfw.monitorCount = 0;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Returns the video mode closest to the desired one
|
||||
//========================================================================
|
||||
|
||||
const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor,
|
||||
const GLFWvidmode* desired)
|
||||
{
|
||||
@ -261,21 +237,11 @@ const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor,
|
||||
return closest;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Lexical comparison of GLFW video modes
|
||||
//========================================================================
|
||||
|
||||
int _glfwCompareVideoModes(const GLFWvidmode* first, const GLFWvidmode* second)
|
||||
{
|
||||
return compareVideoModes(first, second);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Convert BPP to RGB bits based on "best guess"
|
||||
//========================================================================
|
||||
|
||||
void _glfwSplitBPP(int bpp, int* red, int* green, int* blue)
|
||||
{
|
||||
int delta;
|
||||
@ -300,10 +266,6 @@ void _glfwSplitBPP(int bpp, int* red, int* green, int* blue)
|
||||
////// GLFW public API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Return the currently connected monitors
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI GLFWmonitor** glfwGetMonitors(int* count)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
@ -316,11 +278,6 @@ GLFWAPI GLFWmonitor** glfwGetMonitors(int* count)
|
||||
return (GLFWmonitor**) _glfw.monitors;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the primary monitor
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void)
|
||||
{
|
||||
int i;
|
||||
@ -350,11 +307,6 @@ GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void)
|
||||
return (GLFWmonitor*) primary;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get monitor parameter
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI int glfwGetMonitorParam(GLFWmonitor* handle, int param)
|
||||
{
|
||||
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
|
||||
@ -382,11 +334,6 @@ GLFWAPI int glfwGetMonitorParam(GLFWmonitor* handle, int param)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get monitor string
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* handle)
|
||||
{
|
||||
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
|
||||
@ -400,11 +347,6 @@ GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* handle)
|
||||
return monitor->name;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set a callback function for monitor events
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetMonitorCallback(GLFWmonitorfun cbfun)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
@ -416,11 +358,6 @@ GLFWAPI void glfwSetMonitorCallback(GLFWmonitorfun cbfun)
|
||||
_glfw.monitorCallback = cbfun;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get a list of available video modes
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* handle, int* count)
|
||||
{
|
||||
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
|
||||
@ -438,11 +375,6 @@ GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* handle, int* count)
|
||||
return monitor->modes;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the current video mode for the specified monitor
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI GLFWvidmode glfwGetVideoMode(GLFWmonitor* handle)
|
||||
{
|
||||
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
|
||||
|
@ -247,10 +247,6 @@ void _glfwDestroyContext(_GLFWwindow* window)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Make the OpenGL context associated with the specified window current
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
|
||||
{
|
||||
if (window)
|
||||
@ -261,32 +257,17 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
|
||||
pthread_setspecific(_glfwCurrentTLS, window);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return the window object whose context is current
|
||||
//========================================================================
|
||||
|
||||
_GLFWwindow* _glfwPlatformGetCurrentContext(void)
|
||||
{
|
||||
return (_GLFWwindow*) pthread_getspecific(_glfwCurrentTLS);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Swap buffers
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSwapBuffers(_GLFWwindow* window)
|
||||
{
|
||||
// ARP appears to be unnecessary, but this is future-proof
|
||||
[window->nsgl.context flushBuffer];
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set double buffering swap interval
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSwapInterval(int interval)
|
||||
{
|
||||
_GLFWwindow* window = _glfwPlatformGetCurrentContext();
|
||||
@ -295,22 +276,12 @@ void _glfwPlatformSwapInterval(int interval)
|
||||
[window->nsgl.context setValues:&sync forParameter:NSOpenGLCPSwapInterval];
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Check if an OpenGL extension is available at runtime
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformExtensionSupported(const char* extension)
|
||||
{
|
||||
// There are no NSGL extensions
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the function pointer to an OpenGL function
|
||||
//========================================================================
|
||||
|
||||
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
||||
{
|
||||
CFStringRef symbolName = CFStringCreateWithCString(kCFAllocatorDefault,
|
||||
@ -330,10 +301,6 @@ GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
||||
////// GLFW native API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Return the NSGL context of the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI id glfwGetNSGLContext(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
|
@ -35,10 +35,6 @@
|
||||
////// GLFW public API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Return timer value in seconds
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI double glfwGetTime(void)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
@ -50,11 +46,6 @@ GLFWAPI double glfwGetTime(void)
|
||||
return _glfwPlatformGetTime();
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set timer value in seconds
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetTime(double time)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
|
@ -527,10 +527,6 @@ int _glfwAnalyzeContext(const _GLFWwindow* window,
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Make the OpenGL context associated with the specified window current
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
|
||||
{
|
||||
if (window)
|
||||
@ -541,31 +537,16 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
|
||||
_glfwCurrentWindow = window;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return the window object whose context is current
|
||||
//========================================================================
|
||||
|
||||
_GLFWwindow* _glfwPlatformGetCurrentContext(void)
|
||||
{
|
||||
return _glfwCurrentWindow;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Swap buffers (double-buffering)
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSwapBuffers(_GLFWwindow* window)
|
||||
{
|
||||
SwapBuffers(window->wgl.dc);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set double buffering swap interval
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSwapInterval(int interval)
|
||||
{
|
||||
_GLFWwindow* window = _glfwCurrentWindow;
|
||||
@ -574,11 +555,6 @@ void _glfwPlatformSwapInterval(int interval)
|
||||
window->wgl.SwapIntervalEXT(interval);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Check if the current context supports the specified WGL extension
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformExtensionSupported(const char* extension)
|
||||
{
|
||||
const GLubyte* extensions;
|
||||
@ -608,11 +584,6 @@ int _glfwPlatformExtensionSupported(const char* extension)
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the function pointer to an OpenGL function
|
||||
//========================================================================
|
||||
|
||||
GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
||||
{
|
||||
return (GLFWglproc) wglGetProcAddress(procname);
|
||||
@ -623,10 +594,6 @@ GLFWglproc _glfwPlatformGetProcAddress(const char* procname)
|
||||
////// GLFW native API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Return the WGL context of the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
|
@ -39,10 +39,6 @@
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Set the clipboard contents
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string)
|
||||
{
|
||||
WCHAR* wideString;
|
||||
@ -89,11 +85,6 @@ void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string)
|
||||
free(wideString);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return the current clipboard contents
|
||||
//========================================================================
|
||||
|
||||
const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
|
||||
{
|
||||
HANDLE stringHandle;
|
||||
|
@ -36,20 +36,11 @@
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Retrieve the currently set gamma ramp
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp)
|
||||
{
|
||||
GetDeviceGammaRamp(GetDC(GetDesktopWindow()), (WORD*) ramp);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Push the specified gamma ramp to the monitor
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp)
|
||||
{
|
||||
SetDeviceGammaRamp(GetDC(GetDesktopWindow()), (WORD*) ramp);
|
||||
|
@ -160,10 +160,6 @@ char* _glfwCreateUTF8FromWideString(const WCHAR* source)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Initialize various GLFW state
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformInit(void)
|
||||
{
|
||||
// To make SetForegroundWindow work as we want, we need to fiddle
|
||||
@ -200,11 +196,6 @@ int _glfwPlatformInit(void)
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Close window and shut down library
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformTerminate(void)
|
||||
{
|
||||
// Restore the original gamma ramp
|
||||
@ -229,11 +220,6 @@ void _glfwPlatformTerminate(void)
|
||||
SPIF_SENDCHANGE);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the GLFW version string
|
||||
//========================================================================
|
||||
|
||||
const char* _glfwPlatformGetVersionString(void)
|
||||
{
|
||||
const char* version = _GLFW_VERSION_FULL
|
||||
|
@ -101,10 +101,6 @@ void _glfwTerminateJoysticks(void)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Determine joystick capabilities
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformGetJoystickParam(int joy, int param)
|
||||
{
|
||||
JOYCAPS jc;
|
||||
@ -139,11 +135,6 @@ int _glfwPlatformGetJoystickParam(int joy, int param)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get joystick axis positions
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformGetJoystickAxes(int joy, float* axes, int numaxes)
|
||||
{
|
||||
JOYCAPS jc;
|
||||
@ -185,11 +176,6 @@ int _glfwPlatformGetJoystickAxes(int joy, float* axes, int numaxes)
|
||||
return axis;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get joystick button states
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons,
|
||||
int numbuttons)
|
||||
{
|
||||
@ -246,11 +232,6 @@ int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons,
|
||||
return button;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get joystick name
|
||||
//========================================================================
|
||||
|
||||
const char* _glfwPlatformGetJoystickName(int joy)
|
||||
{
|
||||
JOYCAPS jc;
|
||||
|
@ -102,10 +102,6 @@ void _glfwRestoreVideoMode(_GLFWmonitor* monitor)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Return a list of available monitors
|
||||
//========================================================================
|
||||
|
||||
_GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
||||
{
|
||||
int size = 0, found = 0;
|
||||
@ -197,21 +193,11 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
||||
return monitors;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Destroy a monitor struct
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformDestroyMonitor(_GLFWmonitor* monitor)
|
||||
{
|
||||
free(monitor->win32.name);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get a list of available video modes
|
||||
//========================================================================
|
||||
|
||||
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found)
|
||||
{
|
||||
int modeIndex = 0, count = 0;
|
||||
@ -286,11 +272,6 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found)
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the current video mode for the specified monitor
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode)
|
||||
{
|
||||
DEVMODE dm;
|
||||
|
@ -62,10 +62,6 @@ void _glfwInitTimer(void)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Return timer value in seconds
|
||||
//========================================================================
|
||||
|
||||
double _glfwPlatformGetTime(void)
|
||||
{
|
||||
double t;
|
||||
@ -82,11 +78,6 @@ double _glfwPlatformGetTime(void)
|
||||
return t * _glfw.win32.timer.resolution;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set timer value in seconds
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetTime(double t)
|
||||
{
|
||||
__int64 t_64;
|
||||
|
@ -823,11 +823,6 @@ static void destroyWindow(_GLFWwindow* window)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Here is where the window is created, and the OpenGL rendering context is
|
||||
// created
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig,
|
||||
const _GLFWfbconfig* fbconfig)
|
||||
@ -897,11 +892,6 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Properly kill the window / video display
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
||||
{
|
||||
destroyWindow(window);
|
||||
@ -910,11 +900,6 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
||||
_glfwRestoreVideoMode(window->monitor);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set the window title
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
|
||||
{
|
||||
WCHAR* wideTitle = _glfwCreateWideStringFromUTF8(title);
|
||||
@ -930,11 +915,6 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
|
||||
free(wideTitle);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set the window size.
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
|
||||
{
|
||||
GLboolean sizeChanged = GL_FALSE;
|
||||
@ -969,31 +949,16 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Window iconification
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformIconifyWindow(_GLFWwindow* window)
|
||||
{
|
||||
ShowWindow(window->win32.handle, SW_MINIMIZE);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Window un-iconification
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformRestoreWindow(_GLFWwindow* window)
|
||||
{
|
||||
ShowWindow(window->win32.handle, SW_RESTORE);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Show or hide window
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformShowWindow(_GLFWwindow* window)
|
||||
{
|
||||
ShowWindow(window->win32.handle, SW_SHOWNORMAL);
|
||||
@ -1002,21 +967,11 @@ void _glfwPlatformShowWindow(_GLFWwindow* window)
|
||||
SetFocus(window->win32.handle);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Show or hide window
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformHideWindow(_GLFWwindow* window)
|
||||
{
|
||||
ShowWindow(window->win32.handle, SW_HIDE);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Poll for new window and input events
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformPollEvents(void)
|
||||
{
|
||||
MSG msg;
|
||||
@ -1091,11 +1046,6 @@ void _glfwPlatformPollEvents(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Wait for new window and input events
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformWaitEvents(void)
|
||||
{
|
||||
WaitMessage();
|
||||
@ -1103,11 +1053,6 @@ void _glfwPlatformWaitEvents(void)
|
||||
_glfwPlatformPollEvents();
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set physical cursor position
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetCursorPos(_GLFWwindow* window, int x, int y)
|
||||
{
|
||||
POINT pos;
|
||||
@ -1120,11 +1065,6 @@ void _glfwPlatformSetCursorPos(_GLFWwindow* window, int x, int y)
|
||||
SetCursorPos(pos.x, pos.y);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set physical mouse cursor mode
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
|
||||
{
|
||||
switch (mode)
|
||||
@ -1145,10 +1085,6 @@ void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
|
||||
////// GLFW native API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Returns the Win32 handle of the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI HWND glfwGetWin32Window(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
|
150
src/window.c
150
src/window.c
@ -65,13 +65,9 @@ static void clearScrollOffsets(void)
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW internal API //////
|
||||
////// GLFW event API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Register window focus events
|
||||
//========================================================================
|
||||
|
||||
void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean focused)
|
||||
{
|
||||
if (focused)
|
||||
@ -112,11 +108,6 @@ void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean focused)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Register window position events
|
||||
//========================================================================
|
||||
|
||||
void _glfwInputWindowPos(_GLFWwindow* window, int x, int y)
|
||||
{
|
||||
if (window->positionX == x && window->positionY == y)
|
||||
@ -129,11 +120,6 @@ void _glfwInputWindowPos(_GLFWwindow* window, int x, int y)
|
||||
window->callbacks.pos((GLFWwindow*) window, x, y);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Register window size events
|
||||
//========================================================================
|
||||
|
||||
void _glfwInputWindowSize(_GLFWwindow* window, int width, int height)
|
||||
{
|
||||
if (window->width == width && window->height == height)
|
||||
@ -146,11 +132,6 @@ void _glfwInputWindowSize(_GLFWwindow* window, int width, int height)
|
||||
window->callbacks.size((GLFWwindow*) window, width, height);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Register window size events
|
||||
//========================================================================
|
||||
|
||||
void _glfwInputWindowIconify(_GLFWwindow* window, int iconified)
|
||||
{
|
||||
if (window->iconified == iconified)
|
||||
@ -162,32 +143,17 @@ void _glfwInputWindowIconify(_GLFWwindow* window, int iconified)
|
||||
window->callbacks.iconify((GLFWwindow*) window, iconified);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Register window visibility events
|
||||
//========================================================================
|
||||
|
||||
void _glfwInputWindowVisibility(_GLFWwindow* window, int visible)
|
||||
{
|
||||
window->visible = visible;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Register window damage events
|
||||
//========================================================================
|
||||
|
||||
void _glfwInputWindowDamage(_GLFWwindow* window)
|
||||
{
|
||||
if (window->callbacks.refresh)
|
||||
window->callbacks.refresh((GLFWwindow*) window);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Register window close request events
|
||||
//========================================================================
|
||||
|
||||
void _glfwInputWindowCloseRequest(_GLFWwindow* window)
|
||||
{
|
||||
if (window->callbacks.close)
|
||||
@ -201,10 +167,6 @@ void _glfwInputWindowCloseRequest(_GLFWwindow* window)
|
||||
////// GLFW public API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Create the GLFW window and its associated context
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
|
||||
const char* title,
|
||||
GLFWmonitor* monitor,
|
||||
@ -339,11 +301,6 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
|
||||
return (GLFWwindow*) window;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Reset all window hints to their default values
|
||||
//========================================================================
|
||||
|
||||
void glfwDefaultWindowHints(void)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
@ -375,11 +332,6 @@ void glfwDefaultWindowHints(void)
|
||||
_glfw.hints.stencilBits = 8;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set hints for creating the window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwWindowHint(int target, int hint)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
@ -471,11 +423,6 @@ GLFWAPI void glfwWindowHint(int target, int hint)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Properly kill the window / video display
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwDestroyWindow(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -517,11 +464,6 @@ GLFWAPI void glfwDestroyWindow(GLFWwindow* handle)
|
||||
free(window);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set the window title
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetWindowTitle(GLFWwindow* handle, const char* title)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -535,11 +477,6 @@ GLFWAPI void glfwSetWindowTitle(GLFWwindow* handle, const char* title)
|
||||
_glfwPlatformSetWindowTitle(window, title);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the window size
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwGetWindowSize(GLFWwindow* handle, int* width, int* height)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -557,11 +494,6 @@ GLFWAPI void glfwGetWindowSize(GLFWwindow* handle, int* width, int* height)
|
||||
*height = window->height;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set the window size
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetWindowSize(GLFWwindow* handle, int width, int height)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -585,11 +517,6 @@ GLFWAPI void glfwSetWindowSize(GLFWwindow* handle, int width, int height)
|
||||
_glfwPlatformSetWindowSize(window, width, height);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Window iconification
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwIconifyWindow(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -606,11 +533,6 @@ GLFWAPI void glfwIconifyWindow(GLFWwindow* handle)
|
||||
_glfwPlatformIconifyWindow(window);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Window un-iconification
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwRestoreWindow(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -627,11 +549,6 @@ GLFWAPI void glfwRestoreWindow(GLFWwindow* handle)
|
||||
_glfwPlatformRestoreWindow(window);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Window show
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwShowWindow(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -648,11 +565,6 @@ GLFWAPI void glfwShowWindow(GLFWwindow* handle)
|
||||
_glfwPlatformShowWindow(window);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Window hide
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwHideWindow(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -669,11 +581,6 @@ GLFWAPI void glfwHideWindow(GLFWwindow* handle)
|
||||
_glfwPlatformHideWindow(window);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get window parameter
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI int glfwGetWindowParam(GLFWwindow* handle, int param)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -722,11 +629,6 @@ GLFWAPI int glfwGetWindowParam(GLFWwindow* handle, int param)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get window monitor
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -740,11 +642,6 @@ GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* handle)
|
||||
return (GLFWmonitor*) window->monitor;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set the user pointer for the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* handle, void* pointer)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -758,11 +655,6 @@ GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* handle, void* pointer)
|
||||
window->userPointer = pointer;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the user pointer for the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -776,11 +668,6 @@ GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* handle)
|
||||
return window->userPointer;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set callback function for window position changes
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetWindowPosCallback(GLFWwindow* handle, GLFWwindowposfun cbfun)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -794,11 +681,6 @@ GLFWAPI void glfwSetWindowPosCallback(GLFWwindow* handle, GLFWwindowposfun cbfun
|
||||
window->callbacks.pos = cbfun;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set callback function for window size changes
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetWindowSizeCallback(GLFWwindow* handle, GLFWwindowsizefun cbfun)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -812,11 +694,6 @@ GLFWAPI void glfwSetWindowSizeCallback(GLFWwindow* handle, GLFWwindowsizefun cbf
|
||||
window->callbacks.size = cbfun;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set callback function for window close events
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetWindowCloseCallback(GLFWwindow* handle, GLFWwindowclosefun cbfun)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -830,11 +707,6 @@ GLFWAPI void glfwSetWindowCloseCallback(GLFWwindow* handle, GLFWwindowclosefun c
|
||||
window->callbacks.close = cbfun;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set callback function for window refresh events
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetWindowRefreshCallback(GLFWwindow* handle, GLFWwindowrefreshfun cbfun)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -848,11 +720,6 @@ GLFWAPI void glfwSetWindowRefreshCallback(GLFWwindow* handle, GLFWwindowrefreshf
|
||||
window->callbacks.refresh = cbfun;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set callback function for window focus events
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetWindowFocusCallback(GLFWwindow* handle, GLFWwindowfocusfun cbfun)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -866,11 +733,6 @@ GLFWAPI void glfwSetWindowFocusCallback(GLFWwindow* handle, GLFWwindowfocusfun c
|
||||
window->callbacks.focus = cbfun;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set callback function for window iconification events
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwSetWindowIconifyCallback(GLFWwindow* handle, GLFWwindowiconifyfun cbfun)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
@ -884,11 +746,6 @@ GLFWAPI void glfwSetWindowIconifyCallback(GLFWwindow* handle, GLFWwindowiconifyf
|
||||
window->callbacks.iconify = cbfun;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Poll for new window and input events
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwPollEvents(void)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
@ -902,11 +759,6 @@ GLFWAPI void glfwPollEvents(void)
|
||||
_glfwPlatformPollEvents();
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Wait for new window and input events
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwWaitEvents(void)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
|
@ -131,10 +131,6 @@ Atom _glfwWriteSelection(XSelectionRequestEvent* request)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Set the clipboard contents
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string)
|
||||
{
|
||||
// Store the new string in preparation for a selection request event
|
||||
@ -147,11 +143,6 @@ void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string)
|
||||
window->x11.handle, CurrentTime);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return the current clipboard contents
|
||||
//========================================================================
|
||||
|
||||
const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
|
||||
{
|
||||
int i;
|
||||
|
@ -100,10 +100,6 @@ void _glfwTerminateGammaRamp(void)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Retrieve the currently set gamma ramp
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp)
|
||||
{
|
||||
// For now, don't support anything that is not GLFW_GAMMA_RAMP_SIZE
|
||||
@ -145,11 +141,6 @@ void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Push the specified gamma ramp to the monitor
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp)
|
||||
{
|
||||
// For now, don't support anything that is not GLFW_GAMMA_RAMP_SIZE
|
||||
|
@ -591,10 +591,6 @@ static void terminateDisplay(void)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Initialize various GLFW state
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformInit(void)
|
||||
{
|
||||
XInitThreads();
|
||||
@ -617,11 +613,6 @@ int _glfwPlatformInit(void)
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Close window and shut down library
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformTerminate(void)
|
||||
{
|
||||
if (_glfw.x11.cursor)
|
||||
@ -642,11 +633,6 @@ void _glfwPlatformTerminate(void)
|
||||
free(_glfw.x11.selection.string);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the GLFW version string
|
||||
//========================================================================
|
||||
|
||||
const char* _glfwPlatformGetVersionString(void)
|
||||
{
|
||||
const char* version = _GLFW_VERSION_FULL
|
||||
|
@ -255,10 +255,6 @@ void _glfwTerminateJoysticks(void)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Determine joystick capabilities
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformGetJoystickParam(int joy, int param)
|
||||
{
|
||||
pollJoystickEvents();
|
||||
@ -284,11 +280,6 @@ int _glfwPlatformGetJoystickParam(int joy, int param)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get joystick axis positions
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformGetJoystickAxes(int joy, float* axes, int numAxes)
|
||||
{
|
||||
int i;
|
||||
@ -307,11 +298,6 @@ int _glfwPlatformGetJoystickAxes(int joy, float* axes, int numAxes)
|
||||
return numAxes;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get joystick button states
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons,
|
||||
int numButtons)
|
||||
{
|
||||
@ -331,11 +317,6 @@ int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons,
|
||||
return numButtons;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get joystick name
|
||||
//========================================================================
|
||||
|
||||
const char* _glfwPlatformGetJoystickName(int joy)
|
||||
{
|
||||
if (!_glfw.x11.joystick[joy].present)
|
||||
|
@ -181,11 +181,6 @@ void _glfwRestoreVideoMode(_GLFWmonitor* monitor)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return a list of available monitors
|
||||
//========================================================================
|
||||
|
||||
_GLFWmonitor** _glfwPlatformGetMonitors(int* found)
|
||||
{
|
||||
_GLFWmonitor** monitors = NULL;
|
||||
@ -268,22 +263,12 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* found)
|
||||
return monitors;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Destroy a monitor struct
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformDestroyMonitor(_GLFWmonitor* monitor)
|
||||
{
|
||||
if (_glfw.x11.randr.available)
|
||||
XRRFreeOutputInfo(monitor->x11.output);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// List available video modes
|
||||
//========================================================================
|
||||
|
||||
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found)
|
||||
{
|
||||
GLFWvidmode* result;
|
||||
@ -372,11 +357,6 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found)
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the current video mode for the specified monitor
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode)
|
||||
{
|
||||
if (_glfw.x11.randr.available)
|
||||
|
@ -87,21 +87,12 @@ void _glfwInitTimer(void)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Return timer value in seconds
|
||||
//========================================================================
|
||||
|
||||
double _glfwPlatformGetTime(void)
|
||||
{
|
||||
return (double) (getRawTime() - _glfw.x11.timer.base) *
|
||||
_glfw.x11.timer.resolution;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set timer value in seconds
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetTime(double time)
|
||||
{
|
||||
_glfw.x11.timer.base = getRawTime() -
|
||||
|
@ -851,12 +851,12 @@ static struct codepair {
|
||||
};
|
||||
|
||||
|
||||
//************************************************************************
|
||||
//**** GLFW internal functions ****
|
||||
//************************************************************************
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// _glfwKeySym2Unicode() - Convert X11 KeySym to Unicode
|
||||
// Convert X11 KeySym to Unicode
|
||||
//========================================================================
|
||||
|
||||
long _glfwKeySym2Unicode( KeySym keysym )
|
||||
@ -893,3 +893,4 @@ long _glfwKeySym2Unicode( KeySym keysym )
|
||||
/* No matching Unicode value found */
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -858,11 +858,6 @@ unsigned long _glfwGetWindowProperty(Window window,
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Here is where the window is created, and
|
||||
// the OpenGL rendering context is created
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig,
|
||||
const _GLFWfbconfig* fbconfig)
|
||||
@ -902,11 +897,6 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Properly kill the window/video display
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
||||
{
|
||||
if (window->monitor)
|
||||
@ -928,11 +918,6 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set the window title
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
|
||||
{
|
||||
Atom type = XInternAtom(_glfw.x11.display, "UTF8_STRING", False);
|
||||
@ -970,11 +955,6 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set the window size
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
|
||||
{
|
||||
int mode = 0, sizeChanged = GL_FALSE;
|
||||
@ -1016,11 +996,6 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
|
||||
XResizeWindow(_glfw.x11.display, window->x11.handle, width, height);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Window iconification
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformIconifyWindow(_GLFWwindow* window)
|
||||
{
|
||||
if (window->x11.overrideRedirect)
|
||||
@ -1033,11 +1008,6 @@ void _glfwPlatformIconifyWindow(_GLFWwindow* window)
|
||||
XIconifyWindow(_glfw.x11.display, window->x11.handle, _glfw.x11.screen);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Window un-iconification
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformRestoreWindow(_GLFWwindow* window)
|
||||
{
|
||||
if (window->x11.overrideRedirect)
|
||||
@ -1050,11 +1020,6 @@ void _glfwPlatformRestoreWindow(_GLFWwindow* window)
|
||||
XMapWindow(_glfw.x11.display, window->x11.handle);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Show window
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformShowWindow(_GLFWwindow* window)
|
||||
{
|
||||
XMapRaised(_glfw.x11.display, window->x11.handle);
|
||||
@ -1070,22 +1035,12 @@ void _glfwPlatformShowWindow(_GLFWwindow* window)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Hide window
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformHideWindow(_GLFWwindow* window)
|
||||
{
|
||||
XUnmapWindow(_glfw.x11.display, window->x11.handle);
|
||||
XFlush(_glfw.x11.display);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Poll for new window and input events
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformPollEvents(void)
|
||||
{
|
||||
XEvent event;
|
||||
@ -1119,11 +1074,6 @@ void _glfwPlatformPollEvents(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Wait for new window and input events
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformWaitEvents(void)
|
||||
{
|
||||
int fd;
|
||||
@ -1140,11 +1090,6 @@ void _glfwPlatformWaitEvents(void)
|
||||
_glfwPlatformPollEvents();
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set physical cursor position
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetCursorPos(_GLFWwindow* window, int x, int y)
|
||||
{
|
||||
// Store the new position so it can be recognized later
|
||||
@ -1154,11 +1099,6 @@ void _glfwPlatformSetCursorPos(_GLFWwindow* window, int x, int y)
|
||||
XWarpPointer(_glfw.x11.display, None, window->x11.handle, 0,0,0,0, x, y);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set physical cursor mode
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
|
||||
{
|
||||
switch (mode)
|
||||
@ -1180,10 +1120,6 @@ void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
|
||||
////// GLFW native API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Return the X11 display
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI Display* glfwGetX11Display(void)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
@ -1195,11 +1131,6 @@ GLFWAPI Display* glfwGetX11Display(void)
|
||||
return _glfw.x11.display;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return the X11 handle of the specified window
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI Window glfwGetX11Window(GLFWwindow* handle)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
|
Loading…
Reference in New Issue
Block a user