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