Bug 2692 - mingw build fails
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Platform
Version: unspecified
Hardware: PC Windows XP
: P2 normal
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2006-04-26 22:28 EDT by Matt Turner
Modified: 2007-05-21 11:26:33 EDT
2 users (show)

See Also:



Description Matt Turner 2006-04-26 22:28:51 EDT
On win32-mingw, GL_TEXTURE_MAX_ANISOTROPY_EXT is undefined in tr_image.c and win_glimp.c.  The fix is to #include <GL/glext.h> in these files.

patch:
Index: code/renderer/tr_image.c
===================================================================
--- code/renderer/tr_image.c	(revision 723)
+++ code/renderer/tr_image.c	(working copy)
@@ -21,7 +21,7 @@
 */
 // tr_image.c
 #include "tr_local.h"
-
+#include <GL/glext.h>
 /*
  * Include file for users of JPEG library.
  * You will need to have included system headers that define at least
Index: code/win32/win_glimp.c
===================================================================
--- code/win32/win_glimp.c	(revision 723)
+++ code/win32/win_glimp.c	(working copy)
@@ -40,6 +40,7 @@
 #include "resource.h"
 #include "glw_win.h"
 #include "win_local.h"
+#include <GL/glext.h>
 
 extern void WG_CheckHardwareGamma( void );
 extern void WG_RestoreGamma( void );
Comment 1 Erik Auerswald 2006-04-27 08:44:58 EDT
IMHO something like the following patch would be better

ATTENTION! This is untested since I don't have windows!

Index: code/renderer/qgl.h
===================================================================
--- code/renderer/qgl.h (revision 726)
+++ code/renderer/qgl.h (working copy)
@@ -43,6 +43,7 @@
 
 #include <windows.h>
 #include <GL/gl.h>
+#include <GL/glext.h>
 
 #elif defined(MACOS_X)
Comment 2 Matt Turner 2006-04-27 14:20:53 EDT
Yes, ignore my patch.  His is a bit cleaner.  I've tested it, and it fixes the problem.

Ready for submission :)
Comment 3 Matt Turner 2006-04-29 11:41:06 EDT
We need some people to test this patch with MSVC to make sure it doesn't break anything.  Test and report back please.
Comment 4 Thilo Schulz 2006-04-30 17:28:14 EDT
The MSVC build failes on the same issue, too. It doesn't know the macros:

GL_TEXTURE_MAX_ANISOTROPY_EXT and
GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT

Unfortunately, the MSVC build breaks with this patch because the windows platform sdk doesn't come with a glext.h... I just checked.
If there is a proper OpenGL SDK available for windows, this would most likely fix the bug. There already a couple of workarounds in place in qgl.h for these extensions that define macros that actually belong to glext.h .. if someone knows more about Windows development maybe he can advise us on the best step. 

We could require all MSVC users to either get their glext.h from here:
http://oss.sgi.com/projects/ogl-sample/sdk.html
or include our own GPL glext.h version for convenience. It would definitely do away with the dirty hacks in qgl.h
Comment 5 Ryan C. Gordon 2007-05-21 11:26:33 EDT
Setting a QA contact on all ioquake3 bugs, even resolved ones. Sorry if you get a flood of email from this, it should only happen once. Apologies for the incovenience.

--ryan.