[PATCH] Another attempt at glXGetProcAddress/libGL fixes

Okay, I see what's going on now. glXGetProcAddress was only part of
the very recently ratified GLX version 1.4, although Mesa has had it
for a while. glXGetProcAddressARB has been around for much longer and
is in fact part of the official Linux OpenGL ABI.

diff -urN a/NQ/Makefile head/NQ/Makefile
--- a/NQ/Makefile	2005-12-11 22:17:15.000000000 +1030
+++ head/NQ/Makefile	2006-01-17 19:29:08.000000000 +1030
@@ -18,11 +18,6 @@
 %.o:	../common/%.c
 	$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $^
 
-# A special rule for the glx file due to compatibility problems
-# with the Nvidia's libGL.so
-#gl_vidlinuxglx.o:	../common/gl_vidlinuxglx.c
-#	$(CC) -c $(CPPFLAGS) $(CFLAGS) -DglXGetProcAddress=glXGetProcAddressARB -o $@ $^
-
 # Rule to make the resource file
 %.res:	%.rc
 	windres -i $^ -O coff -o $@
diff -urN a/common/gl_vidlinuxglx.c head/common/gl_vidlinuxglx.c
--- a/common/gl_vidlinuxglx.c	2005-12-30 22:26:52.000000000 +1030
+++ head/common/gl_vidlinuxglx.c	2006-01-17 20:22:11.000000000 +1030
@@ -25,6 +25,7 @@
 #include <stdio.h>
 #include <signal.h>
 
+#define GLX_GLEXT_PROTOTYPES
 #include <GL/glx.h>
 
 #include <X11/keysym.h>
@@ -48,9 +49,17 @@
 #include "x11_core.h"
 #include "in_x11.h"
 
-#if !defined(GLX_VERSION_1_4) && !defined(glXGetProcAddress)
-#define glXGetProcAddress glXGetProcAddressARB
+/*
+ * glXGetProcAddress - This function is defined in GLX version 1.4, but this
+ * is not common enough yet to rely on it being present in any old libGL.so
+ * (e.g. Nvidia's proprietary drivers). glXGetProcAddressARB has been around
+ * longer and actually forms part of the current Linux OpenGL ABI
+ * - http://oss.sgi.com/projects/ogl-sample/ABI/
+ */
+#ifndef GLX_ARB_get_proc_address
+#error "glXGetProcAddressARB is REQUIRED"
 #endif
+#define glXGetProcAddress glXGetProcAddressARB
 
 #define WARP_WIDTH              320
 #define WARP_HEIGHT             200
