1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 02:38:52 -05:00

Merge branch 'master' into multi-monitor

This commit is contained in:
Camilla Berglund 2012-11-08 16:29:56 +01:00
commit e82683d498
7 changed files with 20 additions and 20 deletions

View File

@ -182,10 +182,6 @@ if (_GLFW_X11_GLX)
set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -ldl") set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -ldl")
endif() endif()
endif() endif()
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(_GLFW_HAS_LINUX_JOYSTICKS 1)
endif()
endif() endif()
#-------------------------------------------------------------------- #--------------------------------------------------------------------

View File

@ -63,9 +63,6 @@
// Define this to 1 if glXGetProcAddressEXT is available // Define this to 1 if glXGetProcAddressEXT is available
#cmakedefine _GLFW_HAS_GLXGETPROCADDRESSEXT #cmakedefine _GLFW_HAS_GLXGETPROCADDRESSEXT
// Define this to 1 if the Linux joystick API is available
#cmakedefine _GLFW_HAS_LINUX_JOYSTICKS
// The GLFW version as used by glfwGetVersionString // The GLFW version as used by glfwGetVersionString
#define _GLFW_VERSION_FULL "@GLFW_VERSION_FULL@" #define _GLFW_VERSION_FULL "@GLFW_VERSION_FULL@"

View File

@ -106,6 +106,8 @@ static LRESULT CALLBACK keyboardHook(int nCode, WPARAM wParam, LPARAM lParam)
void _glfwPlatformEnableSystemKeys(_GLFWwindow* window) void _glfwPlatformEnableSystemKeys(_GLFWwindow* window)
{ {
UNREFERENCED_PARAMETER(window);
if (_glfwLibrary.Win32.keyboardHook != NULL) if (_glfwLibrary.Win32.keyboardHook != NULL)
{ {
UnhookWindowsHookEx(_glfwLibrary.Win32.keyboardHook); UnhookWindowsHookEx(_glfwLibrary.Win32.keyboardHook);
@ -120,6 +122,8 @@ void _glfwPlatformEnableSystemKeys(_GLFWwindow* window)
void _glfwPlatformDisableSystemKeys(_GLFWwindow* window) void _glfwPlatformDisableSystemKeys(_GLFWwindow* window)
{ {
UNREFERENCED_PARAMETER(window);
_glfwLibrary.Win32.keyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, _glfwLibrary.Win32.keyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL,
keyboardHook, keyboardHook,
_glfwLibrary.Win32.instance, _glfwLibrary.Win32.instance,

View File

@ -52,7 +52,7 @@ static GLboolean getClosestVideoMode(int* width, int* height,
int* bpp, int* refreshRate, int* bpp, int* refreshRate,
GLboolean exactBPP) GLboolean exactBPP)
{ {
int mode, bestWidth, bestHeight, bestBPP, bestRate; int mode, bestWidth = 0, bestHeight = 0, bestBPP = 0, bestRate = 0;
unsigned int sizeDiff, rateDiff, leastSizeDiff, leastRateDiff; unsigned int sizeDiff, rateDiff, leastSizeDiff, leastRateDiff;
GLboolean foundMode = GL_FALSE; GLboolean foundMode = GL_FALSE;
DEVMODE dm; DEVMODE dm;
@ -139,7 +139,7 @@ void _glfwSetVideoMode(int* width, int* height,
closestRate = *refreshRate; closestRate = *refreshRate;
if (getClosestVideoMode(&closestWidth, &closestHeight, if (getClosestVideoMode(&closestWidth, &closestHeight,
&closestBPP, &closestRate, GL_FALSE)) &closestBPP, &closestRate, exactBPP))
{ {
dm.dmSize = sizeof(DEVMODE); dm.dmSize = sizeof(DEVMODE);
dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL; dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;

View File

@ -40,6 +40,7 @@
static void hideCursor(_GLFWwindow* window) static void hideCursor(_GLFWwindow* window)
{ {
UNREFERENCED_PARAMETER(window);
} }
@ -68,6 +69,8 @@ static void captureCursor(_GLFWwindow* window)
static void showCursor(_GLFWwindow* window) static void showCursor(_GLFWwindow* window)
{ {
UNREFERENCED_PARAMETER(window);
// Un-capture cursor // Un-capture cursor
ReleaseCapture(); ReleaseCapture();

View File

@ -719,7 +719,7 @@ const char* _glfwPlatformGetVersionString(void)
#if defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK) #if defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK)
" clock_gettime" " clock_gettime"
#endif #endif
#if defined(_GLFW_HAS_LINUX_JOYSTICKS) #if defined(__linux__)
" Linux-joystick-API" " Linux-joystick-API"
#else #else
" no-joystick-support" " no-joystick-support"

View File

@ -30,7 +30,7 @@
#include "internal.h" #include "internal.h"
#ifdef _GLFW_HAS_LINUX_JOYSTICKS #ifdef __linux__
#include <linux/joystick.h> #include <linux/joystick.h>
#include <sys/types.h> #include <sys/types.h>
@ -41,7 +41,7 @@
#include <dirent.h> #include <dirent.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#endif // _GLFW_HAS_LINUX_JOYSTICKS #endif // __linux__
//======================================================================== //========================================================================
@ -50,7 +50,7 @@
static int openJoystickDevice(int joy, const char* path) static int openJoystickDevice(int joy, const char* path)
{ {
#ifdef _GLFW_HAS_LINUX_JOYSTICKS #ifdef __linux__
char numAxes, numButtons; char numAxes, numButtons;
int fd, version; int fd, version;
@ -97,7 +97,7 @@ static int openJoystickDevice(int joy, const char* path)
} }
_glfwLibrary.X11.joystick[joy].present = GL_TRUE; _glfwLibrary.X11.joystick[joy].present = GL_TRUE;
#endif // _GLFW_HAS_LINUX_JOYSTICKS #endif // __linux__
return GL_TRUE; return GL_TRUE;
} }
@ -109,7 +109,7 @@ static int openJoystickDevice(int joy, const char* path)
static void pollJoystickEvents(void) static void pollJoystickEvents(void)
{ {
#ifdef _GLFW_HAS_LINUX_JOYSTICKS #ifdef __linux__
int i; int i;
ssize_t result; ssize_t result;
struct js_event e; struct js_event e;
@ -160,7 +160,7 @@ static void pollJoystickEvents(void)
} }
} }
} }
#endif // _GLFW_HAS_LINUX_JOYSTICKS #endif // __linux__
} }
@ -174,7 +174,7 @@ static void pollJoystickEvents(void)
int _glfwInitJoysticks(void) int _glfwInitJoysticks(void)
{ {
#ifdef _GLFW_HAS_LINUX_JOYSTICKS #ifdef __linux__
int i, joy = 0; int i, joy = 0;
regex_t regex; regex_t regex;
DIR* dir; DIR* dir;
@ -215,7 +215,7 @@ int _glfwInitJoysticks(void)
} }
regfree(&regex); regfree(&regex);
#endif // _GLFW_HAS_LINUX_JOYSTICKS #endif // __linux__
return GL_TRUE; return GL_TRUE;
} }
@ -227,7 +227,7 @@ int _glfwInitJoysticks(void)
void _glfwTerminateJoysticks(void) void _glfwTerminateJoysticks(void)
{ {
#ifdef _GLFW_HAS_LINUX_JOYSTICKS #ifdef __linux__
int i; int i;
for (i = 0; i <= GLFW_JOYSTICK_LAST; i++) for (i = 0; i <= GLFW_JOYSTICK_LAST; i++)
@ -241,7 +241,7 @@ void _glfwTerminateJoysticks(void)
_glfwLibrary.X11.joystick[i].present = GL_FALSE; _glfwLibrary.X11.joystick[i].present = GL_FALSE;
} }
} }
#endif // _GLFW_HAS_LINUX_JOYSTICKS #endif // __linux__
} }