mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-23 10:48:51 -05:00
Simplified function comment headers.
This commit is contained in:
parent
8ad7c456fd
commit
d97dddc8c4
|
@ -30,12 +30,11 @@
|
|||
#include "internal.h"
|
||||
#include <sys/param.h> // For MAXPATHLEN
|
||||
|
||||
//========================================================================
|
||||
// Change to our application bundle's resources directory, if present
|
||||
//========================================================================
|
||||
|
||||
#if defined(_GLFW_USE_CHDIR)
|
||||
|
||||
// Change to our application bundle's resources directory, if present
|
||||
//
|
||||
static void changeToResourcesDirectory(void)
|
||||
{
|
||||
char resourcesPath[MAXPATHLEN];
|
||||
|
|
|
@ -88,10 +88,8 @@ static _glfwJoystick _glfwJoysticks[GLFW_JOYSTICK_LAST + 1];
|
|||
static void getElementsCFArrayHandler(const void* value, void* parameter);
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Adds an element to the specified joystick
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void addJoystickElement(_glfwJoystick* joystick, CFTypeRef refElement)
|
||||
{
|
||||
long elementType, usagePage, usage;
|
||||
|
@ -183,22 +181,16 @@ static void addJoystickElement(_glfwJoystick* joystick, CFTypeRef refElement)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Adds an element to the specified joystick
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void getElementsCFArrayHandler(const void* value, void* parameter)
|
||||
{
|
||||
if (CFGetTypeID(value) == CFDictionaryGetTypeID())
|
||||
addJoystickElement((_glfwJoystick*) parameter, (CFTypeRef) value);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Returns the value of the specified element of the specified joystick
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static long getElementValue(_glfwJoystick* joystick, _glfwJoystickElement* element)
|
||||
{
|
||||
IOReturn result = kIOReturnSuccess;
|
||||
|
@ -224,11 +216,8 @@ static long getElementValue(_glfwJoystick* joystick, _glfwJoystickElement* eleme
|
|||
return (long) hidEvent.value;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Removes the specified joystick
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void removeJoystick(_glfwJoystick* joystick)
|
||||
{
|
||||
int i;
|
||||
|
@ -271,21 +260,15 @@ static void removeJoystick(_glfwJoystick* joystick)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Callback for user-initiated joystick removal
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void removalCallback(void* target, IOReturn result, void* refcon, void* sender)
|
||||
{
|
||||
removeJoystick((_glfwJoystick*) refcon);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Polls for joystick events and updates GLFW state
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void pollJoystickEvents(void)
|
||||
{
|
||||
int i;
|
||||
|
@ -326,10 +309,8 @@ static void pollJoystickEvents(void)
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Initialize joystick interface
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwInitJoysticks(void)
|
||||
{
|
||||
int deviceCounter = 0;
|
||||
|
@ -471,11 +452,8 @@ void _glfwInitJoysticks(void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Close all opened joystick handles
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwTerminateJoysticks(void)
|
||||
{
|
||||
int i;
|
||||
|
|
|
@ -36,10 +36,8 @@
|
|||
#include <IOKit/graphics/IOGraphicsLib.h>
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Get the name of the specified display
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
const char* getDisplayName(CGDirectDisplayID displayID)
|
||||
{
|
||||
char* name;
|
||||
|
@ -68,11 +66,8 @@ const char* getDisplayName(CGDirectDisplayID displayID)
|
|||
return name;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Check whether the display mode should be included in enumeration
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static GLboolean modeIsGood(CGDisplayModeRef mode)
|
||||
{
|
||||
uint32_t flags = CGDisplayModeGetIOFlags(mode);
|
||||
|
@ -100,11 +95,8 @@ static GLboolean modeIsGood(CGDisplayModeRef mode)
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Convert Core Graphics display mode to GLFW video mode
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode)
|
||||
{
|
||||
GLFWvidmode result;
|
||||
|
@ -135,10 +127,8 @@ static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode)
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Change the current video mode
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, int* width, int* height, int* bpp)
|
||||
{
|
||||
CGDisplayModeRef bestMode = NULL;
|
||||
|
@ -199,11 +189,8 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, int* width, int* height, int*
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Restore the previously saved (original) video mode
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwRestoreVideoMode(_GLFWmonitor* monitor)
|
||||
{
|
||||
CGDisplaySetDisplayMode(monitor->ns.displayID, monitor->ns.previousMode, NULL);
|
||||
|
|
|
@ -32,10 +32,8 @@
|
|||
#include <mach/mach_time.h>
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return raw time
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static uint64_t getRawTime(void)
|
||||
{
|
||||
return mach_absolute_time();
|
||||
|
@ -46,10 +44,8 @@ static uint64_t getRawTime(void)
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Initialise timer
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwInitTimer(void)
|
||||
{
|
||||
mach_timebase_info_data_t info;
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
#include <crt_externs.h>
|
||||
|
||||
|
||||
//========================================================================
|
||||
//------------------------------------------------------------------------
|
||||
// Delegate for window related notifications
|
||||
//========================================================================
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
@interface GLFWWindowDelegate : NSObject
|
||||
{
|
||||
|
@ -104,9 +104,9 @@
|
|||
@end
|
||||
|
||||
|
||||
//========================================================================
|
||||
//------------------------------------------------------------------------
|
||||
// Delegate for application related notifications
|
||||
//========================================================================
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
@interface GLFWApplicationDelegate : NSObject
|
||||
@end
|
||||
|
@ -144,11 +144,8 @@
|
|||
|
||||
@end
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Converts a Mac OS X keycode to a GLFW keycode
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static int convertMacKeyCode(unsigned int macKeyCode)
|
||||
{
|
||||
// Keyboard symbol translation table
|
||||
|
@ -292,9 +289,9 @@ static int convertMacKeyCode(unsigned int macKeyCode)
|
|||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
//------------------------------------------------------------------------
|
||||
// Content view class for the GLFW window
|
||||
//========================================================================
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
@interface GLFWContentView : NSView
|
||||
{
|
||||
|
@ -497,9 +494,9 @@ static int convertMacKeyCode(unsigned int macKeyCode)
|
|||
@end
|
||||
|
||||
|
||||
//========================================================================
|
||||
//------------------------------------------------------------------------
|
||||
// GLFW application class
|
||||
//========================================================================
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
@interface GLFWApplication : NSApplication
|
||||
@end
|
||||
|
@ -519,11 +516,8 @@ static int convertMacKeyCode(unsigned int macKeyCode)
|
|||
|
||||
@end
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Try to figure out what the calling application is called
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static NSString* findAppName(void)
|
||||
{
|
||||
unsigned int i;
|
||||
|
@ -564,17 +558,14 @@ static NSString* findAppName(void)
|
|||
return @"GLFW Application";
|
||||
}
|
||||
|
||||
#if defined(_GLFW_USE_MENUBAR)
|
||||
|
||||
//========================================================================
|
||||
// Set up the menu bar (manually)
|
||||
// This is nasty, nasty stuff -- calls to undocumented semi-private APIs that
|
||||
// could go away at any moment, lots of stuff that really should be
|
||||
// localize(d|able), etc. Loading a nib would save us this horror, but that
|
||||
// doesn't seem like a good thing to require of GLFW's clients.
|
||||
//========================================================================
|
||||
|
||||
#if defined(_GLFW_USE_MENUBAR)
|
||||
|
||||
//
|
||||
static void createMenuBar(void)
|
||||
{
|
||||
NSString* appName = findAppName();
|
||||
|
@ -636,11 +627,8 @@ static void createMenuBar(void)
|
|||
|
||||
#endif /* _GLFW_USE_MENUBAR */
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Initialize the Cocoa Application Kit
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static GLboolean initializeAppKit(void)
|
||||
{
|
||||
if (NSApp)
|
||||
|
@ -661,11 +649,8 @@ static GLboolean initializeAppKit(void)
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Create the Cocoa window
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static GLboolean createWindow(_GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig)
|
||||
{
|
||||
|
|
|
@ -36,10 +36,8 @@
|
|||
#include <stdio.h>
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Parses the client API version string and extracts the version number
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static GLboolean parseGLVersion(int* api, int* major, int* minor, int* rev)
|
||||
{
|
||||
int i, _api = GLFW_OPENGL_API, _major, _minor = 0, _rev = 0;
|
||||
|
|
|
@ -35,9 +35,8 @@
|
|||
#include <assert.h>
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Thread local storage attribute macro
|
||||
//========================================================================
|
||||
//
|
||||
#if defined(_MSC_VER)
|
||||
#define _GLFW_TLS __declspec(thread)
|
||||
#elif defined(__GNUC__)
|
||||
|
@ -47,16 +46,13 @@
|
|||
#endif
|
||||
|
||||
|
||||
//========================================================================
|
||||
// The per-thread current context/window pointer
|
||||
//========================================================================
|
||||
//
|
||||
static _GLFW_TLS _GLFWwindow* _glfwCurrentWindow = NULL;
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return a description of the specified EGL error
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static const char* getErrorString(EGLint error)
|
||||
{
|
||||
switch (error)
|
||||
|
@ -109,10 +105,8 @@ static const char* getErrorString(EGLint error)
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Initialize EGL
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
int _glfwInitContextAPI(void)
|
||||
{
|
||||
_glfw.egl.display = eglGetDisplay(_GLFW_EGL_NATIVE_DISPLAY);
|
||||
|
@ -140,21 +134,13 @@ int _glfwInitContextAPI(void)
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Terminate EGL
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwTerminateContextAPI(void)
|
||||
{
|
||||
eglTerminate(_glfw.egl.display);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Prepare for creation of the OpenGL context
|
||||
//========================================================================
|
||||
|
||||
#define setEGLattrib(attribName, attribValue) \
|
||||
{ \
|
||||
attribs[index++] = attribName; \
|
||||
|
@ -162,6 +148,8 @@ void _glfwTerminateContextAPI(void)
|
|||
assert(index < sizeof(attribs) / sizeof(attribs[0])); \
|
||||
}
|
||||
|
||||
// Prepare for creation of the OpenGL context
|
||||
//
|
||||
int _glfwCreateContext(_GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig,
|
||||
const _GLFWfbconfig* fbconfig)
|
||||
|
@ -357,11 +345,8 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||
|
||||
#undef setEGLattrib
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Destroy the OpenGL context
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwDestroyContext(_GLFWwindow* window)
|
||||
{
|
||||
#if defined(_GLFW_X11)
|
||||
|
@ -385,11 +370,8 @@ void _glfwDestroyContext(_GLFWwindow* window)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Analyzes the specified context for possible recreation
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
int _glfwAnalyzeContext(const _GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig,
|
||||
const _GLFWfbconfig* fbconfig)
|
||||
|
|
|
@ -44,9 +44,8 @@ void (*glXGetProcAddressEXT(const GLubyte* procName))();
|
|||
#endif
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Thread local storage attribute macro
|
||||
//========================================================================
|
||||
//
|
||||
#if defined(__GNUC__)
|
||||
#define _GLFW_TLS __thread
|
||||
#else
|
||||
|
@ -54,33 +53,25 @@ void (*glXGetProcAddressEXT(const GLubyte* procName))();
|
|||
#endif
|
||||
|
||||
|
||||
//========================================================================
|
||||
// The X error code as provided to the X error handler
|
||||
//========================================================================
|
||||
//
|
||||
static unsigned long _glfwErrorCode = Success;
|
||||
|
||||
|
||||
//========================================================================
|
||||
// The per-thread current context/window pointer
|
||||
//========================================================================
|
||||
//
|
||||
static _GLFW_TLS _GLFWwindow* _glfwCurrentWindow = NULL;
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Error handler used when creating a context
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static int errorHandler(Display *display, XErrorEvent* event)
|
||||
{
|
||||
_glfwErrorCode = event->error_code;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Create the OpenGL context using legacy API
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static GLXContext createLegacyContext(_GLFWwindow* window,
|
||||
GLXFBConfig fbconfig,
|
||||
GLXContext share)
|
||||
|
@ -108,10 +99,8 @@ static GLXContext createLegacyContext(_GLFWwindow* window,
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Initialize GLX
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
int _glfwInitContextAPI(void)
|
||||
{
|
||||
#ifdef _GLFW_DLOPEN_LIBGL
|
||||
|
@ -231,11 +220,8 @@ int _glfwInitContextAPI(void)
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Terminate GLX
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwTerminateContextAPI(void)
|
||||
{
|
||||
// Unload libGL.so if necessary
|
||||
|
@ -248,11 +234,6 @@ void _glfwTerminateContextAPI(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Prepare for creation of the OpenGL context
|
||||
//========================================================================
|
||||
|
||||
#define setGLXattrib(attribName, attribValue) \
|
||||
{ \
|
||||
attribs[index++] = attribName; \
|
||||
|
@ -260,6 +241,8 @@ void _glfwTerminateContextAPI(void)
|
|||
assert(index < sizeof(attribs) / sizeof(attribs[0])); \
|
||||
}
|
||||
|
||||
// Prepare for creation of the OpenGL context
|
||||
//
|
||||
int _glfwCreateContext(_GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig,
|
||||
const _GLFWfbconfig* fbconfig)
|
||||
|
@ -517,11 +500,8 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||
|
||||
#undef setGLXattrib
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Destroy the OpenGL context
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwDestroyContext(_GLFWwindow* window)
|
||||
{
|
||||
if (window->glx.visual)
|
||||
|
|
10
src/init.c
10
src/init.c
|
@ -36,26 +36,22 @@
|
|||
#include <stdarg.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Global state shared between compilation units of GLFW
|
||||
// These are documented in internal.h
|
||||
//------------------------------------------------------------------------
|
||||
//
|
||||
GLboolean _glfwInitialized = GL_FALSE;
|
||||
_GLFWlibrary _glfw;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// The current error callback
|
||||
// This is outside of _glfw so it can be initialized and usable before
|
||||
// glfwInit is called, which lets that function report errors
|
||||
//------------------------------------------------------------------------
|
||||
//
|
||||
static GLFWerrorfun _glfwErrorCallback = NULL;
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Returns a generic string representation of the specified error
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static const char* getErrorString(int error)
|
||||
{
|
||||
switch (error)
|
||||
|
|
14
src/input.c
14
src/input.c
|
@ -31,10 +31,8 @@
|
|||
#include "internal.h"
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Sets the cursor mode for the specified window
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void setCursorMode(_GLFWwindow* window, int newMode)
|
||||
{
|
||||
int width, height, oldMode, centerPosX, centerPosY;
|
||||
|
@ -66,11 +64,8 @@ static void setCursorMode(_GLFWwindow* window, int newMode)
|
|||
_glfwInputCursorMotion(window, window->cursorPosX, window->cursorPosY);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set sticky keys mode for the specified window
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void setStickyKeys(_GLFWwindow* window, int enabled)
|
||||
{
|
||||
if (window->stickyKeys == enabled)
|
||||
|
@ -91,11 +86,8 @@ static void setStickyKeys(_GLFWwindow* window, int enabled)
|
|||
window->stickyKeys = enabled;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set sticky mouse buttons mode for the specified window
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void setStickyMouseButtons(_GLFWwindow* window, int enabled)
|
||||
{
|
||||
if (window->stickyMouseButtons == enabled)
|
||||
|
|
|
@ -40,10 +40,8 @@
|
|||
#endif
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Lexical comparison function for GLFW video modes, used by qsort
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static int compareVideoModes(const void* firstPtr, const void* secondPtr)
|
||||
{
|
||||
int firstBPP, secondBPP, firstSize, secondSize;
|
||||
|
@ -70,11 +68,8 @@ static int compareVideoModes(const void* firstPtr, const void* secondPtr)
|
|||
return firstSize - secondSize;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Retrieves the available modes for the specified monitor
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static int refreshVideoModes(_GLFWmonitor* monitor)
|
||||
{
|
||||
int modeCount;
|
||||
|
|
|
@ -32,9 +32,8 @@
|
|||
#include <pthread.h>
|
||||
|
||||
|
||||
//========================================================================
|
||||
// The per-thread current context/window pointer
|
||||
//========================================================================
|
||||
//
|
||||
static pthread_key_t _glfwCurrentTLS;
|
||||
|
||||
|
||||
|
@ -42,10 +41,8 @@ static pthread_key_t _glfwCurrentTLS;
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Initialize OpenGL support
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
int _glfwInitContextAPI(void)
|
||||
{
|
||||
if (pthread_key_create(&_glfwCurrentTLS, NULL) != 0)
|
||||
|
@ -58,21 +55,15 @@ int _glfwInitContextAPI(void)
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Terminate OpenGL support
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwTerminateContextAPI(void)
|
||||
{
|
||||
pthread_key_delete(_glfwCurrentTLS);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Create the OpenGL context
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
int _glfwCreateContext(_GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig,
|
||||
const _GLFWfbconfig* fbconfig)
|
||||
|
@ -228,11 +219,8 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Destroy the OpenGL context
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwDestroyContext(_GLFWwindow* window)
|
||||
{
|
||||
[window->nsgl.pixelFormat release];
|
||||
|
|
|
@ -35,9 +35,8 @@
|
|||
#include <assert.h>
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Thread local storage attribute macro
|
||||
//========================================================================
|
||||
//
|
||||
#if defined(_MSC_VER)
|
||||
#define _GLFW_TLS __declspec(thread)
|
||||
#elif defined(__GNUC__)
|
||||
|
@ -47,20 +46,17 @@
|
|||
#endif
|
||||
|
||||
|
||||
//========================================================================
|
||||
// The per-thread current context/window pointer
|
||||
//========================================================================
|
||||
//
|
||||
static _GLFW_TLS _GLFWwindow* _glfwCurrentWindow = NULL;
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Initialize WGL-specific extensions
|
||||
// This function is called once before initial context creation, i.e. before
|
||||
// any WGL extensions could be present. This is done in order to have both
|
||||
// extension variable clearing and loading in the same place, hopefully
|
||||
// decreasing the possibility of forgetting to add one without the other.
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void initWGLExtensions(_GLFWwindow* window)
|
||||
{
|
||||
// This needs to include every function pointer loaded below
|
||||
|
@ -149,29 +145,19 @@ static void initWGLExtensions(_GLFWwindow* window)
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Initialize WGL
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
int _glfwInitContextAPI(void)
|
||||
{
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Terminate WGL
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwTerminateContextAPI(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Prepare for creation of the OpenGL context
|
||||
//========================================================================
|
||||
|
||||
#define setWGLattrib(attribName, attribValue) \
|
||||
{ \
|
||||
attribs[index++] = attribName; \
|
||||
|
@ -179,6 +165,8 @@ void _glfwTerminateContextAPI(void)
|
|||
assert(index < sizeof(attribs) / sizeof(attribs[0])); \
|
||||
}
|
||||
|
||||
// Prepare for creation of the OpenGL context
|
||||
//
|
||||
int _glfwCreateContext(_GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig,
|
||||
const _GLFWfbconfig* fbconfig)
|
||||
|
@ -417,11 +405,8 @@ int _glfwCreateContext(_GLFWwindow* window,
|
|||
|
||||
#undef setWGLattrib
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Destroy the OpenGL context
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwDestroyContext(_GLFWwindow* window)
|
||||
{
|
||||
if (window->wgl.context)
|
||||
|
@ -437,11 +422,8 @@ void _glfwDestroyContext(_GLFWwindow* window)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Analyzes the specified context for possible recreation
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
int _glfwAnalyzeContext(const _GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig,
|
||||
const _GLFWfbconfig* fbconfig)
|
||||
|
|
|
@ -39,22 +39,19 @@
|
|||
#endif // __BORLANDC__
|
||||
|
||||
|
||||
//========================================================================
|
||||
// GLFW DLL entry point
|
||||
//========================================================================
|
||||
|
||||
#if defined(_GLFW_BUILD_DLL)
|
||||
|
||||
// GLFW DLL entry point
|
||||
//
|
||||
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif // _GLFW_BUILD_DLL
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Load necessary libraries (DLLs)
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static GLboolean initLibraries(void)
|
||||
{
|
||||
#ifndef _GLFW_NO_DLOAD_WINMM
|
||||
|
@ -85,11 +82,8 @@ static GLboolean initLibraries(void)
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Unload used libraries (DLLs)
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void freeLibraries(void)
|
||||
{
|
||||
#ifndef _GLFW_NO_DLOAD_WINMM
|
||||
|
@ -106,10 +100,8 @@ static void freeLibraries(void)
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Returns a wide string version of the specified UTF-8 string
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
WCHAR* _glfwCreateWideStringFromUTF8(const char* source)
|
||||
{
|
||||
WCHAR* target;
|
||||
|
@ -130,11 +122,8 @@ WCHAR* _glfwCreateWideStringFromUTF8(const char* source)
|
|||
return target;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Returns a UTF-8 string version of the specified wide string
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
char* _glfwCreateUTF8FromWideString(const WCHAR* source)
|
||||
{
|
||||
char* target;
|
||||
|
|
|
@ -37,10 +37,8 @@
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Return GL_TRUE if joystick is present, otherwise GL_FALSE
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static GLboolean isJoystickPresent(int joy)
|
||||
{
|
||||
JOYINFO ji;
|
||||
|
@ -56,11 +54,8 @@ static GLboolean isJoystickPresent(int joy)
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Calculate normalized joystick position
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static float calcJoystickPos(DWORD pos, DWORD min, DWORD max)
|
||||
{
|
||||
float fpos = (float) pos;
|
||||
|
@ -75,19 +70,14 @@ static float calcJoystickPos(DWORD pos, DWORD min, DWORD max)
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Initialize joystick interface
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwInitJoysticks(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Close all opened joystick handles
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwTerminateJoysticks(void)
|
||||
{
|
||||
int i;
|
||||
|
|
|
@ -48,10 +48,8 @@
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Change the current video mode
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
int _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* mode)
|
||||
{
|
||||
GLFWvidmode current;
|
||||
|
@ -86,11 +84,8 @@ int _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* mode)
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Restore the previously saved (original) video mode
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwRestoreVideoMode(_GLFWmonitor* monitor)
|
||||
{
|
||||
ChangeDisplaySettingsEx(monitor->win32.name,
|
||||
|
|
|
@ -35,10 +35,8 @@
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Initialise timer
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwInitTimer(void)
|
||||
{
|
||||
__int64 freq;
|
||||
|
|
|
@ -34,20 +34,15 @@
|
|||
#include <malloc.h>
|
||||
#include <windowsx.h>
|
||||
|
||||
//========================================================================
|
||||
// Hide mouse cursor
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void hideCursor(_GLFWwindow* window)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(window);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Capture mouse cursor
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void captureCursor(_GLFWwindow* window)
|
||||
{
|
||||
RECT ClipWindowRect;
|
||||
|
@ -62,11 +57,8 @@ static void captureCursor(_GLFWwindow* window)
|
|||
SetCapture(window->win32.handle);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Show mouse cursor
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void showCursor(_GLFWwindow* window)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(window);
|
||||
|
@ -80,11 +72,8 @@ static void showCursor(_GLFWwindow* window)
|
|||
ShowCursor(TRUE);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Translates a Windows key to the corresponding GLFW key
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static int translateKey(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
MSG next_msg;
|
||||
|
@ -306,11 +295,8 @@ static int translateKey(WPARAM wParam, LPARAM lParam)
|
|||
return -1;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Window callback function (handles window events)
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
||||
WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -640,11 +626,8 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Translate client window size to full window size (including window borders)
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void getFullWindowSize(_GLFWwindow* window,
|
||||
int clientWidth, int clientHeight,
|
||||
int* fullWidth, int* fullHeight)
|
||||
|
@ -665,11 +648,8 @@ static void getFullWindowSize(_GLFWwindow* window,
|
|||
*fullHeight = rect.bottom - rect.top + 1;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Registers the GLFW window class
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static ATOM registerWindowClass(void)
|
||||
{
|
||||
WNDCLASS wc;
|
||||
|
@ -705,11 +685,8 @@ static ATOM registerWindowClass(void)
|
|||
return classAtom;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Creates the GLFW window and rendering context
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static int createWindow(_GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig,
|
||||
const _GLFWfbconfig* fbconfig)
|
||||
|
@ -789,11 +766,8 @@ static int createWindow(_GLFWwindow* window,
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Destroys the GLFW window and rendering context
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void destroyWindow(_GLFWwindow* window)
|
||||
{
|
||||
_glfwDestroyContext(window);
|
||||
|
|
|
@ -38,10 +38,8 @@
|
|||
#endif
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return the maxiumum of the specified values
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static int Max(int a, int b)
|
||||
{
|
||||
return (a > b) ? a : b;
|
||||
|
|
|
@ -39,10 +39,8 @@
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Set the specified property to the contents of the requested selection
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
Atom _glfwWriteSelection(XSelectionRequestEvent* request)
|
||||
{
|
||||
int i;
|
||||
|
|
|
@ -37,10 +37,8 @@
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Detect gamma ramp support and save original gamma ramp, if available
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwInitGammaRamp(void)
|
||||
{
|
||||
// RandR gamma support is only available with version 1.2 and above
|
||||
|
@ -83,11 +81,8 @@ void _glfwInitGammaRamp(void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Restore original gamma ramp if necessary
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwTerminateGammaRamp(void)
|
||||
{
|
||||
if (_glfw.originalRampSize && _glfw.rampChanged)
|
||||
|
|
|
@ -35,10 +35,8 @@
|
|||
#include <limits.h>
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Translate an X11 key code to a GLFW key code.
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static int keyCodeToGLFWKeyCode(int keyCode)
|
||||
{
|
||||
int keySym;
|
||||
|
@ -214,11 +212,8 @@ static int keyCodeToGLFWKeyCode(int keyCode)
|
|||
return -1;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Update the key code LUT
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void updateKeyCodeLUT(void)
|
||||
{
|
||||
int i, keyCode, keyCodeGLFW;
|
||||
|
@ -317,11 +312,8 @@ static void updateKeyCodeLUT(void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Check whether the specified atom is supported
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static Atom getSupportedAtom(Atom* supportedAtoms,
|
||||
unsigned long atomCount,
|
||||
const char* atomName)
|
||||
|
@ -341,11 +333,8 @@ static Atom getSupportedAtom(Atom* supportedAtoms,
|
|||
return None;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Check whether the running window manager is EWMH-compliant
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void detectEWMH(void)
|
||||
{
|
||||
Window* windowFromRoot = NULL;
|
||||
|
@ -429,11 +418,8 @@ static void detectEWMH(void)
|
|||
_glfw.x11.hasEWMH = GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Initialize X11 display and look for supported X11 extensions
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static GLboolean initDisplay(void)
|
||||
{
|
||||
Bool supported;
|
||||
|
@ -543,11 +529,8 @@ static GLboolean initDisplay(void)
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Create a blank cursor (for locked mouse mode)
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static Cursor createNULLCursor(void)
|
||||
{
|
||||
Pixmap cursormask;
|
||||
|
@ -574,11 +557,8 @@ static Cursor createNULLCursor(void)
|
|||
return cursor;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Terminate X11 display
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void terminateDisplay(void)
|
||||
{
|
||||
if (_glfw.x11.display)
|
||||
|
|
|
@ -45,10 +45,8 @@
|
|||
#endif // __linux__
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Attempt to open the specified joystick device
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static int openJoystickDevice(int joy, const char* path)
|
||||
{
|
||||
#ifdef __linux__
|
||||
|
@ -107,11 +105,8 @@ static int openJoystickDevice(int joy, const char* path)
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Polls for and processes events for all present joysticks
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void pollJoystickEvents(void)
|
||||
{
|
||||
#ifdef __linux__
|
||||
|
@ -173,10 +168,8 @@ static void pollJoystickEvents(void)
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Initialize joystick interface
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
int _glfwInitJoysticks(void)
|
||||
{
|
||||
#ifdef __linux__
|
||||
|
@ -225,11 +218,8 @@ int _glfwInitJoysticks(void)
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Close all opened joystick handles
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwTerminateJoysticks(void)
|
||||
{
|
||||
#ifdef __linux__
|
||||
|
|
|
@ -39,10 +39,8 @@
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Set the current video mode for the specified monitor
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* mode)
|
||||
{
|
||||
if (_glfw.x11.randr.available)
|
||||
|
@ -112,11 +110,8 @@ void _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* mode)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Restore the saved (original) video mode for the specified monitor
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwRestoreVideoMode(_GLFWmonitor* monitor)
|
||||
{
|
||||
if (_glfw.x11.randr.available)
|
||||
|
|
|
@ -34,10 +34,8 @@
|
|||
#include <time.h>
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return raw time
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static uint64_t getRawTime(void)
|
||||
{
|
||||
#if defined(CLOCK_MONOTONIC)
|
||||
|
@ -58,11 +56,8 @@ static uint64_t getRawTime(void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Initialise timer
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
void _glfwInitTimer(void)
|
||||
{
|
||||
#if defined(CLOCK_MONOTONIC)
|
||||
|
|
|
@ -855,10 +855,8 @@ static struct codepair {
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Convert X11 KeySym to Unicode
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
long _glfwKeySym2Unicode( KeySym keysym )
|
||||
{
|
||||
int min = 0;
|
||||
|
|
|
@ -47,10 +47,8 @@
|
|||
#define Button7 7
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Translates an X Window key to internal coding
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static int translateKey(int keycode)
|
||||
{
|
||||
// Use the pre-filled LUT (see updateKeyCodeLUT() in x11_init.c)
|
||||
|
@ -60,11 +58,8 @@ static int translateKey(int keycode)
|
|||
return -1;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Translates an X Window event to Unicode
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static int translateChar(XKeyEvent* event)
|
||||
{
|
||||
KeySym keysym;
|
||||
|
@ -76,11 +71,8 @@ static int translateChar(XKeyEvent* event)
|
|||
return (int) _glfwKeySym2Unicode(keysym);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Create the X11 window (and its colormap)
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static GLboolean createWindow(_GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig)
|
||||
{
|
||||
|
@ -230,11 +222,8 @@ static GLboolean createWindow(_GLFWwindow* window,
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Hide cursor
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void hideCursor(_GLFWwindow* window)
|
||||
{
|
||||
// Un-grab cursor (in windowed mode only; in fullscreen mode we still
|
||||
|
@ -253,11 +242,8 @@ static void hideCursor(_GLFWwindow* window)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Capture cursor
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void captureCursor(_GLFWwindow* window)
|
||||
{
|
||||
hideCursor(window);
|
||||
|
@ -276,11 +262,8 @@ static void captureCursor(_GLFWwindow* window)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Show cursor
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void showCursor(_GLFWwindow* window)
|
||||
{
|
||||
// Un-grab cursor (in windowed mode only; in fullscreen mode we still
|
||||
|
@ -300,11 +283,8 @@ static void showCursor(_GLFWwindow* window)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Enter fullscreen mode
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void enterFullscreenMode(_GLFWwindow* window)
|
||||
{
|
||||
if (!_glfw.x11.saver.changed)
|
||||
|
@ -391,11 +371,8 @@ static void enterFullscreenMode(_GLFWwindow* window)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Leave fullscreen mode
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void leaveFullscreenMode(_GLFWwindow* window)
|
||||
{
|
||||
_glfwRestoreVideoMode(window->monitor);
|
||||
|
@ -439,11 +416,8 @@ static void leaveFullscreenMode(_GLFWwindow* window)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Return the GLFW window corresponding to the specified X11 window
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
_GLFWwindow* _glfwFindWindowByHandle(Window handle)
|
||||
{
|
||||
_GLFWwindow* window;
|
||||
|
@ -457,11 +431,8 @@ _GLFWwindow* _glfwFindWindowByHandle(Window handle)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Process the specified X event
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
static void processEvent(XEvent *event)
|
||||
{
|
||||
_GLFWwindow* window = NULL;
|
||||
|
@ -750,11 +721,9 @@ static void processEvent(XEvent *event)
|
|||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//========================================================================
|
||||
// Retrieve a single window property of the specified type
|
||||
// Inspired by fghGetWindowProperty from freeglut
|
||||
//========================================================================
|
||||
|
||||
//
|
||||
unsigned long _glfwGetWindowProperty(Window window,
|
||||
Atom property,
|
||||
Atom type,
|
||||
|
|
Loading…
Reference in New Issue
Block a user