summaryrefslogtreecommitdiffstats
path: root/src/glut/glx/glut_joy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glut/glx/glut_joy.c')
-rw-r--r--src/glut/glx/glut_joy.c85
1 files changed, 0 insertions, 85 deletions
diff --git a/src/glut/glx/glut_joy.c b/src/glut/glx/glut_joy.c
deleted file mode 100644
index 5025607922c..00000000000
--- a/src/glut/glx/glut_joy.c
+++ /dev/null
@@ -1,85 +0,0 @@
-
-/* Copyright (c) Mark J. Kilgard, 1997, 1998. */
-
-/* This program is freely distributable without licensing fees
- and is provided without guarantee or warrantee expressed or
- implied. This program is -not- in the public domain. */
-
-#ifdef _WIN32
-#ifdef __MINGW32__
-#include <GL/gl.h>
-#endif
-#include <windows.h>
-#ifndef __CYGWIN32__
-#include <mmsystem.h> /* Win32 Multimedia API header. */
-#endif
-#endif
-
-#include "glutint.h"
-
-/* CENTRY */
-void GLUTAPIENTRY
-glutJoystickFunc(GLUTjoystickCB joystickFunc, int pollInterval)
-{
-#ifdef _WIN32
- if (joystickFunc && (pollInterval > 0)) {
- if (__glutCurrentWindow->entryState == WM_SETFOCUS) {
- MMRESULT result;
-
- /* Capture joystick focus if current window has
- focus now. */
- result = joySetCapture(__glutCurrentWindow->win,
- JOYSTICKID1, 0, TRUE);
- if (result == JOYERR_NOERROR) {
- (void) joySetThreshold(JOYSTICKID1, pollInterval);
- }
- }
- __glutCurrentWindow->joyPollInterval = pollInterval;
- } else {
- /* Release joystick focus if current window has
- focus now. */
- if (__glutCurrentWindow->joystick
- && (__glutCurrentWindow->joyPollInterval > 0)
- && (__glutCurrentWindow->entryState == WM_SETFOCUS)) {
- (void) joyReleaseCapture(JOYSTICKID1);
- }
- __glutCurrentWindow->joyPollInterval = 0;
- }
- __glutCurrentWindow->joystick = joystickFunc;
-#else
- /* XXX No support currently for X11 joysticks. */
-#endif
-}
-
-void GLUTAPIENTRY
-glutForceJoystickFunc(void)
-{
-#ifdef _WIN32
- if (__glutCurrentWindow->joystick) {
- JOYINFOEX jix;
- MMRESULT res;
- int x, y, z;
-
- /* Poll the joystick. */
- jix.dwSize = sizeof(jix);
- jix.dwFlags = JOY_RETURNALL;
- res = joyGetPosEx(JOYSTICKID1,&jix);
- if (res == JOYERR_NOERROR) {
-
- /* Convert to int for scaling. */
- x = jix.dwXpos;
- y = jix.dwYpos;
- z = jix.dwZpos;
-
-#define SCALE(v) ((int) ((v - 32767)/32.768))
-
- __glutCurrentWindow->joystick(jix.dwButtons,
- SCALE(x), SCALE(y), SCALE(z));
- }
- }
-#else
- /* XXX No support currently for X11 joysticks. */
-#endif
-}
-
-/* ENDCENTRY */