[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

mesa: Changes to 'debian-experimental'



 Makefile                                          |   22 
 Makefile.mgw                                      |   28 
 configs/config.mgw                                |   42 
 configs/default                                   |    4 
 debian/changelog                                  |   34 
 debian/control                                    |    4 
 docs/README.MINGW32                               |   49 
 docs/relnotes-7.0.1.html                          |   86 +
 docs/relnotes-7.0.html                            |   10 
 docs/relnotes.html                                |    1 
 include/GL/gl.h                                   |   17 
 include/GL/gl_mangle.h                            |   93 +
 include/GL/glu.h                                  |   13 
 include/GL/glut.h                                 |   17 
 include/GL/mesa_wgl.h                             |   59 
 progs/demos/geartrain.c                           |    1 
 progs/demos/gltestperf.c                          |    1 
 progs/demos/isosurf.c                             |    1 
 progs/demos/morph3d.c                             |    9 
 progs/demos/winpos.c                              |    1 
 progs/samples/Makefile.mgw                        |   33 
 src/glu/sgi/Makefile.mgw                          |  229 ++
 src/glu/sgi/libnurbs/interface/glcurveval.h       |    2 
 src/glu/sgi/libnurbs/interface/glsurfeval.cc      |    7 
 src/glu/sgi/libnurbs/interface/glsurfeval.h       |    2 
 src/glu/sgi/libnurbs/nurbtess/monoTriangulation.h |    3 
 src/glut/glx/Makefile.mgw                         |  198 ++
 src/glut/glx/glut_fbc.c                           |    4 
 src/glut/glx/glut_input.c                         |    3 
 src/glut/glx/glut_joy.c                           |    3 
 src/glut/glx/glutint.h                            |    3 
 src/glut/glx/win32_util.c                         |    1 
 src/glut/glx/win32_winproc.c                      |    3 
 src/glut/glx/win32_x11.h                          |   10 
 src/mesa/Makefile                                 |    7 
 src/mesa/Makefile.mgw                             |   51 
 src/mesa/drivers/dri/Makefile                     |    2 
 src/mesa/drivers/dri/common/dri_util.c            |    2 
 src/mesa/drivers/dri/common/extension_helper.h    |   20 
 src/mesa/drivers/dri/i915/i915_vtbl.c             |    1 
 src/mesa/drivers/dri/i915tex/i915_vtbl.c          |    1 
 src/mesa/drivers/dri/i915tex/intel_buffers.c      |   10 
 src/mesa/drivers/dri/i915tex/intel_context.c      |   57 
 src/mesa/drivers/dri/i965/intel_blit.c            |    7 
 src/mesa/drivers/dri/i965/intel_blit.h            |    3 
 src/mesa/drivers/dri/i965/intel_pixel_bitmap.c    |    7 
 src/mesa/drivers/windows/gdi/wgl.c                |   59 
 src/mesa/drivers/windows/gdi/wmesa.c              |  139 -
 src/mesa/drivers/windows/gdi/wmesadef.h           |    4 
 src/mesa/glapi/gl_API.xml                         |   21 
 src/mesa/glapi/glapitemp.h                        |   30 
 src/mesa/glapi/glprocs.h                          |  282 +--
 src/mesa/main/api_validate.c                      |   19 
 src/mesa/main/glheader.h                          |    3 
 src/mesa/main/image.c                             |  117 -
 src/mesa/main/imports.c                           |    4 
 src/mesa/main/imports.h                           |    4 
 src/mesa/main/shaders.c                           |    8 
 src/mesa/main/texcompress_fxt1.c                  |    5 
 src/mesa/main/texenvprogram.c                     |    2 
 src/mesa/main/teximage.c                          |   30 
 src/mesa/main/version.h                           |    6 
 src/mesa/shader/shader_api.c                      |    6 
 src/mesa/shader/slang/library/slang_core.gc       |    5 
 src/mesa/shader/slang/library/slang_core_gc.h     |  107 -
 src/mesa/shader/slang/slang_codegen.c             |   13 
 src/mesa/sparc/glapi_sparc.S                      |    5 
 src/mesa/swrast/s_drawpix.c                       |   11 
 src/mesa/tnl/t_save_api.c                         | 1834 ----------------------
 src/mesa/vbo/vbo_exec_api.c                       |    5 
 src/mesa/vbo/vbo_save_api.c                       |    4 
 src/mesa/x86-64/glapi_x86-64.S                    |    5 
 src/mesa/x86/common_x86.c                         |    9 
 src/mesa/x86/glapi_x86.S                          |    5 
 windows/VC6/mesa/mesa/mesa.dsp                    |   44 
 windows/VC7/mesa/mesa/mesa.vcproj                 |   32 
 76 files changed, 1562 insertions(+), 2417 deletions(-)

New commits:
commit d3a160e2174eafa68bbdbb0cf7955e23d26ea66b
Author: Julien Cristau <jcristau@debian.org>
Date:   Mon Jul 23 16:39:48 2007 +0200

    New upstream release candidate.

diff --git a/debian/changelog b/debian/changelog
index 2ad0d5b..3fdb103 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,17 +1,15 @@
-mesa (7.0-1) UNRELEASED; urgency=low
+mesa (7.0.1~rc1-1) UNRELEASED; urgency=low
 
   [ David Nusinow ]
-  * New upstream release
+  * New upstream release candidate
   * Bite the bullet and add myself to uploaders
 
   [ Julien Cristau ]
   * Modify the short descriptions of various packages so they fit in .changes
     files without being cut off.  Thanks, Marc 'HE' Brockschmidt!
   * Add a shlibs file for libgl1-mesa-swx11-i686.
-  * Fix build on hurd-i386 (build libgl1-mesa-glx without dri support and
-    don't build the dri drivers); closes: #420403.  Thanks, Samuel Thibault!
 
- -- Julien Cristau <jcristau@debian.org>  Thu, 28 Jun 2007 22:26:10 +0100
+ -- Julien Cristau <jcristau@debian.org>  Mon, 23 Jul 2007 16:29:27 +0200
 
 mesa (6.5.3-1) experimental; urgency=low
 

commit 005eea249c2565cd33bb7c5f599040ead1ef99a5
Author: Brian <brian.paul@tungstengraphics.com>
Date:   Sat Jul 21 11:27:22 2007 -0600

    Fix a number of MINGW32 issues (Zhang <zxpmyth@yahoo.com.cn>)

diff --git a/Makefile b/Makefile
index 5fddda5..920e8af 100644
--- a/Makefile
+++ b/Makefile
@@ -317,6 +317,7 @@ SGI_GLU_FILES = \
 	$(DIRECTORY)/src/glu/Makefile					\
 	$(DIRECTORY)/src/glu/descrip.mms				\
 	$(DIRECTORY)/src/glu/sgi/Makefile				\
+	$(DIRECTORY)/src/glu/sgi/Makefile.mgw				\
 	$(DIRECTORY)/src/glu/sgi/Makefile.win				\
 	$(DIRECTORY)/src/glu/sgi/Makefile.DJ				\
 	$(DIRECTORY)/src/glu/sgi/glu.def				\
diff --git a/Makefile.mgw b/Makefile.mgw
index 9488608..3dc9f62 100644
--- a/Makefile.mgw
+++ b/Makefile.mgw
@@ -53,11 +53,13 @@
 
 # MinGW core makefile updated for Mesa 7.0
 #
-#  updated : by Heromyth, 2007-6-25
+#  Updated : by Heromyth, on 2007-7-21
 #  Email   : zxpmyth@yahoo.com.cn
-#  Bug     : All the default settings work fine. But the setting X86=1 can't work. 
+#  Bugs    : 1) All the default settings work fine. But the setting X86=1 can't work. 
 #            The others havn't been tested yet.
-
+#            2) The generated DLLs are *not* compatible with the ones built
+#            with the other compilers like VC8, especially for GLUT. 
+#            3) MAlthough more tests are needed, it can be used individually!
 
 
 .PHONY : all libgl clean realclean
@@ -73,13 +75,14 @@ CFLAGS += -O2 -ffast-math
 
 export CFLAGS
 
+
 ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
 UNLINK = del $(subst /,\,$(1))
 else
 UNLINK = $(RM) $(1)
 endif
 
-all: libgl libglu libglut
+all: libgl libglu libglut example
 
 libgl: lib
 	$(MAKE) -f Makefile.mgw -C src/mesa
diff --git a/configs/config.mgw b/configs/config.mgw
new file mode 100644
index 0000000..b961eb9
--- /dev/null
+++ b/configs/config.mgw
@@ -0,0 +1,42 @@
+# MinGW config include file updated for Mesa 7.0
+#
+#  Updated : by Heromyth, on 2007-7-21
+#  Email   : zxpmyth@yahoo.com.cn
+#  Bugs    : 1) All the default settings work fine. But the setting X86=1 can't work. 
+#            The others havn't been tested yet.
+#            2) The generated DLLs are *not* compatible with the ones built
+#            with the other compilers like VC8, especially for GLUT. 
+#            3) Although more tests are needed, it can be used individually!
+
+# The generated DLLs by MingW with STDCALL are not totally compatible 
+# with the ones linked by Microsoft's compilers.
+#
+# xxx_USING_STDCALL = 1          Compiling MESA with __stdcall. This is default!
+# 
+# xxx_USING_STDCALL = 0          Compiling MESA without __stdcall. I like this:)
+#  
+
+# In fact, GL_USING_STDCALL and GLUT_USING_STDCALL can be
+# different. For example:
+#
+#   GL_USING_STDCALL = 0
+#   GLUT_USING_STDCALL = 1
+# 
+# Suggested setting:
+#
+#     ALL_USING_STDCALL = 1
+#
+# That's default!
+#
+
+
+ALL_USING_STDCALL = 1
+
+
+ifeq ($(ALL_USING_STDCALL),1)
+  GL_USING_STDCALL = 1
+  GLUT_USING_STDCALL = 1
+else
+  GL_USING_STDCALL = 0
+  GLUT_USING_STDCALL = 0
+endif
diff --git a/docs/README.MINGW32 b/docs/README.MINGW32
index 2b39f12..138dd43 100644
--- a/docs/README.MINGW32
+++ b/docs/README.MINGW32
@@ -88,3 +88,52 @@ Running the Build:
 
 		Paul G. <pgarceau@users.sourceforge.net>
 		Daniel Borca <dborca@users.sourceforge.net>
+
+
+
+*******************This section is added by Heromyth*****************************
+Updated on 2007-7-21, by Heromyth <zxpmyth@yahoo.com.cn>
+
+
+Notice:
+	1) The generated DLLs are *not* compatible with the ones built
+with the other compilers like VC8, especially for GLUT. 
+
+	2) Although more tests are needed, it can be used individually!
+
+	3) You can set the options about whether using STDCALL to build MESA. The 
+config file is <Mesa3D-root>\configs\config.mgw. The default setting is that:
+		ALL_USING_STDCALL = 1
+, which means using STDCALL to build MESA. 
+
+	4) Of course, you can MESA without using STDCALL,I like this:) 
+The setting is :
+		ALL_USING_STDCALL = 0
+To do this, however, you must modify wingdi.h which is in MingW's include dir. 
+For example, run:
+	notepad	C:\MingW\include\wingdi.h
+, and delete all the lines where all the wgl*() functions are. Because they would 
+be conflicted with the ones in <Mesa3D-root>\include\GL\mesa_wgl.h.
+
+======= Conflicted Functions List ======
+WINGDIAPI BOOL WINAPI wglCopyContext(HGLRC,HGLRC,UINT);
+WINGDIAPI HGLRC WINAPI wglCreateContext(HDC);
+WINGDIAPI HGLRC WINAPI wglCreateLayerContext(HDC,int);
+WINGDIAPI BOOL WINAPI wglDeleteContext(HGLRC);
+WINGDIAPI BOOL WINAPI wglDescribeLayerPlane(HDC,int,int,UINT,LPLAYERPLANEDESCRIPTOR);
+WINGDIAPI HGLRC WINAPI wglGetCurrentContext(void);
+WINGDIAPI HDC WINAPI wglGetCurrentDC(void);
+WINGDIAPI int WINAPI wglGetLayerPaletteEntries(HDC,int,int,int,COLORREF*);
+WINGDIAPI PROC WINAPI wglGetProcAddress(LPCSTR);
+WINGDIAPI BOOL WINAPI wglMakeCurrent(HDC,HGLRC);
+WINGDIAPI BOOL WINAPI wglRealizeLayerPalette(HDC,int,BOOL);
+WINGDIAPI int WINAPI wglSetLayerPaletteEntries(HDC,int,int,int,const COLORREF*);
+WINGDIAPI BOOL WINAPI wglShareLists(HGLRC,HGLRC);
+WINGDIAPI BOOL WINAPI wglSwapLayerBuffers(HDC,UINT);
+WINGDIAPI BOOL WINAPI wglUseFontBitmapsA(HDC,DWORD,DWORD,DWORD);
+WINGDIAPI BOOL WINAPI wglUseFontBitmapsW(HDC,DWORD,DWORD,DWORD);
+WINGDIAPI BOOL WINAPI wglUseFontOutlinesA(HDC,DWORD,DWORD,DWORD,FLOAT,FLOAT,int,LPGLYPHMETRICSFLOAT);
+WINGDIAPI BOOL WINAPI wglUseFontOutlinesW(HDC,DWORD,DWORD,DWORD,FLOAT,FLOAT,int,LPGLYPHMETRICSFLOAT);
+===================
+
+*********************************************************************************
\ No newline at end of file
diff --git a/include/GL/gl.h b/include/GL/gl.h
index fa0f891..ff012d5 100644
--- a/include/GL/gl.h
+++ b/include/GL/gl.h
@@ -58,7 +58,11 @@
 #  else /* for use with static link lib build of Win32 edition only */
 #    define GLAPI extern
 #  endif /* _STATIC_MESA support */
-#  define GLAPIENTRY __stdcall
+#  if defined(__MINGW32__) && defined(GL_NO_STDCALL)  /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */
+#    define GLAPIENTRY 
+#  else
+#    define GLAPIENTRY __stdcall
+#  endif
 #elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
 #  define GLAPI extern
 #  define GLAPIENTRY __stdcall
@@ -84,7 +88,8 @@
 #include <windows.h>
 #endif
 
-#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__)
+#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) \
+     && !defined(OPENSTEP) && !defined(__CYGWIN__) || defined(__MINGW32__)
 #include <GL/mesa_wgl.h>
 #endif
 
@@ -2161,11 +2166,11 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh
 #define GL_DEBUG_PRINT_MESA               0x875A
 #define GL_DEBUG_ASSERT_MESA              0x875B
 
-GLAPI GLhandleARB APIENTRY glCreateDebugObjectMESA (void);
-GLAPI void APIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
-GLAPI void APIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
+GLAPI GLhandleARB GLAPIENTRY glCreateDebugObjectMESA (void);
+GLAPI void GLAPIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
+GLAPI void GLAPIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
                                          GLsizei *length, GLcharARB *debugLog);
-GLAPI GLsizei APIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
+GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
 
 #endif /* GL_MESA_shader_debug */
 
diff --git a/include/GL/glut.h b/include/GL/glut.h
index e0fad6e..e286349 100644
--- a/include/GL/glut.h
+++ b/include/GL/glut.h
@@ -10,6 +10,10 @@
 #include <GL/gl.h>
 #include <GL/glu.h>
 
+#if defined(__MINGW32__)
+#include <GL/mesa_wgl.h>
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -108,7 +112,7 @@ extern _CRTIMP void __cdecl exit(int);
    and redifinition of Windows system defs, also removes requirement of
    pretty much any standard windows header from this file */
 
-#if (_MSC_VER >= 800) || defined(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
+#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
 #	define GLUTAPIENTRY __stdcall
 #else
 #	define GLUTAPIENTRY
@@ -130,8 +134,9 @@ extern _CRTIMP void __cdecl exit(int);
 #		pragma message( "----: being multiply defined you should include WINDOWS.H priot to gl/glut.h" )
 #	endif
 #	define CALLBACK __stdcall
-typedef int (GLUTAPIENTRY *PROC)();
+
 #if !defined(__MINGW32__)
+	typedef int (GLUTAPIENTRY *PROC)();
 	typedef void *HGLRC;
 	typedef void *HDC;
 #endif
diff --git a/include/GL/mesa_wgl.h b/include/GL/mesa_wgl.h
index acc7eac..1d77457 100644
--- a/include/GL/mesa_wgl.h
+++ b/include/GL/mesa_wgl.h
@@ -26,11 +26,12 @@
 /* prototypes for the Mesa WGL functions */
 /* relocated here so that I could make GLUT get them properly */
 
-#define _mesa_wgl_h_
-
 #ifndef _mesa_wgl_h_
 #define _mesa_wgl_h_
 
+#if defined(__MINGW32__)
+#  define __W32API_USE_DLLIMPORT__
+#endif
 
 #include <GL/gl.h>
 
@@ -39,23 +40,16 @@ extern "C" {
 #endif
 
 
-#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__))
-#  if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
-#    define GLAPI __declspec(dllexport)
-#    define WGLAPI __declspec(dllexport)
-#  elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
-#    define GLAPI __declspec(dllimport)
-#    define WGLAPI __declspec(dllimport)
-#  else /* for use with static link lib build of Win32 edition only */
-#    define GLAPI extern
-#    define WGLAPI __declspec(dllimport)
-#  endif /* _STATIC_MESA support */
-#  define GLAPIENTRY __stdcall
-#else
-/* non-Windows compilation */
-#  define GLAPI extern
-#  define GLAPIENTRY
-#endif /* WIN32 / CYGWIN32 bracket */
+#ifndef WGLAPI
+#define WGLAPI GLAPI
+#endif
+
+#if defined(__MINGW32__)
+#  ifndef WIN32_LEAN_AND_MEAN
+#    define WIN32_LEAN_AND_MEAN 1
+#  endif
+#  include <windows.h>
+#endif
 
 
 #if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
@@ -80,23 +74,25 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC
 #  pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
 #endif
 
-WGLAPI int   GLAPIENTRY wglDeleteContext(HGLRC);
-WGLAPI int   GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
+
 WGLAPI int   GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
 WGLAPI int   GLAPIENTRY wglSwapBuffers(HDC hdc);
-WGLAPI HDC   GLAPIENTRY wglGetCurrentDC(void);
-WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
-WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
-WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
-WGLAPI PROC  GLAPIENTRY wglGetProcAddress(const char*);
 WGLAPI int   GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
+WGLAPI int   GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
+WGLAPI int   GLAPIENTRY wglGetPixelFormat(HDC hdc);
+
+
+#if defined(GL_NO_STDCALL) || !defined(__MINGW32__)
 WGLAPI int   GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
+WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
+WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
 WGLAPI int   GLAPIENTRY wglDeleteContext(HGLRC);
 WGLAPI int   GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
-WGLAPI int   GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
+WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
+WGLAPI HDC   GLAPIENTRY wglGetCurrentDC(void);
 WGLAPI int   GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
-WGLAPI int   GLAPIENTRY wglGetPixelFormat(HDC hdc);
-WGLAPI int   GLAPIENTRY wglMakeCurrent(HDC, HGLRC);
+WGLAPI PROC  GLAPIENTRY wglGetProcAddress(const char*);
+WGLAPI int   GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
 WGLAPI int   GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
 WGLAPI int   GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
 WGLAPI int   GLAPIENTRY wglShareLists(HGLRC, HGLRC);
@@ -105,12 +101,15 @@ WGLAPI int   GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, un
 WGLAPI int   GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
 WGLAPI int   GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
 WGLAPI int   GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
+#endif
+
+#ifndef __MINGW32__
 WGLAPI int   GLAPIENTRY SwapBuffers(HDC);
 WGLAPI int   GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
 WGLAPI int   GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
 WGLAPI int   GLAPIENTRY GetPixelFormat(HDC);
 WGLAPI int   GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
-
+#endif
 
 #ifndef WGL_ARB_extensions_string
 #define WGL_ARB_extensions_string 1
diff --git a/progs/samples/Makefile.mgw b/progs/samples/Makefile.mgw
index 1193540..3b2fd78 100644
--- a/progs/samples/Makefile.mgw
+++ b/progs/samples/Makefile.mgw
@@ -26,6 +26,15 @@
 #  Email : dborca@users.sourceforge.net
 #  Web   : http://www.geocities.com/dborca
 
+# MinGW samples makefile updated for Mesa 7.0
+#
+#  Updated : by Heromyth, on 2007-7-21
+#  Email   : zxpmyth@yahoo.com.cn
+#  Bugs    : 1) All the default settings work fine. But the setting X86=1 can't work. 
+#            The others havn't been tested yet.
+#            2) The generated DLLs are *not* compatible with the ones built
+#            with the other compilers like VC8, especially for GLUT. 
+#            3) Although more tests are needed, it can be used individually!
 
 #
 #  Available options:
@@ -44,15 +53,31 @@
 
 TOP = ../..
 
+include $(TOP)/configs/config.mgw
+ALL_USING_STDCALL ?= 1
+GL_USING_STDCALL ?= 1
+GLUT_USING_STDCALL ?= 1
+
 CC = mingw32-gcc
-CFLAGS = -Wall -W -pedantic
+CFLAGS = -Wall -pedantic
 CFLAGS += -O2 -ffast-math
 CFLAGS += -I$(TOP)/include -I../util
 ifeq ($(FX),1)
-CFLAGS += -DFX
+  CFLAGS += -DFX
+endif
+
+CFLAGS += -DGLUT_DISABLE_ATEXIT_HACK
+
+ifeq ($(GL_USING_STDCALL),0)
+  CFLAGS += -DGL_NO_STDCALL
+endif
+
+ifeq ($(GLUT_USING_STDCALL),1)
+  CFLAGS += -D_STDCALL_SUPPORTED
+else
+  CFLAGS += -DGLUT_NO_STDCALL
 endif
-CFLAGS += -DGLUT_DISABLE_ATEXIT_HACK -D_STDCALL_SUPPORTED
-CFLAGS += -D_WINDEF_ -D_WINGDI_
+
 
 LD = mingw32-g++
 LDFLAGS = -s -L$(TOP)/lib
diff --git a/src/glu/sgi/Makefile.mgw b/src/glu/sgi/Makefile.mgw
new file mode 100644
index 0000000..43b421e
--- /dev/null
+++ b/src/glu/sgi/Makefile.mgw
@@ -0,0 +1,229 @@
+# Mesa 3-D graphics library
+# Version:  5.1
+# 
+# Copyright (C) 1999-2003  Brian Paul   All Rights Reserved.
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+# MinGW core makefile v1.4 for Mesa
+#
+#  Copyright (C) 2002 - Daniel Borca
+#  Email : dborca@users.sourceforge.net
+#  Web   : http://www.geocities.com/dborca
+
+# MinGW core-glu makefile updated for Mesa 7.0
+#
+#  Updated : by Heromyth, on 2007-7-21
+#  Email   : zxpmyth@yahoo.com.cn
+#  Bugs    : 1) All the default settings work fine. But the setting X86=1 can't work. 
+#            The others havn't been tested yet.
+#            2) The generated DLLs are *not* compatible with the ones built
+#            with the other compilers like VC8, especially for GLUT. 
+#            3) Although more tests are needed, it can be used individually!
+
+#
+#  Available options:
+#
+#    Environment variables:
+#	CFLAGS
+#
+#	GLIDE		path to Glide3 SDK; used with FX.
+#			default = $(TOP)/glide3
+#	FX=1		build for 3dfx Glide3. Note that this disables
+#			compilation of most WMesa code and requires fxMesa.
+#			As a consequence, you'll need the Win32 Glide3
+#			library to build any application.
+#			default = no
+#	ICD=1		build the installable client driver interface
+#			(windows opengl driver interface)
+#			default = no
+#	X86=1		optimize for x86 (if possible, use MMX, SSE, 3DNow).
+#			default = no
+#
+#    Targets:
+#	all:		build GL
+#	clean:		remove object files
+#
+
+
+
+.PHONY: all clean
+.INTERMEDIATE: x86/gen_matypes.exe
+.SUFFIXES: .rc .res
+
+# Set this to the prefix of your build tools, i.e. mingw32-
+TOOLS_PREFIX = mingw32-
+
+TOP = ../../..
+
+LIBDIR = $(TOP)/lib
+
+GLU_DLL = glu32.dll
+GLU_IMP = libglu32.a
+GLU_DEF = glu.def
+
+include $(TOP)/configs/config.mgw
+GL_USING_STDCALL ?= 1
+
+LDLIBS = -L$(LIBDIR) -lopengl32
+LDFLAGS = -Wl,--out-implib=$(LIBDIR)/$(GLU_IMP) -Wl,--output-def=$(LIBDIR)/$(GLU_DEF)
+
+CFLAGS += -DBUILD_GLU32 -D_DLL
+
+ifeq ($(GL_USING_STDCALL),1)
+  LDFLAGS += -Wl,--add-stdcall-alias
+else
+  CFLAGS += -DGL_NO_STDCALL
+endif
+
+CC = gcc
+CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include -Iinclude
+CXX = g++
+CXXFLAGS = $(CFLAGS) -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess
+
+AR = ar
+ARFLAGS = crus
+
+UNLINK = del $(subst /,\,$(1))
+ifneq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
+UNLINK = $(RM) $(1)
+endif
+ifneq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
+UNLINK = $(RM) $(1)
+endif
+
+C_SOURCES = \
+	libutil/error.c \
+	libutil/glue.c \
+	libutil/mipmap.c \
+	libutil/project.c \
+	libutil/quad.c \
+	libutil/registry.c \
+	libtess/dict.c \
+	libtess/geom.c \
+	libtess/memalloc.c \
+	libtess/mesh.c \
+	libtess/normal.c \
+	libtess/priorityq.c \
+	libtess/render.c \
+	libtess/sweep.c \
+	libtess/tess.c \
+	libtess/tessmono.c
+
+CC_SOURCES = \
+	libnurbs/interface/bezierEval.cc \
+	libnurbs/interface/bezierPatch.cc \
+	libnurbs/interface/bezierPatchMesh.cc \
+	libnurbs/interface/glcurveval.cc \
+	libnurbs/interface/glinterface.cc \
+	libnurbs/interface/glrenderer.cc \
+	libnurbs/interface/glsurfeval.cc \
+	libnurbs/interface/incurveeval.cc \
+	libnurbs/interface/insurfeval.cc \
+	libnurbs/internals/arc.cc \
+	libnurbs/internals/arcsorter.cc \
+	libnurbs/internals/arctess.cc \
+	libnurbs/internals/backend.cc \
+	libnurbs/internals/basiccrveval.cc \
+	libnurbs/internals/basicsurfeval.cc \
+	libnurbs/internals/bin.cc \
+	libnurbs/internals/bufpool.cc \
+	libnurbs/internals/cachingeval.cc \
+	libnurbs/internals/ccw.cc \
+	libnurbs/internals/coveandtiler.cc \
+	libnurbs/internals/curve.cc \
+	libnurbs/internals/curvelist.cc \
+	libnurbs/internals/curvesub.cc \
+	libnurbs/internals/dataTransform.cc \
+	libnurbs/internals/displaylist.cc \
+	libnurbs/internals/flist.cc \
+	libnurbs/internals/flistsorter.cc \
+	libnurbs/internals/hull.cc \
+	libnurbs/internals/intersect.cc \
+	libnurbs/internals/knotvector.cc \
+	libnurbs/internals/mapdesc.cc \
+	libnurbs/internals/mapdescv.cc \
+	libnurbs/internals/maplist.cc \
+	libnurbs/internals/mesher.cc \
+	libnurbs/internals/monoTriangulationBackend.cc \
+	libnurbs/internals/monotonizer.cc \
+	libnurbs/internals/mycode.cc \
+	libnurbs/internals/nurbsinterfac.cc \
+	libnurbs/internals/nurbstess.cc \
+	libnurbs/internals/patch.cc \
+	libnurbs/internals/patchlist.cc \
+	libnurbs/internals/quilt.cc \
+	libnurbs/internals/reader.cc \
+	libnurbs/internals/renderhints.cc \
+	libnurbs/internals/slicer.cc \
+	libnurbs/internals/sorter.cc \
+	libnurbs/internals/splitarcs.cc \
+	libnurbs/internals/subdivider.cc \
+	libnurbs/internals/tobezier.cc \
+	libnurbs/internals/trimline.cc \
+	libnurbs/internals/trimregion.cc \
+	libnurbs/internals/trimvertpool.cc \
+	libnurbs/internals/uarray.cc \
+	libnurbs/internals/varray.cc \
+	libnurbs/nurbtess/directedLine.cc \
+	libnurbs/nurbtess/gridWrap.cc \
+	libnurbs/nurbtess/monoChain.cc \
+	libnurbs/nurbtess/monoPolyPart.cc \
+	libnurbs/nurbtess/monoTriangulation.cc \
+	libnurbs/nurbtess/partitionX.cc \
+	libnurbs/nurbtess/partitionY.cc \
+	libnurbs/nurbtess/polyDBG.cc \
+	libnurbs/nurbtess/polyUtil.cc \
+	libnurbs/nurbtess/primitiveStream.cc \
+	libnurbs/nurbtess/quicksort.cc \
+	libnurbs/nurbtess/rectBlock.cc \
+	libnurbs/nurbtess/sampleComp.cc \
+	libnurbs/nurbtess/sampleCompBot.cc \
+	libnurbs/nurbtess/sampleCompRight.cc \
+	libnurbs/nurbtess/sampleCompTop.cc \
+	libnurbs/nurbtess/sampleMonoPoly.cc \
+	libnurbs/nurbtess/sampledLine.cc \
+	libnurbs/nurbtess/searchTree.cc
+
+SOURCES = $(C_SOURCES) $(CC_SOURCES)
+
+OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
+
+.c.o:
+	$(CC) -o $@ $(CFLAGS) -c $<
+.cc.o:
+	$(CXX) -o $@ $(CXXFLAGS) -c $<
+
+
+all: $(LIBDIR) $(LIBDIR)/$(GLU_DLL) $(LIBDIR)/$(GLU_IMP)
+
+$(LIBDIR):
+	mkdir -p $(LIBDIR)
+
+$(LIBDIR)/$(GLU_DLL) $(LIBDIR)/$(GLU_IMP): $(OBJECTS)
+	g++ -shared -fPIC -o $(LIBDIR)/$(GLU_DLL) $(LDFLAGS) \
+    $^ $(LDLIBS)
+
+
+
+clean:
+	-$(call UNLINK,libutil/*.o)
+	-$(call UNLINK,libtess/*.o)
+	-$(call UNLINK,libnurbs/interface/*.o)
+	-$(call UNLINK,libnurbs/internals/*.o)
+	-$(call UNLINK,libnurbs/nurbtess/*.o)
diff --git a/src/glu/sgi/libnurbs/interface/glcurveval.h b/src/glu/sgi/libnurbs/interface/glcurveval.h
index 4b44f6e..a09a74d 100644
--- a/src/glu/sgi/libnurbs/interface/glcurveval.h
+++ b/src/glu/sgi/libnurbs/interface/glcurveval.h
@@ -93,7 +93,7 @@ public:
 	output_triangles = flag;
       }
 #ifdef _WIN32
-    void               putCallBack(GLenum which, void (APIENTRY *fn)() );
+    void               putCallBack(GLenum which, void (GLAPIENTRY *fn)() );
 #else
     void               putCallBack(GLenum which, _GLUfuncptr fn );
 #endif
diff --git a/src/glu/sgi/libnurbs/interface/glsurfeval.cc b/src/glu/sgi/libnurbs/interface/glsurfeval.cc
index a36b304..b5bfab1 100644
--- a/src/glu/sgi/libnurbs/interface/glsurfeval.cc
+++ b/src/glu/sgi/libnurbs/interface/glsurfeval.cc
@@ -1184,8 +1184,11 @@ return;
 
 }
 
-void
-OpenGLSurfaceEvaluator::putCallBack(GLenum which, _GLUfuncptr fn )
+#ifdef _WIN32
+void OpenGLSurfaceEvaluator::putCallBack(GLenum which, void (GLAPIENTRY *fn)() )
+#else
+void OpenGLSurfaceEvaluator::putCallBack(GLenum which, _GLUfuncptr fn )
+#endif
 {
   switch(which)
     {
diff --git a/src/glu/sgi/libnurbs/interface/glsurfeval.h b/src/glu/sgi/libnurbs/interface/glsurfeval.h
index c34a58c..b7a8806 100644
--- a/src/glu/sgi/libnurbs/interface/glsurfeval.h
+++ b/src/glu/sgi/libnurbs/interface/glsurfeval.h
@@ -145,7 +145,7 @@ public:
     void		newtmeshvert( long, long );
 
 #ifdef _WIN32
-    void 	        putCallBack(GLenum which, void (APIENTRY *fn)() );
+    void 	        putCallBack(GLenum which, void (GLAPIENTRY *fn)() );
 #else
     void 	        putCallBack(GLenum which, _GLUfuncptr fn );
 #endif
diff --git a/src/glut/glx/Makefile.mgw b/src/glut/glx/Makefile.mgw
new file mode 100644
index 0000000..ae4eb6a
--- /dev/null
+++ b/src/glut/glx/Makefile.mgw
@@ -0,0 +1,198 @@
+# Mesa 3-D graphics library
+# Version:  5.1
+# 
+# Copyright (C) 1999-2003  Brian Paul   All Rights Reserved.
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+# MinGW core makefile v1.4 for Mesa
+#
+#  Copyright (C) 2002 - Daniel Borca
+#  Email : dborca@users.sourceforge.net
+#  Web   : http://www.geocities.com/dborca
+
+# MinGW core-glut makefile updated for Mesa 7.0
+#
+#  Updated : by Heromyth, on 2007-7-21
+#  Email   : zxpmyth@yahoo.com.cn
+#  Bugs    : 1) All the default settings work fine. But the setting X86=1 can't work. 
+#            The others havn't been tested yet.
+#            2) The generated DLLs are *not* compatible with the ones built
+#            with the other compilers like VC8, especially for GLUT. 
+#            3) Although more tests are needed, it can be used individually!
+
+
+#
+#  Available options:
+#
+#    Environment variables:
+#	CFLAGS
+#
+#	GLIDE		path to Glide3 SDK; used with FX.
+#			default = $(TOP)/glide3
+#	FX=1		build for 3dfx Glide3. Note that this disables
+#			compilation of most WMesa code and requires fxMesa.
+#			As a consequence, you'll need the Win32 Glide3
+#			library to build any application.
+#			default = no
+#	ICD=1		build the installable client driver interface
+#			(windows opengl driver interface)
+#			default = no
+#	X86=1		optimize for x86 (if possible, use MMX, SSE, 3DNow).
+#			default = no
+#
+#    Targets:
+#	all:		build GL
+#	clean:		remove object files
+#
+
+
+
+.PHONY: all clean
+.INTERMEDIATE: x86/gen_matypes.exe
+.SUFFIXES: .rc .res
+
+# Set this to the prefix of your build tools, i.e. mingw32-
+TOOLS_PREFIX = mingw32-
+
+TOP = ../../..
+
+LIBDIR = $(TOP)/lib
+
+GLUT_DLL = glut32.dll
+GLUT_IMP = libglut32.a
+GLUT_DEF = glut.def
+
+include $(TOP)/configs/config.mgw
+GLUT_USING_STDCALL ?= 1
+
+
+
+LDLIBS = -L$(LIBDIR) -lwinmm -lgdi32 -luser32 -lopengl32 -lglu32 
+LDFLAGS = -Wl,--out-implib=$(LIBDIR)/$(GLUT_IMP) -Wl,--output-def=$(LIBDIR)/$(GLUT_DEF) 
+
+CFLAGS += -DBUILD_GLUT32 -DGLUT_BUILDING_LIB -DMESA -D_DLL
+
+ifeq ($(GL_USING_STDCALL),0)
+  CFLAGS += -DGL_NO_STDCALL
+endif
+
+ifeq ($(GLUT_USING_STDCALL),1)
+  CFLAGS += -D_STDCALL_SUPPORTED
+  LDFLAGS += -Wl,--add-stdcall-alias
+else
+  CFLAGS += -DGLUT_NO_STDCALL
+endif
+
+CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include 
+
+CC = gcc
+CXX = g++
+CXXFLAGS = $(CFLAGS)
+
+AR = ar
+ARFLAGS = crus
+
+UNLINK = del $(subst /,\,$(1))
+ifneq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
+UNLINK = $(RM) $(1)
+endif
+ifneq ($(wildcard $(addsuffix /rm,$(subst :, ,$(PATH)))),)
+UNLINK = $(RM) $(1)
+endif
+
+HDRS = glutint.h glutstroke.h glutbitmap.h glutwin32.h stroke.h win32_glx.h win32_x11.h
+
+SRCS = \
+	glut_bitmap.c \
+	glut_bwidth.c \
+	glut_cindex.c \
+	glut_cmap.c \
+	glut_cursor.c \
+	glut_dials.c \
+	glut_dstr.c \
+	glut_event.c \
+	glut_ext.c \
+	glut_fbc.c \
+	glut_fullscrn.c \
+	glut_gamemode.c \
+	glut_get.c \
+	glut_init.c \
+	glut_input.c \
+	glut_joy.c \
+	glut_key.c \
+	glut_keyctrl.c \
+	glut_keyup.c \
+	glut_mesa.c \
+	glut_modifier.c \
+	glut_overlay.c \
+	glut_shapes.c \
+	glut_space.c \
+	glut_stroke.c \
+	glut_swap.c \
+	glut_swidth.c \
+	glut_tablet.c \
+	glut_teapot.c \
+	glut_util.c \
+	glut_vidresize.c \
+	glut_warp.c \
+	glut_win.c \
+	glut_winmisc.c \
+	win32_glx.c \
+	win32_menu.c \
+	win32_util.c \
+	win32_winproc.c \
+	win32_x11.c
+	
+
+SRCSSEMIGENS = \
+	glut_8x13.c \
+	glut_9x15.c \
+	glut_hel10.c \
+	glut_hel12.c \
+	glut_hel18.c \
+	glut_mroman.c \
+	glut_roman.c \
+	glut_tr10.c \
+	glut_tr24.c
+
+
+
+SOURCES = $(SRCS) $(SRCSSEMIGENS)
+
+OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
+
+.c.o:
+	$(CC) -o $@ $(CFLAGS) -c $<
+.cc.o:
+	$(CXX) -o $@ $(CXXFLAGS) -c $<
+
+
+all: $(LIBDIR) $(LIBDIR)/$(GLUT_DLL) $(LIBDIR)/$(GLUT_IMP)
+
+$(LIBDIR):
+	mkdir -p $(LIBDIR)
+
+$(LIBDIR)/$(GLUT_DLL) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS)
+	$(CXX) -shared -fPIC -o $(LIBDIR)/$(GLUT_DLL) $(LDFLAGS) \
+	$^ $(LDLIBS)
+
+
+
+clean:
+	-$(call UNLINK,*.o)
\ No newline at end of file
diff --git a/src/glut/glx/glut_fbc.c b/src/glut/glx/glut_fbc.c
index deb46c3..e93188b 100644
--- a/src/glut/glx/glut_fbc.c
+++ b/src/glut/glx/glut_fbc.c



Reply to: