summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhang <zxpmyth@yahoo.com.cn>2007-06-28 08:12:52 -0600
committerJosé Fonseca <jfonseca@vmware.com>2011-07-11 20:03:35 +0100
commit85c9b897500d4832eca15802ddbf1bf75cbb7045 (patch)
tree7bd0a5de067e8abfde2344b9e53aad44abd5f32d
parent14273c06ffd74d22d1987214d522c85692c66597 (diff)
downloadglut-85c9b897500d4832eca15802ddbf1bf75cbb7045.tar.gz
a variety of fixes for MingW
-rw-r--r--include/GL/glut.h8
-rw-r--r--src/glut/glx/glut_input.c3
-rw-r--r--src/glut/glx/glut_joy.c3
-rw-r--r--src/glut/glx/win32_util.c1
-rw-r--r--src/glut/glx/win32_x11.h10
5 files changed, 16 insertions, 9 deletions
diff --git a/include/GL/glut.h b/include/GL/glut.h
index 23c740e..e0fad6e 100644
--- a/include/GL/glut.h
+++ b/include/GL/glut.h
@@ -115,7 +115,7 @@ extern _CRTIMP void __cdecl exit(int);
#endif
/* GLUT API entry point declarations for Win32. */
-#if defined(GLUT_BUILDING_LIB) && defined(_DLL)
+#if (defined(BUILD_GLUT32) || defined(GLUT_BUILDING_LIB)) && defined(_DLL)
# define GLUTAPI __declspec(dllexport)
#elif defined(_DLL)
# define GLUTAPI __declspec(dllimport)
@@ -131,8 +131,10 @@ extern _CRTIMP void __cdecl exit(int);
# endif
# define CALLBACK __stdcall
typedef int (GLUTAPIENTRY *PROC)();
-typedef void *HGLRC;
-typedef void *HDC;
+#if !defined(__MINGW32__)
+ typedef void *HGLRC;
+ typedef void *HDC;
+#endif
typedef unsigned long COLORREF;
#endif
diff --git a/src/glut/glx/glut_input.c b/src/glut/glx/glut_input.c
index add3df7..a76ff9a 100644
--- a/src/glut/glx/glut_input.c
+++ b/src/glut/glx/glut_input.c
@@ -23,6 +23,9 @@
#endif
#include <X11/Xutil.h>
#else
+#ifdef __MINGW32__
+#include <GL/gl.h>
+#endif
#include <windows.h>
#ifndef __CYGWIN32__
#include <mmsystem.h> /* Win32 Multimedia API header. */
diff --git a/src/glut/glx/glut_joy.c b/src/glut/glx/glut_joy.c
index a4528ae..5025607 100644
--- a/src/glut/glx/glut_joy.c
+++ b/src/glut/glx/glut_joy.c
@@ -6,6 +6,9 @@
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. */
diff --git a/src/glut/glx/win32_util.c b/src/glut/glx/win32_util.c
index becd823..25af48a 100644
--- a/src/glut/glx/win32_util.c
+++ b/src/glut/glx/win32_util.c
@@ -15,6 +15,7 @@
/* The following added by Paul Garceau <pgarceau@teleport.com> */
#if defined(__MINGW32__)
+#include <GL/gl.h>
#include <time.h>
#include <windows.h>
struct timeval;
diff --git a/src/glut/glx/win32_x11.h b/src/glut/glx/win32_x11.h
index 1d8d048..6f5c3a9 100644
--- a/src/glut/glx/win32_x11.h
+++ b/src/glut/glx/win32_x11.h
@@ -6,16 +6,14 @@
/* 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 __MINGW32__
+#include <GL/gl.h>
+#endif
#include <stdlib.h>
#include <windows.h>
/* These definitions are missing from windows.h */
-WINGDIAPI int WINAPI wglChoosePixelFormat(HDC, PIXELFORMATDESCRIPTOR *);
-WINGDIAPI int WINAPI wglDescribePixelFormat(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR);
-WINGDIAPI int WINAPI wglGetPixelFormat(HDC);
-WINGDIAPI BOOL WINAPI wglSetPixelFormat(HDC, int, PIXELFORMATDESCRIPTOR *);
-WINGDIAPI BOOL WINAPI wglSwapBuffers(HDC);
+
/* Type definitions (conversions) */
typedef int Visual; /* Win32 equivalent of X11 type */