aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/glut/glx/glut_input.c2
-rw-r--r--src/glut/glx/glut_joy.c2
-rw-r--r--src/glut/glx/glutint.h2
-rw-r--r--src/glut/glx/glutwin32.h48
-rw-r--r--src/glut/glx/win32_util.c6
-rw-r--r--src/glut/glx/win32_winproc.c6
6 files changed, 56 insertions, 10 deletions
diff --git a/src/glut/glx/glut_input.c b/src/glut/glx/glut_input.c
index a8d3c61cfe4..eea96349eaf 100644
--- a/src/glut/glx/glut_input.c
+++ b/src/glut/glx/glut_input.c
@@ -20,7 +20,9 @@
#include <X11/Xutil.h>
#else
#include <windows.h>
+#ifndef __CYGWIN32__
#include <mmsystem.h> /* Win32 Multimedia API header. */
+#endif
#endif /* !_WIN32 */
#include "glutint.h"
diff --git a/src/glut/glx/glut_joy.c b/src/glut/glx/glut_joy.c
index a7db032f534..a6f54f4a6a1 100644
--- a/src/glut/glx/glut_joy.c
+++ b/src/glut/glx/glut_joy.c
@@ -7,8 +7,10 @@
#ifdef _WIN32
#include <windows.h>
+#ifndef __CYGWIN32
#include <mmsystem.h> /* Win32 Multimedia API header. */
#endif
+#endif
#include "glutint.h"
diff --git a/src/glut/glx/glutint.h b/src/glut/glx/glutint.h
index 554958ed013..6c825819c09 100644
--- a/src/glut/glx/glutint.h
+++ b/src/glut/glx/glutint.h
@@ -24,7 +24,7 @@
#define GLUT_BUILDING_LIB /* Building the GLUT library itself. */
#include <GL/glut.h>
-#if defined( MESA ) && defined( _WIN32 )
+#if defined(MESA) && defined(_WIN32) && !defined(__CYGWIN32__)
#include <gl/mesa_wgl.h>
#endif
diff --git a/src/glut/glx/glutwin32.h b/src/glut/glx/glutwin32.h
index 08523890192..304eeb20a22 100644
--- a/src/glut/glx/glutwin32.h
+++ b/src/glut/glx/glutwin32.h
@@ -40,9 +40,57 @@
#define XA_STRING 0
/* Private routines from win32_util.c */
+#ifndef __CYGWIN32__
extern int gettimeofday(struct timeval* tp, void* tzp);
+#endif
extern void *__glutFont(void *font);
extern int __glutGetTransparentPixel(Display *dpy, XVisualInfo *vinfo);
extern void __glutAdjustCoords(Window parent, int *x, int *y, int *width, int *height);
+
+/* Cygwin B20.1 misses the following definitions */
+#ifdef __CYGWIN32__
+
+/* from winuser.h */
+#define CDS_FULLSCREEN 4
+
+/* from mmsystem.h */
+#define WINMMAPI __declspec(dllimport)
+typedef UINT MMRESULT;
+
+#define MM_JOY1MOVE 0x3A0
+#define MM_JOY1ZMOVE 0x3A2
+#define MM_JOY1BUTTONDOWN 0x3B5
+#define MM_JOY1BUTTONUP 0x3B7
+
+#define JOYERR_NOERROR 0
+#define JOYERR_PARMS 165
+
+#define JOY_RETURNALL 0x000000ffl
+
+#define JOYSTICKID1 0
+
+typedef struct joyinfoex_tag {
+ DWORD dwSize; /* size of structure */
+ DWORD dwFlags; /* flags to indicate what to return */
+ DWORD dwXpos; /* x position */
+ DWORD dwYpos; /* y position */
+ DWORD dwZpos; /* z position */
+ DWORD dwRpos; /* rudder/4th axis position */
+ DWORD dwUpos; /* 5th axis position */
+ DWORD dwVpos; /* 6th axis position */
+ DWORD dwButtons; /* button states */
+ DWORD dwButtonNumber; /* current button number pressed */
+ DWORD dwPOV; /* point of view state */
+ DWORD dwReserved1; /* reserved for communication between winmm & driver */
+ DWORD dwReserved2; /* reserved for future expansion */
+} JOYINFOEX, *PJOYINFOEX, /* NEAR */ *NPJOYINFOEX, /* FAR */ *LPJOYINFOEX;
+
+WINMMAPI MMRESULT WINAPI joyGetPosEx( UINT uJoyID, LPJOYINFOEX pji);
+WINMMAPI MMRESULT WINAPI joyReleaseCapture( UINT uJoyID);
+WINMMAPI MMRESULT WINAPI joySetCapture( HWND hwnd, UINT uJoyID, UINT uPeriod, BOOL fChanged);
+WINMMAPI MMRESULT WINAPI joySetThreshold( UINT uJoyID, UINT uThreshold);
+
+#endif
+
#endif /* __glutwin32_h__ */
diff --git a/src/glut/glx/win32_util.c b/src/glut/glx/win32_util.c
index 8dc714c035d..d05d1d1e82b 100644
--- a/src/glut/glx/win32_util.c
+++ b/src/glut/glx/win32_util.c
@@ -11,11 +11,7 @@
#include "glutint.h"
#include "glutstroke.h"
#include "glutbitmap.h"
-#if defined(__CYGWIN32__)
-typedef MINMAXINFO* LPMINMAXINFO;
-#else
#include <sys/timeb.h>
-#endif
/* The following added by Paul Garceau <[email protected]> */
#if defined(__MINGW32__)
@@ -27,6 +23,7 @@ struct timeval;
extern StrokeFontRec glutStrokeRoman, glutStrokeMonoRoman;
extern BitmapFontRec glutBitmap8By13, glutBitmap9By15, glutBitmapTimesRoman10, glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12, glutBitmapHelvetica18;
+#ifndef __CYGWIN32__
int
gettimeofday(struct timeval* tp, void* tzp)
{
@@ -39,6 +36,7 @@ gettimeofday(struct timeval* tp, void* tzp)
/* 0 indicates that the call succeeded. */
return 0;
}
+#endif
/* To get around the fact that Microsoft DLLs only allow functions
to be exported and now data addresses (as Unix DSOs support), the
diff --git a/src/glut/glx/win32_winproc.c b/src/glut/glx/win32_winproc.c
index 2607a205cd6..945b7eb9ca9 100644
--- a/src/glut/glx/win32_winproc.c
+++ b/src/glut/glx/win32_winproc.c
@@ -8,13 +8,9 @@
#include "glutint.h"
-#if defined(__CYGWIN32__)
-typedef MINMAXINFO* LPMINMAXINFO;
-#else
#include <sys/timeb.h>
-#endif
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(__CYGWIN32__)
#include <mmsystem.h> /* Win32 Multimedia API header. */
#endif