[79156] trunk/dports/x11/xorg-server-devel
jeremyhu at macports.org
jeremyhu at macports.org
Fri Jun 3 09:11:33 PDT 2011
Revision: 79156
http://trac.macports.org/changeset/79156
Author: jeremyhu at macports.org
Date: 2011-06-03 09:11:33 -0700 (Fri, 03 Jun 2011)
Log Message:
-----------
xorg-server-devel: Bump to 1.11 RC1
Modified Paths:
--------------
trunk/dports/x11/xorg-server-devel/Portfile
Added Paths:
-----------
trunk/dports/x11/xorg-server-devel/files/0001-DIX-Set-backgroundState-correctly-for-root-window.patch
trunk/dports/x11/xorg-server-devel/files/0002-XQuartz-GLX-Create-a-new-dispatch-table-rather-than-.patch
trunk/dports/x11/xorg-server-devel/files/0003-XQuartz-Move-lXplugin-to-LDFLAGS-from-LDADD.patch
trunk/dports/x11/xorg-server-devel/files/0004-XQuartz-Add-a-semicolon-after-DEBUG_LOG.patch
trunk/dports/x11/xorg-server-devel/files/0005-XQuartz-ASL-Update-logging-to-support-differnet-leve.patch
trunk/dports/x11/xorg-server-devel/files/0006-XQuartz-ASL-Use-xpr-subsystem-for-logging-xpr-messag.patch
trunk/dports/x11/xorg-server-devel/files/0007-XQuartz-ASL-Use-GLXAqua-subsystem-for-logging-GLXAqu.patch
trunk/dports/x11/xorg-server-devel/files/0008-XQuartz-ASL-Use-xpbproxy-subsystem-for-logging-xpbpr.patch
trunk/dports/x11/xorg-server-devel/files/0009-XQuartz-xpbproxy-Correct-NSUInteger-format-strings.patch
trunk/dports/x11/xorg-server-devel/files/0010-test-fix-memset-size-for-WindowRec-37801.patch
trunk/dports/x11/xorg-server-devel/files/0011-XQuartz-Remove-explicit-link-against-libGL.patch
trunk/dports/x11/xorg-server-devel/files/0012-XQuartz-AIGLX-Setup-dispatch-table-based-on-runtime-.patch
trunk/dports/x11/xorg-server-devel/files/0013-XQuartz-AIGLX-Remove-unnecessary-includes-in-indirec.patch
trunk/dports/x11/xorg-server-devel/files/5001-configure.ac-Add-fno-strict-aliasing-to-CFLAGS.patch
trunk/dports/x11/xorg-server-devel/files/5002-Workaround-the-GC-clipping-problem-in-miPaintWindow-.patch
trunk/dports/x11/xorg-server-devel/files/5003-fb-Revert-fb-changes-that-broke-XQuartz.patch
Removed Paths:
-------------
trunk/dports/x11/xorg-server-devel/files/0001-Send-events-that-were-missing-from-RRSelectInput.patch
trunk/dports/x11/xorg-server-devel/files/0002-randr-check-rotated-virtual-size-limits-correctly.patch
trunk/dports/x11/xorg-server-devel/files/5001-Workaround-the-GC-clipping-problem-in-miPaintWindow-.patch
trunk/dports/x11/xorg-server-devel/files/5002-fb-Revert-fb-changes-that-broke-XQuartz.patch
trunk/dports/x11/xorg-server-devel/files/5003-configure.ac-Add-fno-strict-aliasing-to-CFLAGS.patch
Modified: trunk/dports/x11/xorg-server-devel/Portfile
===================================================================
--- trunk/dports/x11/xorg-server-devel/Portfile 2011-06-03 16:03:42 UTC (rev 79155)
+++ trunk/dports/x11/xorg-server-devel/Portfile 2011-06-03 16:11:33 UTC (rev 79156)
@@ -5,7 +5,7 @@
name xorg-server-devel
conflicts xorg-server
set my_name xorg-server
-version 1.10.2
+version 1.10.99.901
categories x11 devel
maintainers jeremyhu openmaintainer
description The X.org / Xquartz X server.
@@ -19,9 +19,9 @@
dist_subdir ${my_name}
distname ${my_name}-${version}
-checksums md5 c9ba50bd44ea70da51f13100336a5484 \
- sha1 fd831b3c6297d1a68830c602d767752d87b9ca54 \
- rmd160 3d1ad6b236772ebe0400a69a03b9093bb210fd4b
+checksums md5 3bb1a707b51b914f88a84b8d4af19943 \
+ sha1 106b6806b64ae368f1f8d52568ca272f88d0c567 \
+ rmd160 268a3993204012653c62e0f7fa20db9285a675f9
use_bzip2 yes
use_parallel_build yes
@@ -64,7 +64,7 @@
port:xorg-libXfixes
configure.args --with-apple-applications-dir=${applications_dir} \
- --with-launchd-id-prefix=org.macports \
+ --with-bundle-id-prefix=org.macports \
--without-dtrace \
--without-doxygen \
--without-fop \
@@ -79,11 +79,22 @@
RAWCPP=${configure.cpp}
patchfiles \
- 0001-Send-events-that-were-missing-from-RRSelectInput.patch \
- 0002-randr-check-rotated-virtual-size-limits-correctly.patch \
- 5001-Workaround-the-GC-clipping-problem-in-miPaintWindow-.patch \
- 5002-fb-Revert-fb-changes-that-broke-XQuartz.patch \
- 5003-configure.ac-Add-fno-strict-aliasing-to-CFLAGS.patch
+ 0001-DIX-Set-backgroundState-correctly-for-root-window.patch \
+ 0002-XQuartz-GLX-Create-a-new-dispatch-table-rather-than-.patch \
+ 0003-XQuartz-Move-lXplugin-to-LDFLAGS-from-LDADD.patch \
+ 0004-XQuartz-Add-a-semicolon-after-DEBUG_LOG.patch \
+ 0005-XQuartz-ASL-Update-logging-to-support-differnet-leve.patch \
+ 0006-XQuartz-ASL-Use-xpr-subsystem-for-logging-xpr-messag.patch \
+ 0007-XQuartz-ASL-Use-GLXAqua-subsystem-for-logging-GLXAqu.patch \
+ 0008-XQuartz-ASL-Use-xpbproxy-subsystem-for-logging-xpbpr.patch \
+ 0009-XQuartz-xpbproxy-Correct-NSUInteger-format-strings.patch \
+ 0010-test-fix-memset-size-for-WindowRec-37801.patch \
+ 0011-XQuartz-Remove-explicit-link-against-libGL.patch \
+ 0012-XQuartz-AIGLX-Setup-dispatch-table-based-on-runtime-.patch \
+ 0013-XQuartz-AIGLX-Remove-unnecessary-includes-in-indirec.patch \
+ 5001-configure.ac-Add-fno-strict-aliasing-to-CFLAGS.patch \
+ 5002-Workaround-the-GC-clipping-problem-in-miPaintWindow-.patch \
+ 5003-fb-Revert-fb-changes-that-broke-XQuartz.patch
patch.pre_args -p1
Added: trunk/dports/x11/xorg-server-devel/files/0001-DIX-Set-backgroundState-correctly-for-root-window.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/0001-DIX-Set-backgroundState-correctly-for-root-window.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/0001-DIX-Set-backgroundState-correctly-for-root-window.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -0,0 +1,41 @@
+From c5b72fd350bbdfd1facd0ddd5085f238c4cf252a Mon Sep 17 00:00:00 2001
+From: Marko Macek <Marko.Macek at gmx.net>
+Date: Sat, 21 May 2011 13:30:59 +0100
+Subject: [PATCH 01/16] DIX: Set backgroundState correctly for root window
+
+When we change the root window's background to None, and we've run with
+-wr or -br for a forced solid background, make sure we also change the
+background state to BackgroundPixel, so we don't try to lookup either
+pScreen->whitePixel or pScreen->blackPixel as a pixmap.
+
+Signed-off-by: Marko Macek <Marko.Macek at gmx.net>
+Reviewed-by: Walter Harms <wharms at bfs.de>
+Reviewed-by: Daniel Stone <daniel at fooishbar.org>
+Signed-off-by: Keith Packard <keithp at keithp.com>
+---
+ dix/window.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git xorg-server-1.10.99.901/dix/window.c xorg-server-1.10.99.901/dix/window.c
+index cd28d05..5defe58 100644
+--- xorg-server-1.10.99.901/dix/window.c
++++ xorg-server-1.10.99.901/dix/window.c
+@@ -475,6 +475,7 @@ InitRootWindow(WindowPtr pWin)
+ pWin->background.pixel = pScreen->whitePixel;
+ backFlag |= CWBackPixmap;
+ } else {
++ pWin->backgroundState = BackgroundPixel;
+ if (whiteRoot)
+ pWin->background.pixel = pScreen->whitePixel;
+ else
+@@ -973,6 +974,7 @@ SetRootWindowBackground(WindowPtr pWin, ScreenPtr pScreen, Mask *index2)
+ else if (party_like_its_1989)
+ MakeRootTile(pWin);
+ else {
++ pWin->backgroundState = BackgroundPixel;
+ if (whiteRoot)
+ pWin->background.pixel = pScreen->whitePixel;
+ else
+--
+1.7.5.2
+
Deleted: trunk/dports/x11/xorg-server-devel/files/0001-Send-events-that-were-missing-from-RRSelectInput.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/0001-Send-events-that-were-missing-from-RRSelectInput.patch 2011-06-03 16:03:42 UTC (rev 79155)
+++ trunk/dports/x11/xorg-server-devel/files/0001-Send-events-that-were-missing-from-RRSelectInput.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -1,72 +0,0 @@
-From 613e0e9ef74c4542ed458200165adbcdfdf3cd17 Mon Sep 17 00:00:00 2001
-From: Jeremy Huddleston <jeremyhu at apple.com>
-Date: Wed, 13 Apr 2011 11:51:30 -0700
-Subject: [PATCH 1/2] Send events that were missing from RRSelectInput
-
-The RANDR spec (randrproto.txt) specifies that RRSelectInput will send out
-events corresponding to the event mask, if there have been changes to
-CRTCs or outputs. Only screen events were being generated, however.
-
-Fixes http://bugs.freedesktop.org/21760
-
-Signed-off-by: Federico Mena Quintero <federico at novell.com>
-Reviewd-by: Keith Packard <keithp at keithp.com>
-Signed-off-by: Keith Packard <keithp at keithp.com>
-(cherry picked from commit b2997431fd426ab318bc5dfd2cd43956d733ebec)
----
- randr/rrdispatch.c | 32 ++++++++++++++++++++++++++++++--
- 1 files changed, 30 insertions(+), 2 deletions(-)
-
-diff --git xorg-server-1.10.2/randr/rrdispatch.c xorg-server-1.10.2/randr/rrdispatch.c
-index ac4d2ac..2135504 100644
---- xorg-server-1.10.2/randr/rrdispatch.c
-+++ xorg-server-1.10.2/randr/rrdispatch.c
-@@ -146,7 +146,7 @@ ProcRRSelectInput (ClientPtr client)
- /*
- * Now see if the client needs an event
- */
-- if (pScrPriv && (pRREvent->mask & RRScreenChangeNotifyMask))
-+ if (pScrPriv)
- {
- pTimes = &((RRTimesPtr) (pRRClient + 1))[pScreen->myNum];
- if (CompareTimeStamps (pTimes->setTime,
-@@ -154,7 +154,35 @@ ProcRRSelectInput (ClientPtr client)
- CompareTimeStamps (pTimes->configTime,
- pScrPriv->lastConfigTime) != 0)
- {
-- RRDeliverScreenEvent (client, pWin, pScreen);
-+ if (pRREvent->mask & RRScreenChangeNotifyMask)
-+ {
-+ RRDeliverScreenEvent (client, pWin, pScreen);
-+ }
-+
-+ if (pRREvent->mask & RRCrtcChangeNotifyMask)
-+ {
-+ int i;
-+
-+ for (i = 0; i < pScrPriv->numCrtcs; i++)
-+ {
-+ RRDeliverCrtcEvent (client, pWin, pScrPriv->crtcs[i]);
-+ }
-+ }
-+
-+ if (pRREvent->mask & RROutputChangeNotifyMask)
-+ {
-+ int i;
-+
-+ for (i = 0; i < pScrPriv->numOutputs; i++)
-+ {
-+ RRDeliverOutputEvent (client, pWin, pScrPriv->outputs[i]);
-+ }
-+ }
-+
-+ /* We don't check for RROutputPropertyNotifyMask, as randrproto.txt doesn't
-+ * say if there ought to be notifications of changes to output properties
-+ * if those changes occurred before the time RRSelectInput is called.
-+ */
- }
- }
- }
---
-1.7.4.1
-
Added: trunk/dports/x11/xorg-server-devel/files/0002-XQuartz-GLX-Create-a-new-dispatch-table-rather-than-.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/0002-XQuartz-GLX-Create-a-new-dispatch-table-rather-than-.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/0002-XQuartz-GLX-Create-a-new-dispatch-table-rather-than-.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -0,0 +1,56 @@
+From 38df706c6b8a339c4267cae7be0881c4362f36da Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Tue, 31 May 2011 13:01:05 -0700
+Subject: [PATCH 02/16] XQuartz: GLX: Create a new dispatch table rather than
+ modifying the existing one
+
+Fixes regression introduced by b0c665ac0fe6840dda581e4d0d0b76c703d62a7b
+
+0 X11.bin 0x0000000100118293 __glXAquaScreenCreateContext + 684
+1 X11.bin 0x00000001001315b0 DoCreateContext + 163
+2 X11.bin 0x000000010013509f __glXDispatch + 211
+3 X11.bin 0x00000001000c7dad Dispatch + 785
+4 X11.bin 0x00000001000b97e5 dix_main + 1022
+5 X11.bin 0x00000001000122bc server_thread + 50
+6 libSystem.B.dylib 0x00007fff836554f6 _pthread_start + 331
+7 libSystem.B.dylib 0x00007fff836553a9 thread_start + 13
+
+http://lists.apple.com/archives/X11-users/2011/May/msg00045.html
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+Reviewed-by: Adam Jackson <ajax at redhat.com>
+---
+ hw/xquartz/GL/indirect.c | 12 +++++++++++-
+ 1 files changed, 11 insertions(+), 1 deletions(-)
+
+diff --git xorg-server-1.10.99.901/hw/xquartz/GL/indirect.c xorg-server-1.10.99.901/hw/xquartz/GL/indirect.c
+index 6da27c7..d15b9a3 100644
+--- xorg-server-1.10.99.901/hw/xquartz/GL/indirect.c
++++ xorg-server-1.10.99.901/hw/xquartz/GL/indirect.c
+@@ -666,7 +666,15 @@ GLuint __glFloorLog2(GLuint val)
+ }
+
+ static void setup_dispatch_table(void) {
+- struct _glapi_table *disp=_glapi_get_dispatch();
++ static struct _glapi_table *disp = NULL;
++
++ if(disp) {
++ _glapi_set_dispatch(disp);
++ return;
++ }
++
++ disp=calloc(1,sizeof(struct _glapi_table));
++ assert(disp);
+
+ /* to update:
+ * for f in $(grep 'define SET_' ../../../glx/dispatch.h | cut -f2 -d' ' | cut -f1 -d\( | sort -u); do grep -q $f indirect.c || echo $f ; done | grep -v by_offset | sed 's:SET_\(.*\)$:SET_\1(disp, gl\1)\;:' | pbcopy
+@@ -1610,4 +1618,6 @@ static void setup_dispatch_table(void) {
+ SET_PixelTexGenParameterivSGIS(disp, glPixelTexGenParameterivSGIS);
+ SET_PixelTexGenSGIX(disp, glPixelTexGenSGIX);
+ #endif
++
++ _glapi_set_dispatch(disp);
+ }
+--
+1.7.5.2
+
Deleted: trunk/dports/x11/xorg-server-devel/files/0002-randr-check-rotated-virtual-size-limits-correctly.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/0002-randr-check-rotated-virtual-size-limits-correctly.patch 2011-06-03 16:03:42 UTC (rev 79155)
+++ trunk/dports/x11/xorg-server-devel/files/0002-randr-check-rotated-virtual-size-limits-correctly.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -1,65 +0,0 @@
-From 50b9d3142ff90af2f7fa35b7b1bf9e5a07723dbd Mon Sep 17 00:00:00 2001
-From: Aaron Plattner <aplattner at nvidia.com>
-Date: Tue, 24 May 2011 16:02:42 -0700
-Subject: [PATCH 2/2] randr: check rotated virtual size limits correctly
-
-Commit d1107918d4626268803b54033a07405122278e7f introduced checks to
-the RandR path that cause RRSetScreenConfig requests to fail if the
-size is too large. Unfortunately, when RandR 1.1 rotation is enabled
-it compares the rotated screen dimensions to the unrotated limits,
-which causes 90- and 270-degree rotation to fail unless your screen
-happens to be square:
-
- X Error of failed request: BadValue (integer parameter out of range for operation)
- Major opcode of failed request: 153 (RANDR)
- Minor opcode of failed request: 2 (RRSetScreenConfig)
- Value in failed request: 0x780
- Serial number of failed request: 14
- Current serial number in output stream: 14
-
-Fix this by moving the check above the code that swaps the dimensions
-based on the rotation.
-
-Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
-Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
-Tested-by: Robert Hooker <robert.hooker at canonical.com>
-Tested-by: Kent Baxley <kent.baxley at canonical.com>
-Signed-off-by: Keith Packard <keithp at keithp.com>
-(cherry picked from commit b6c7b9b2f39e970cedb6bc1e073f901e28cb0fa3)
----
- randr/rrscreen.c | 12 ++++++------
- 1 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git xorg-server-1.10.2/randr/rrscreen.c xorg-server-1.10.2/randr/rrscreen.c
-index 1bc1a9e..da6d48d 100644
---- xorg-server-1.10.2/randr/rrscreen.c
-+++ xorg-server-1.10.2/randr/rrscreen.c
-@@ -910,12 +910,6 @@ ProcRRSetScreenConfig (ClientPtr client)
- */
- width = mode->mode.width;
- height = mode->mode.height;
-- if (rotation & (RR_Rotate_90|RR_Rotate_270))
-- {
-- width = mode->mode.height;
-- height = mode->mode.width;
-- }
--
- if (width < pScrPriv->minWidth || pScrPriv->maxWidth < width) {
- client->errorValue = width;
- free(pData);
-@@ -927,6 +921,12 @@ ProcRRSetScreenConfig (ClientPtr client)
- return BadValue;
- }
-
-+ if (rotation & (RR_Rotate_90|RR_Rotate_270))
-+ {
-+ width = mode->mode.height;
-+ height = mode->mode.width;
-+ }
-+
- if (width != pScreen->width || height != pScreen->height)
- {
- int c;
---
-1.7.4.1
-
Added: trunk/dports/x11/xorg-server-devel/files/0003-XQuartz-Move-lXplugin-to-LDFLAGS-from-LDADD.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/0003-XQuartz-Move-lXplugin-to-LDFLAGS-from-LDADD.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/0003-XQuartz-Move-lXplugin-to-LDFLAGS-from-LDADD.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -0,0 +1,29 @@
+From fbc8aae8e9b5c7b175073f02e79d7ff1d1363a31 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Sun, 29 May 2011 01:20:44 -0700
+Subject: [PATCH 03/16] XQuartz: Move -lXplugin to LDFLAGS from LDADD
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+ hw/xquartz/mach-startup/Makefile.am | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git xorg-server-1.10.99.901/hw/xquartz/mach-startup/Makefile.am xorg-server-1.10.99.901/hw/xquartz/mach-startup/Makefile.am
+index 1ce54ad..4b7b2bc 100644
+--- xorg-server-1.10.99.901/hw/xquartz/mach-startup/Makefile.am
++++ xorg-server-1.10.99.901/hw/xquartz/mach-startup/Makefile.am
+@@ -22,9 +22,10 @@ X11_bin_LDADD = \
+ $(top_builddir)/dix/dixfonts.lo \
+ $(top_builddir)/miext/rootless/librootless.la \
+ $(top_builddir)/hw/xquartz/pbproxy/libxpbproxy.la \
+- $(DARWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) -lXplugin
++ $(DARWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS)
+
+ X11_bin_LDFLAGS = \
++ $(XSERVER_SYS_LIBS) -lXplugin \
+ -XCClinker -Objc \
+ -Wl,-u,_miDCInitialize \
+ -Wl,-framework,Carbon \
+--
+1.7.5.2
+
Added: trunk/dports/x11/xorg-server-devel/files/0004-XQuartz-Add-a-semicolon-after-DEBUG_LOG.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/0004-XQuartz-Add-a-semicolon-after-DEBUG_LOG.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/0004-XQuartz-Add-a-semicolon-after-DEBUG_LOG.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -0,0 +1,28 @@
+From c0077b41b4c8bb08129db97a2a01d0af55d13fa4 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Wed, 1 Jun 2011 20:54:27 -0700
+Subject: [PATCH 04/16] XQuartz: Add a semicolon after DEBUG_LOG
+
+Don't rely on the macro to provide it
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+ hw/xquartz/X11Application.m | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git xorg-server-1.10.99.901/hw/xquartz/X11Application.m xorg-server-1.10.99.901/hw/xquartz/X11Application.m
+index 7c41cbc..a51ee82 100644
+--- xorg-server-1.10.99.901/hw/xquartz/X11Application.m
++++ xorg-server-1.10.99.901/hw/xquartz/X11Application.m
+@@ -188,7 +188,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
+
+ - (void) activateX:(OSX_BOOL)state {
+ size_t i;
+- DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active)
++ DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active);
+ if (state) {
+ if(bgMouseLocationUpdated) {
+ DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, bgMouseLocation.x, bgMouseLocation.y, 0.0, 0.0, 0.0);
+--
+1.7.5.2
+
Added: trunk/dports/x11/xorg-server-devel/files/0005-XQuartz-ASL-Update-logging-to-support-differnet-leve.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/0005-XQuartz-ASL-Update-logging-to-support-differnet-leve.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/0005-XQuartz-ASL-Update-logging-to-support-differnet-leve.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -0,0 +1,60 @@
+From a66400f8dba9b7c5b65f9d26996fff677c42d866 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Wed, 1 Jun 2011 20:45:58 -0700
+Subject: [PATCH 05/16] XQuartz: ASL: Update logging to support differnet
+ levels and subsystems
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+ hw/xquartz/darwin.c | 6 ++++--
+ hw/xquartz/darwin.h | 6 ++++--
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git xorg-server-1.10.99.901/hw/xquartz/darwin.c xorg-server-1.10.99.901/hw/xquartz/darwin.c
+index fa8d4ce..29ab836 100644
+--- xorg-server-1.10.99.901/hw/xquartz/darwin.c
++++ xorg-server-1.10.99.901/hw/xquartz/darwin.c
+@@ -79,7 +79,7 @@
+
+ aslclient aslc;
+
+-void debug_asl (const char *file, const char *function, int line, const char *fmt, ...) {
++void xq_asl_log (int level, const char *subsystem, const char *file, const char *function, int line, const char *fmt, ...) {
+ va_list args;
+ aslmsg msg = asl_new(ASL_TYPE_MSG);
+
+@@ -93,10 +93,12 @@ void debug_asl (const char *file, const char *function, int line, const char *fm
+ asl_set(msg, "Line", _line);
+ free(_line);
+ }
++ if(subsystem)
++ asl_set(msg, "Subsystem", subsystem);
+ }
+
+ va_start(args, fmt);
+- asl_vlog(aslc, msg, ASL_LEVEL_DEBUG, fmt, args);
++ asl_vlog(aslc, msg, level, fmt, args);
+ va_end(args);
+
+ if(msg)
+diff --git xorg-server-1.10.99.901/hw/xquartz/darwin.h xorg-server-1.10.99.901/hw/xquartz/darwin.h
+index 659de43..aafc12f 100644
+--- xorg-server-1.10.99.901/hw/xquartz/darwin.h
++++ xorg-server-1.10.99.901/hw/xquartz/darwin.h
+@@ -76,9 +76,11 @@ extern int darwinMainScreenY;
+ // bundle-main.c
+ extern char *bundle_id_prefix;
+
+-extern void debug_asl (const char *file, const char *function, int line, const char *fmt, ...) _X_ATTRIBUTE_PRINTF(4,5);
++_X_ATTRIBUTE_PRINTF(6,7)
++extern void xq_asl_log (int level, const char *subsystem, const char *file, const char *function, int line, const char *fmt, ...);
+
+-#define DEBUG_LOG(msg, args...) debug_asl(__FILE__, __FUNCTION__, __LINE__, msg, ##args);
++#define ASL_LOG(level, subsystem, msg, args...) xq_asl_log(level, subsystem, __FILE__, __FUNCTION__, __LINE__, msg, ##args)
++#define DEBUG_LOG(msg, args...) ASL_LOG(ASL_LEVEL_DEBUG, "XQuartz", msg, ##args)
+ #define TRACE() DEBUG_LOG("TRACE")
+
+ #endif /* _DARWIN_H */
+--
+1.7.5.2
+
Added: trunk/dports/x11/xorg-server-devel/files/0006-XQuartz-ASL-Use-xpr-subsystem-for-logging-xpr-messag.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/0006-XQuartz-ASL-Use-xpr-subsystem-for-logging-xpr-messag.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/0006-XQuartz-ASL-Use-xpr-subsystem-for-logging-xpr-messag.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -0,0 +1,69 @@
+From 19020b23efa15d72349bd833aebddcc64780a615 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Wed, 1 Jun 2011 21:06:08 -0700
+Subject: [PATCH 06/16] XQuartz: ASL: Use xpr subsystem for logging xpr
+ messages
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+ hw/xquartz/xpr/xpr.h | 5 +++++
+ hw/xquartz/xpr/xprCursor.c | 1 -
+ hw/xquartz/xpr/xprEvent.c | 1 -
+ hw/xquartz/xpr/xprScreen.c | 1 -
+ 4 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git xorg-server-1.10.99.901/hw/xquartz/xpr/xpr.h xorg-server-1.10.99.901/hw/xquartz/xpr/xpr.h
+index ebd89de..0b138dd 100644
+--- xorg-server-1.10.99.901/hw/xquartz/xpr/xpr.h
++++ xorg-server-1.10.99.901/hw/xquartz/xpr/xpr.h
+@@ -33,6 +33,11 @@
+ #include "screenint.h"
+ #include <Xplugin.h>
+
++#include "darwin.h"
++
++#undef DEBUG_LOG
++#define DEBUG_LOG(msg, args...) ASL_LOG(ASL_LEVEL_DEBUG, "xpr", msg, ##args)
++
+ Bool QuartzModeBundleInit(void);
+
+ void AppleDRIExtensionInit(void);
+diff --git xorg-server-1.10.99.901/hw/xquartz/xpr/xprCursor.c xorg-server-1.10.99.901/hw/xquartz/xpr/xprCursor.c
+index 216678e..2b31865 100644
+--- xorg-server-1.10.99.901/hw/xquartz/xpr/xprCursor.c
++++ xorg-server-1.10.99.901/hw/xquartz/xpr/xprCursor.c
+@@ -37,7 +37,6 @@
+
+ #include "quartz.h"
+ #include "xpr.h"
+-#include "darwin.h"
+ #include "darwinEvents.h"
+ #include <Xplugin.h>
+
+diff --git xorg-server-1.10.99.901/hw/xquartz/xpr/xprEvent.c xorg-server-1.10.99.901/hw/xquartz/xpr/xprEvent.c
+index cc86c47..4e7ece6 100644
+--- xorg-server-1.10.99.901/hw/xquartz/xpr/xprEvent.c
++++ xorg-server-1.10.99.901/hw/xquartz/xpr/xprEvent.c
+@@ -44,7 +44,6 @@
+ #include "scrnintstr.h"
+ #include "mipointer.h"
+
+-#include "darwin.h"
+ #include "quartz.h"
+ #include "quartzKeyboard.h"
+ #include "darwinEvents.h"
+diff --git xorg-server-1.10.99.901/hw/xquartz/xpr/xprScreen.c xorg-server-1.10.99.901/hw/xquartz/xpr/xprScreen.c
+index 98250e6..002355e 100644
+--- xorg-server-1.10.99.901/hw/xquartz/xpr/xprScreen.c
++++ xorg-server-1.10.99.901/hw/xquartz/xpr/xprScreen.c
+@@ -40,7 +40,6 @@
+ #include "xpr.h"
+ #include "xprEvent.h"
+ #include "pseudoramiX.h"
+-#include "darwin.h"
+ #include "darwinEvents.h"
+ #include "rootless.h"
+ #include "dri.h"
+--
+1.7.5.2
+
Added: trunk/dports/x11/xorg-server-devel/files/0007-XQuartz-ASL-Use-GLXAqua-subsystem-for-logging-GLXAqu.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/0007-XQuartz-ASL-Use-GLXAqua-subsystem-for-logging-GLXAqu.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/0007-XQuartz-ASL-Use-GLXAqua-subsystem-for-logging-GLXAqu.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -0,0 +1,33 @@
+From 7dfd65705ccd3c6e2458d6892282520fe5ed8a6b Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Wed, 1 Jun 2011 21:06:53 -0700
+Subject: [PATCH 07/16] XQuartz: ASL: Use GLXAqua subsystem for logging
+ GLXAqua messages
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+ hw/xquartz/GL/indirect.c | 8 ++------
+ 1 files changed, 2 insertions(+), 6 deletions(-)
+
+diff --git xorg-server-1.10.99.901/hw/xquartz/GL/indirect.c xorg-server-1.10.99.901/hw/xquartz/GL/indirect.c
+index d15b9a3..c41840b 100644
+--- xorg-server-1.10.99.901/hw/xquartz/GL/indirect.c
++++ xorg-server-1.10.99.901/hw/xquartz/GL/indirect.c
+@@ -155,12 +155,8 @@ typedef long long GLint64EXT;
+
+ __GLXprovider * GlxGetDRISWrastProvider (void);
+
+-// Write debugging output, or not
+-#ifdef GLAQUA_DEBUG
+-#define GLAQUA_DEBUG_MSG ErrorF
+-#else
+-#define GLAQUA_DEBUG_MSG(a, ...)
+-#endif
++#include "darwin.h"
++#define GLAQUA_DEBUG_MSG(msg, args...) ASL_LOG(ASL_LEVEL_DEBUG, "GLXAqua", msg, ##args)
+
+ static void setup_dispatch_table(void);
+ GLuint __glFloorLog2(GLuint val);
+--
+1.7.5.2
+
Added: trunk/dports/x11/xorg-server-devel/files/0008-XQuartz-ASL-Use-xpbproxy-subsystem-for-logging-xpbpr.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/0008-XQuartz-ASL-Use-xpbproxy-subsystem-for-logging-xpbpr.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/0008-XQuartz-ASL-Use-xpbproxy-subsystem-for-logging-xpbpr.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -0,0 +1,70 @@
+From 971193b2750b98b28597ba194ed388e79b3489b6 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Wed, 1 Jun 2011 21:18:03 -0700
+Subject: [PATCH 08/16] XQuartz: ASL: Use xpbproxy subsystem for logging
+ xpbproxy messages
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+ hw/xquartz/pbproxy/app-main.m | 11 +++++++++++
+ hw/xquartz/pbproxy/pbproxy.h | 15 ++++++++-------
+ 2 files changed, 19 insertions(+), 7 deletions(-)
+
+diff --git xorg-server-1.10.99.901/hw/xquartz/pbproxy/app-main.m xorg-server-1.10.99.901/hw/xquartz/pbproxy/app-main.m
+index a8c3a60..772c458 100644
+--- xorg-server-1.10.99.901/hw/xquartz/pbproxy/app-main.m
++++ xorg-server-1.10.99.901/hw/xquartz/pbproxy/app-main.m
+@@ -63,6 +63,17 @@ ErrorF(const char * f, ...)
+ va_end(args);
+ }
+
++/* TODO: Have this actually log to ASL */
++void xq_asl_log (int level, const char *subsystem, const char *file, const char *function, int line, const char *fmt, ...) {
++#ifdef DEBUG
++ va_list args;
++
++ va_start(args, fmt);
++ vfprintf(stderr, fmt, args);
++ va_end(args);
++#endif
++}
++
+ int main (int argc, const char *argv[]) {
+ const char *s;
+ int i;
+diff --git xorg-server-1.10.99.901/hw/xquartz/pbproxy/pbproxy.h xorg-server-1.10.99.901/hw/xquartz/pbproxy/pbproxy.h
+index fcbf4c4..c80a660 100644
+--- xorg-server-1.10.99.901/hw/xquartz/pbproxy/pbproxy.h
++++ xorg-server-1.10.99.901/hw/xquartz/pbproxy/pbproxy.h
+@@ -32,6 +32,8 @@
+
+ #import <Foundation/Foundation.h>
+
++#include <asl.h>
++
+ #include <AvailabilityMacros.h>
+ #if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
+ #if __LP64__ || NS_BUILD_32_LIKE_64
+@@ -80,13 +82,12 @@ extern BOOL xpbproxy_input_register (void);
+ /* os/log.c or app-main.m */
+ extern void ErrorF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2);
+
+-#ifdef DEBUG
+-/* BEWARE: this can cause a string memory leak, according to the leaks program. */
+-# define DebugF(msg, args...) ErrorF("%s:%s:%d " msg, __FILE__, __FUNCTION__, __LINE__, ##args)
+-#else
+-# define DebugF(...) /* */
+-#endif
++/* from darwin.h */
++_X_ATTRIBUTE_PRINTF(6,7)
++extern void xq_asl_log (int level, const char *subsystem, const char *file, const char *function, int line, const char *fmt, ...);
+
+-#define TRACE() DebugF("TRACE\n")
++#define ASL_LOG(level, subsystem, msg, args...) xq_asl_log(level, subsystem, __FILE__, __FUNCTION__, __LINE__, msg, ##args)
++#define DebugF(msg, args...) ASL_LOG(ASL_LEVEL_DEBUG, "xpbproxy", msg, ##args)
++#define TRACE() DebugF("TRACE")
+
+ #endif /* PBPROXY_H */
+--
+1.7.5.2
+
Added: trunk/dports/x11/xorg-server-devel/files/0009-XQuartz-xpbproxy-Correct-NSUInteger-format-strings.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/0009-XQuartz-xpbproxy-Correct-NSUInteger-format-strings.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/0009-XQuartz-xpbproxy-Correct-NSUInteger-format-strings.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -0,0 +1,94 @@
+From 48b4b778f61daaa161483b510ab520f3fcb84925 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Wed, 1 Jun 2011 21:55:06 -0700
+Subject: [PATCH 09/16] XQuartz: xpbproxy: Correct NSUInteger format strings
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+ hw/xquartz/pbproxy/x-selection.m | 27 +++++++++++++++++++++++++++
+ 1 files changed, 27 insertions(+), 0 deletions(-)
+
+diff --git xorg-server-1.10.99.901/hw/xquartz/pbproxy/x-selection.m xorg-server-1.10.99.901/hw/xquartz/pbproxy/x-selection.m
+index 7964f51..b5f4dde 100644
+--- xorg-server-1.10.99.901/hw/xquartz/pbproxy/x-selection.m
++++ xorg-server-1.10.99.901/hw/xquartz/pbproxy/x-selection.m
+@@ -683,7 +683,11 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato
+ return;
+ }
+
++#ifdef __LP64__
++ DebugF ("pbtypes retainCount after containsObject: %lu\n", [pbtypes retainCount]);
++#else
+ DebugF ("pbtypes retainCount after containsObject: %u\n", [pbtypes retainCount]);
++#endif
+
+ data = [pb stringForType:NSStringPboardType];
+
+@@ -704,7 +708,11 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato
+
+ if (length < 50) {
+ DebugF ("UTF-8: %s\n", bytes);
++#ifdef __LP64__
++ DebugF ("UTF-8 length: %lu\n", length);
++#else
+ DebugF ("UTF-8 length: %u\n", length);
++#endif
+ }
+ }
+ else
+@@ -1223,8 +1231,13 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato
+ return;
+ }
+
++#ifdef __LP64__
++ DebugF ("data retainCount before NSBitmapImageRep initWithData: %lu\n",
++ [data retainCount]);
++#else
+ DebugF ("data retainCount before NSBitmapImageRep initWithData: %u\n",
+ [data retainCount]);
++#endif
+
+ bmimage = [[NSBitmapImageRep alloc] initWithData:data];
+
+@@ -1235,8 +1248,13 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato
+ return;
+ }
+
++#ifdef __LP64__
++ DebugF ("data retainCount after NSBitmapImageRep initWithData: %lu\n",
++ [data retainCount]);
++#else
+ DebugF ("data retainCount after NSBitmapImageRep initWithData: %u\n",
+ [data retainCount]);
++#endif
+
+ @try
+ {
+@@ -1251,7 +1269,11 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato
+ return;
+ }
+
++#ifdef __LP64__
++ DebugF ("bmimage retainCount after TIFFRepresentation %lu\n", [bmimage retainCount]);
++#else
+ DebugF ("bmimage retainCount after TIFFRepresentation %u\n", [bmimage retainCount]);
++#endif
+
+ pbtypes = [NSArray arrayWithObjects:NSTIFFPboardType, nil];
+
+@@ -1270,7 +1292,12 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato
+
+ [data autorelease];
+
++#ifdef __LP64__
++ DebugF ("bmimage retainCount before release %lu\n", [bmimage retainCount]);
++#else
+ DebugF ("bmimage retainCount before release %u\n", [bmimage retainCount]);
++#endif
++
+ [bmimage autorelease];
+ }
+
+--
+1.7.5.2
+
Added: trunk/dports/x11/xorg-server-devel/files/0010-test-fix-memset-size-for-WindowRec-37801.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/0010-test-fix-memset-size-for-WindowRec-37801.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/0010-test-fix-memset-size-for-WindowRec-37801.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -0,0 +1,32 @@
+From d9bda34d0df576d155e1d682d5e2a382b8e1ffda Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at who-t.net>
+Date: Wed, 1 Jun 2011 10:24:43 +1000
+Subject: [PATCH 10/16] test: fix memset size for WindowRec (#37801)
+
+X.Org Bug 37801 <http://bugs.freedesktop.org/show_bug.cgi?id=37801>
+
+Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
+Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
+Reviewed-by: Daniel Stone <daniel at fooishbar.org>
+Reviewed-by: Cyril Brulebois <kibi at debian.org>
+Signed-off-by: Keith Packard <keithp at keithp.com>
+---
+ test/xi2/protocol-common.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git xorg-server-1.10.99.901/test/xi2/protocol-common.c xorg-server-1.10.99.901/test/xi2/protocol-common.c
+index 6ffc697..4234533 100644
+--- xorg-server-1.10.99.901/test/xi2/protocol-common.c
++++ xorg-server-1.10.99.901/test/xi2/protocol-common.c
+@@ -121,7 +121,7 @@ ClientRec init_client(int len, void *data)
+
+ void init_window(WindowPtr window, WindowPtr parent, int id)
+ {
+- memset(window, 0, sizeof(window));
++ memset(window, 0, sizeof(*window));
+
+ window->drawable.id = id;
+ if (parent)
+--
+1.7.5.2
+
Added: trunk/dports/x11/xorg-server-devel/files/0011-XQuartz-Remove-explicit-link-against-libGL.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/0011-XQuartz-Remove-explicit-link-against-libGL.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/0011-XQuartz-Remove-explicit-link-against-libGL.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -0,0 +1,28 @@
+From 67e40e38bdbb7488818bbe18da12995d59040a86 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Fri, 3 Jun 2011 02:34:28 -0400
+Subject: [PATCH 11/16] XQuartz: Remove explicit link against libGL
+
+This was indented to force a link against OpenGL.framework's libGL, but it
+actually resulted in linking against mesa's libGL due to the ordering of -L
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+ hw/xquartz/mach-startup/Makefile.am | 1 -
+ 1 files changed, 0 insertions(+), 1 deletions(-)
+
+diff --git xorg-server-1.10.99.901/hw/xquartz/mach-startup/Makefile.am xorg-server-1.10.99.901/hw/xquartz/mach-startup/Makefile.am
+index 4b7b2bc..8e49ea8 100644
+--- xorg-server-1.10.99.901/hw/xquartz/mach-startup/Makefile.am
++++ xorg-server-1.10.99.901/hw/xquartz/mach-startup/Makefile.am
+@@ -39,7 +39,6 @@ X11_bin_LDADD += \
+ $(top_builddir)/glx/libglx.la
+
+ X11_bin_LDFLAGS += \
+- -L/System/Library/Frameworks/OpenGL.framework/Libraries -lGL \
+ -Wl,-framework,OpenGL
+ endif
+
+--
+1.7.5.2
+
Added: trunk/dports/x11/xorg-server-devel/files/0012-XQuartz-AIGLX-Setup-dispatch-table-based-on-runtime-.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/0012-XQuartz-AIGLX-Setup-dispatch-table-based-on-runtime-.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/0012-XQuartz-AIGLX-Setup-dispatch-table-based-on-runtime-.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -0,0 +1,1944 @@
+From 1709449932331be537a7aeffb67c88e2dc8b183b Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Thu, 2 Jun 2011 20:04:04 -0700
+Subject: [PATCH 12/16] XQuartz: AIGLX: Setup dispatch table based on runtime
+ capabilities rather than buildtime
+
+This will allow XQuartz built on older systems to pickup capabilities on
+newer systems and prevent runtime failures when building on newer systems and
+running on older ones.
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+ hw/xquartz/GL/indirect.c | 1876 ++++++++++++++++++++++------------------------
+ 1 files changed, 880 insertions(+), 996 deletions(-)
+
+diff --git xorg-server-1.10.99.901/hw/xquartz/GL/indirect.c xorg-server-1.10.99.901/hw/xquartz/GL/indirect.c
+index c41840b..40f1e93 100644
+--- xorg-server-1.10.99.901/hw/xquartz/GL/indirect.c
++++ xorg-server-1.10.99.901/hw/xquartz/GL/indirect.c
+@@ -2,7 +2,7 @@
+ * GLX implementation that uses Apple's OpenGL.framework
+ * (Indirect rendering path -- it's also used for some direct mode code too)
+ *
+- * Copyright (c) 2007, 2008, 2009 Apple Inc.
++ * Copyright (c) 2007-2011 Apple Inc.
+ * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved.
+ * Copyright (c) 2002 Greg Parker. All Rights Reserved.
+ *
+@@ -39,94 +39,13 @@
+
+ #include <AvailabilityMacros.h>
+
++#include <dlfcn.h>
++
+ #define GL_GLEXT_WUNDEF_SUPPORT
+
+ #include <OpenGL/OpenGL.h>
+-#include <OpenGL/gl.h>
+-#include <OpenGL/glext.h>
+ #include <OpenGL/CGLContext.h>
+
+-/* These next few GL_EXT pre-processing blocks are to explicitly define
+- * these symbols to 0 if they are not set by OpenGL.framework. This
+- * prevents the X11 glext.h from setting them to 1.
+- */
+-
+-#ifndef GL_EXT_fragment_shader
+-#define GL_EXT_fragment_shader 0
+-#endif
+-
+-#ifndef GL_EXT_blend_equation_separate
+-#define GL_EXT_blend_equation_separate 0
+-#endif
+-
+-#ifndef GL_EXT_blend_func_separate
+-#define GL_EXT_blend_func_separate 0
+-#endif
+-
+-#ifndef GL_EXT_depth_bounds_test
+-#define GL_EXT_depth_bounds_test 0
+-#endif
+-
+-#ifndef GL_EXT_compiled_vertex_array
+-#define GL_EXT_compiled_vertex_array 0
+-#endif
+-
+-#ifndef GL_EXT_cull_vertex
+-#define GL_EXT_cull_vertex 0
+-#endif
+-
+-#ifndef GL_EXT_fog_coord
+-#define GL_EXT_fog_coord 0
+-#endif
+-
+-#ifndef GL_EXT_framebuffer_blit
+-#define GL_EXT_framebuffer_blit 0
+-#endif
+-
+-#ifndef GL_EXT_framebuffer_object
+-#define GL_EXT_framebuffer_object 0
+-#endif
+-
+-#ifndef GL_EXT_gpu_program_parameters
+-#define GL_EXT_gpu_program_parameters 0
+-#endif
+-
+-#ifndef GL_EXT_multi_draw_arrays
+-#define GL_EXT_multi_draw_arrays 0
+-#endif
+-
+-#ifndef GL_EXT_point_parameters
+-#define GL_EXT_point_parameters 0
+-#endif
+-
+-#ifndef GL_EXT_polygon_offset
+-#define GL_EXT_polygon_offset 0
+-#endif
+-
+-#ifndef GL_EXT_secondary_color
+-#define GL_EXT_secondary_color 0
+-#endif
+-
+-#ifndef GL_EXT_stencil_two_side
+-#define GL_EXT_stencil_two_side 0
+-#endif
+-
+-#ifndef GL_EXT_timer_query
+-#define GL_EXT_timer_query 0
+-#endif
+-
+-#ifndef GL_EXT_vertex_array
+-#define GL_EXT_vertex_array 0
+-#endif
+-
+-/* Tiger PPC doesn't have the associated symbols, but glext.h says it does. Liars!
+- * http://trac.macports.org/ticket/20638
+- */
+-#if defined(__ppc__) && MAC_OS_X_VERSION_MIN_REQUIRED < 1050
+-#undef GL_EXT_gpu_program_parameters
+-#define GL_EXT_gpu_program_parameters 0
+-#endif
+-
+ #include <GL/glxproto.h>
+ #include <windowstr.h>
+ #include <resource.h>
+@@ -673,345 +592,345 @@ static void setup_dispatch_table(void) {
+ assert(disp);
+
+ /* to update:
+- * for f in $(grep 'define SET_' ../../../glx/dispatch.h | cut -f2 -d' ' | cut -f1 -d\( | sort -u); do grep -q $f indirect.c || echo $f ; done | grep -v by_offset | sed 's:SET_\(.*\)$:SET_\1(disp, gl\1)\;:' | pbcopy
++ * for f in $(grep 'define SET_' ../../../glx/dispatch.h | cut -f2 -d' ' | cut -f1 -d\( | sort -u); do grep -q $f indirect.c && echo $f ; done | grep -v by_offset | sed 's:SET_\(.*\)$:SET_\1(disp, dlsym(RTLD_DEFAULT, "gl\1"))\;:'
+ */
+
+- SET_Accum(disp, glAccum);
+- SET_AlphaFunc(disp, glAlphaFunc);
+- SET_AreTexturesResident(disp, glAreTexturesResident);
+- SET_ArrayElement(disp, glArrayElement);
+- SET_Begin(disp, glBegin);
+- SET_BindTexture(disp, glBindTexture);
+- SET_Bitmap(disp, glBitmap);
+- SET_BlendColor(disp, glBlendColor);
+- SET_BlendEquation(disp, glBlendEquation);
+- SET_BlendFunc(disp, glBlendFunc);
+- SET_CallList(disp, glCallList);
+- SET_CallLists(disp, glCallLists);
+- SET_Clear(disp, glClear);
+- SET_ClearAccum(disp, glClearAccum);
+- SET_ClearColor(disp, glClearColor);
+- SET_ClearDepth(disp, glClearDepth);
+- SET_ClearIndex(disp, glClearIndex);
+- SET_ClearStencil(disp, glClearStencil);
+- SET_ClipPlane(disp, glClipPlane);
+- SET_Color3b(disp, glColor3b);
+- SET_Color3bv(disp, glColor3bv);
+- SET_Color3d(disp, glColor3d);
+- SET_Color3dv(disp, glColor3dv);
+- SET_Color3f(disp, glColor3f);
+- SET_Color3fv(disp, glColor3fv);
+- SET_Color3i(disp, glColor3i);
+- SET_Color3iv(disp, glColor3iv);
+- SET_Color3s(disp, glColor3s);
+- SET_Color3sv(disp, glColor3sv);
+- SET_Color3ub(disp, glColor3ub);
+- SET_Color3ubv(disp, glColor3ubv);
+- SET_Color3ui(disp, glColor3ui);
+- SET_Color3uiv(disp, glColor3uiv);
+- SET_Color3us(disp, glColor3us);
+- SET_Color3usv(disp, glColor3usv);
+- SET_Color4b(disp, glColor4b);
+- SET_Color4bv(disp, glColor4bv);
+- SET_Color4d(disp, glColor4d);
+- SET_Color4dv(disp, glColor4dv);
+- SET_Color4f(disp, glColor4f);
+- SET_Color4fv(disp, glColor4fv);
+- SET_Color4i(disp, glColor4i);
+- SET_Color4iv(disp, glColor4iv);
+- SET_Color4s(disp, glColor4s);
+- SET_Color4sv(disp, glColor4sv);
+- SET_Color4ub(disp, glColor4ub);
+- SET_Color4ubv(disp, glColor4ubv);
+- SET_Color4ui(disp, glColor4ui);
+- SET_Color4uiv(disp, glColor4uiv);
+- SET_Color4us(disp, glColor4us);
+- SET_Color4usv(disp, glColor4usv);
+- SET_ColorMask(disp, glColorMask);
+- SET_ColorMaterial(disp, glColorMaterial);
+- SET_ColorPointer(disp, glColorPointer);
+- SET_ColorSubTable(disp, glColorSubTable);
+- SET_ColorTable(disp, glColorTable);
+- SET_ColorTableParameterfv(disp, glColorTableParameterfv);
+- SET_ColorTableParameteriv(disp, glColorTableParameteriv);
+- SET_ConvolutionFilter1D(disp, glConvolutionFilter1D);
+- SET_ConvolutionFilter2D(disp, glConvolutionFilter2D);
+- SET_ConvolutionParameterf(disp, glConvolutionParameterf);
+- SET_ConvolutionParameterfv(disp, glConvolutionParameterfv);
+- SET_ConvolutionParameteri(disp, glConvolutionParameteri);
+- SET_ConvolutionParameteriv(disp, glConvolutionParameteriv);
+- SET_CopyColorSubTable(disp, glCopyColorSubTable);
+- SET_CopyColorTable(disp, glCopyColorTable);
+- SET_CopyConvolutionFilter1D(disp, glCopyConvolutionFilter1D);
+- SET_CopyConvolutionFilter2D(disp, glCopyConvolutionFilter2D);
+- SET_CopyPixels(disp, glCopyPixels);
+- SET_CopyTexImage1D(disp, glCopyTexImage1D);
+- SET_CopyTexImage2D(disp, glCopyTexImage2D);
+- SET_CopyTexSubImage1D(disp, glCopyTexSubImage1D);
+- SET_CopyTexSubImage2D(disp, glCopyTexSubImage2D);
+- SET_CopyTexSubImage3D(disp, glCopyTexSubImage3D);
+- SET_CullFace(disp, glCullFace);
+- SET_DeleteLists(disp, glDeleteLists);
+- SET_DeleteTextures(disp, glDeleteTextures);
+- SET_DepthFunc(disp, glDepthFunc);
+- SET_DepthMask(disp, glDepthMask);
+- SET_DepthRange(disp, glDepthRange);
+- SET_Disable(disp, glDisable);
+- SET_DisableClientState(disp, glDisableClientState);
+- SET_DrawArrays(disp, glDrawArrays);
+- SET_DrawBuffer(disp, glDrawBuffer);
+- SET_DrawElements(disp, glDrawElements);
+- SET_DrawPixels(disp, glDrawPixels);
+- SET_DrawRangeElements(disp, glDrawRangeElements);
+- SET_EdgeFlag(disp, glEdgeFlag);
+- SET_EdgeFlagPointer(disp, glEdgeFlagPointer);
+- SET_EdgeFlagv(disp, glEdgeFlagv);
+- SET_Enable(disp, glEnable);
+- SET_EnableClientState(disp, glEnableClientState);
+- SET_End(disp, glEnd);
+- SET_EndList(disp, glEndList);
+- SET_EvalCoord1d(disp, glEvalCoord1d);
+- SET_EvalCoord1dv(disp, glEvalCoord1dv);
+- SET_EvalCoord1f(disp, glEvalCoord1f);
+- SET_EvalCoord1fv(disp, glEvalCoord1fv);
+- SET_EvalCoord2d(disp, glEvalCoord2d);
+- SET_EvalCoord2dv(disp, glEvalCoord2dv);
+- SET_EvalCoord2f(disp, glEvalCoord2f);
+- SET_EvalCoord2fv(disp, glEvalCoord2fv);
+- SET_EvalMesh1(disp, glEvalMesh1);
+- SET_EvalMesh2(disp, glEvalMesh2);
+- SET_EvalPoint1(disp, glEvalPoint1);
+- SET_EvalPoint2(disp, glEvalPoint2);
+- SET_FeedbackBuffer(disp, glFeedbackBuffer);
+- SET_Finish(disp, glFinish);
+- SET_Flush(disp, glFlush);
+- SET_Fogf(disp, glFogf);
+- SET_Fogfv(disp, glFogfv);
+- SET_Fogi(disp, glFogi);
+- SET_Fogiv(disp, glFogiv);
+- SET_FrontFace(disp, glFrontFace);
+- SET_Frustum(disp, glFrustum);
+- SET_GenLists(disp, glGenLists);
+- SET_GenTextures(disp, glGenTextures);
+- SET_GetBooleanv(disp, glGetBooleanv);
+- SET_GetClipPlane(disp, glGetClipPlane);
+- SET_GetColorTable(disp, glGetColorTable);
+- SET_GetColorTableParameterfv(disp, glGetColorTableParameterfv);
+- SET_GetColorTableParameteriv(disp, glGetColorTableParameteriv);
+- SET_GetConvolutionFilter(disp, glGetConvolutionFilter);
+- SET_GetConvolutionParameterfv(disp, glGetConvolutionParameterfv);
+- SET_GetConvolutionParameteriv(disp, glGetConvolutionParameteriv);
+- SET_GetDoublev(disp, glGetDoublev);
+- SET_GetError(disp, glGetError);
+- SET_GetFloatv(disp, glGetFloatv);
+- SET_GetHistogram(disp, glGetHistogram);
+- SET_GetHistogramParameterfv(disp, glGetHistogramParameterfv);
+- SET_GetHistogramParameteriv(disp, glGetHistogramParameteriv);
+- SET_GetIntegerv(disp, glGetIntegerv);
+- SET_GetLightfv(disp, glGetLightfv);
+- SET_GetLightiv(disp, glGetLightiv);
+- SET_GetMapdv(disp, glGetMapdv);
+- SET_GetMapfv(disp, glGetMapfv);
+- SET_GetMapiv(disp, glGetMapiv);
+- SET_GetMaterialfv(disp, glGetMaterialfv);
+- SET_GetMaterialiv(disp, glGetMaterialiv);
+- SET_GetMinmax(disp, glGetMinmax);
+- SET_GetMinmaxParameterfv(disp, glGetMinmaxParameterfv);
+- SET_GetMinmaxParameteriv(disp, glGetMinmaxParameteriv);
+- SET_GetPixelMapfv(disp, glGetPixelMapfv);
+- SET_GetPixelMapuiv(disp, glGetPixelMapuiv);
+- SET_GetPixelMapusv(disp, glGetPixelMapusv);
+- SET_GetPointerv(disp, glGetPointerv);
+- SET_GetPolygonStipple(disp, glGetPolygonStipple);
+- SET_GetSeparableFilter(disp, glGetSeparableFilter);
+- SET_GetString(disp, glGetString);
+- SET_GetTexEnvfv(disp, glGetTexEnvfv);
+- SET_GetTexEnviv(disp, glGetTexEnviv);
+- SET_GetTexGendv(disp, glGetTexGendv);
+- SET_GetTexGenfv(disp, glGetTexGenfv);
+- SET_GetTexGeniv(disp, glGetTexGeniv);
+- SET_GetTexImage(disp, glGetTexImage);
+- SET_GetTexLevelParameterfv(disp, glGetTexLevelParameterfv);
+- SET_GetTexLevelParameteriv(disp, glGetTexLevelParameteriv);
+- SET_GetTexParameterfv(disp, glGetTexParameterfv);
+- SET_GetTexParameteriv(disp, glGetTexParameteriv);
+- SET_Hint(disp, glHint);
+- SET_Histogram(disp, glHistogram);
+- SET_IndexMask(disp, glIndexMask);
+- SET_IndexPointer(disp, glIndexPointer);
+- SET_Indexd(disp, glIndexd);
+- SET_Indexdv(disp, glIndexdv);
+- SET_Indexf(disp, glIndexf);
+- SET_Indexfv(disp, glIndexfv);
+- SET_Indexi(disp, glIndexi);
+- SET_Indexiv(disp, glIndexiv);
+- SET_Indexs(disp, glIndexs);
+- SET_Indexsv(disp, glIndexsv);
+- SET_Indexub(disp, glIndexub);
+- SET_Indexubv(disp, glIndexubv);
+- SET_InitNames(disp, glInitNames);
+- SET_InterleavedArrays(disp, glInterleavedArrays);
+- SET_IsEnabled(disp, glIsEnabled);
+- SET_IsList(disp, glIsList);
+- SET_IsTexture(disp, glIsTexture);
+- SET_LightModelf(disp, glLightModelf);
+- SET_LightModelfv(disp, glLightModelfv);
+- SET_LightModeli(disp, glLightModeli);
+- SET_LightModeliv(disp, glLightModeliv);
+- SET_Lightf(disp, glLightf);
+- SET_Lightfv(disp, glLightfv);
+- SET_Lighti(disp, glLighti);
+- SET_Lightiv(disp, glLightiv);
+- SET_LineStipple(disp, glLineStipple);
+- SET_LineWidth(disp, glLineWidth);
+- SET_ListBase(disp, glListBase);
+- SET_LoadIdentity(disp, glLoadIdentity);
+- SET_LoadMatrixd(disp, glLoadMatrixd);
+- SET_LoadMatrixf(disp, glLoadMatrixf);
+- SET_LoadName(disp, glLoadName);
+- SET_LogicOp(disp, glLogicOp);
+- SET_Map1d(disp, glMap1d);
+- SET_Map1f(disp, glMap1f);
+- SET_Map2d(disp, glMap2d);
+- SET_Map2f(disp, glMap2f);
+- SET_MapGrid1d(disp, glMapGrid1d);
+- SET_MapGrid1f(disp, glMapGrid1f);
+- SET_MapGrid2d(disp, glMapGrid2d);
+- SET_MapGrid2f(disp, glMapGrid2f);
+- SET_Materialf(disp, glMaterialf);
+- SET_Materialfv(disp, glMaterialfv);
+- SET_Materiali(disp, glMateriali);
+- SET_Materialiv(disp, glMaterialiv);
+- SET_MatrixMode(disp, glMatrixMode);
+- SET_Minmax(disp, glMinmax);
+- SET_MultMatrixd(disp, glMultMatrixd);
+- SET_MultMatrixf(disp, glMultMatrixf);
+- SET_NewList(disp, glNewList);
+- SET_Normal3b(disp, glNormal3b);
+- SET_Normal3bv(disp, glNormal3bv);
+- SET_Normal3d(disp, glNormal3d);
+- SET_Normal3dv(disp, glNormal3dv);
+- SET_Normal3f(disp, glNormal3f);
+- SET_Normal3fv(disp, glNormal3fv);
+- SET_Normal3i(disp, glNormal3i);
+- SET_Normal3iv(disp, glNormal3iv);
+- SET_Normal3s(disp, glNormal3s);
+- SET_Normal3sv(disp, glNormal3sv);
+- SET_NormalPointer(disp, glNormalPointer);
+- SET_Ortho(disp, glOrtho);
+- SET_PassThrough(disp, glPassThrough);
+- SET_PixelMapfv(disp, glPixelMapfv);
+- SET_PixelMapuiv(disp, glPixelMapuiv);
+- SET_PixelMapusv(disp, glPixelMapusv);
+- SET_PixelStoref(disp, glPixelStoref);
+- SET_PixelStorei(disp, glPixelStorei);
+- SET_PixelTransferf(disp, glPixelTransferf);
+- SET_PixelTransferi(disp, glPixelTransferi);
+- SET_PixelZoom(disp, glPixelZoom);
+- SET_PointSize(disp, glPointSize);
+- SET_PolygonMode(disp, glPolygonMode);
+- SET_PolygonOffset(disp, glPolygonOffset);
+- SET_PolygonStipple(disp, glPolygonStipple);
+- SET_PopAttrib(disp, glPopAttrib);
+- SET_PopClientAttrib(disp, glPopClientAttrib);
+- SET_PopMatrix(disp, glPopMatrix);
+- SET_PopName(disp, glPopName);
+- SET_PrioritizeTextures(disp, glPrioritizeTextures);
+- SET_PushAttrib(disp, glPushAttrib);
+- SET_PushClientAttrib(disp, glPushClientAttrib);
+- SET_PushMatrix(disp, glPushMatrix);
+- SET_PushName(disp, glPushName);
+- SET_RasterPos2d(disp, glRasterPos2d);
+- SET_RasterPos2dv(disp, glRasterPos2dv);
+- SET_RasterPos2f(disp, glRasterPos2f);
+- SET_RasterPos2fv(disp, glRasterPos2fv);
+- SET_RasterPos2i(disp, glRasterPos2i);
+- SET_RasterPos2iv(disp, glRasterPos2iv);
+- SET_RasterPos2s(disp, glRasterPos2s);
+- SET_RasterPos2sv(disp, glRasterPos2sv);
+- SET_RasterPos3d(disp, glRasterPos3d);
+- SET_RasterPos3dv(disp, glRasterPos3dv);
+- SET_RasterPos3f(disp, glRasterPos3f);
+- SET_RasterPos3fv(disp, glRasterPos3fv);
+- SET_RasterPos3i(disp, glRasterPos3i);
+- SET_RasterPos3iv(disp, glRasterPos3iv);
+- SET_RasterPos3s(disp, glRasterPos3s);
+- SET_RasterPos3sv(disp, glRasterPos3sv);
+- SET_RasterPos4d(disp, glRasterPos4d);
+- SET_RasterPos4dv(disp, glRasterPos4dv);
+- SET_RasterPos4f(disp, glRasterPos4f);
+- SET_RasterPos4fv(disp, glRasterPos4fv);
+- SET_RasterPos4i(disp, glRasterPos4i);
+- SET_RasterPos4iv(disp, glRasterPos4iv);
+- SET_RasterPos4s(disp, glRasterPos4s);
+- SET_RasterPos4sv(disp, glRasterPos4sv);
+- SET_ReadBuffer(disp, glReadBuffer);
+- SET_ReadPixels(disp, glReadPixels);
+- SET_Rectd(disp, glRectd);
+- SET_Rectdv(disp, glRectdv);
+- SET_Rectf(disp, glRectf);
+- SET_Rectfv(disp, glRectfv);
+- SET_Recti(disp, glRecti);
+- SET_Rectiv(disp, glRectiv);
+- SET_Rects(disp, glRects);
+- SET_Rectsv(disp, glRectsv);
+- SET_RenderMode(disp, glRenderMode);
+- SET_ResetHistogram(disp, glResetHistogram);
+- SET_ResetMinmax(disp, glResetMinmax);
+- SET_Rotated(disp, glRotated);
+- SET_Rotatef(disp, glRotatef);
+- SET_Scaled(disp, glScaled);
+- SET_Scalef(disp, glScalef);
+- SET_Scissor(disp, glScissor);
+- SET_SelectBuffer(disp, glSelectBuffer);
+- SET_SeparableFilter2D(disp, glSeparableFilter2D);
+- SET_ShadeModel(disp, glShadeModel);
+- SET_StencilFunc(disp, glStencilFunc);
+- SET_StencilMask(disp, glStencilMask);
+- SET_StencilOp(disp, glStencilOp);
+- SET_TexCoord1d(disp, glTexCoord1d);
+- SET_TexCoord1dv(disp, glTexCoord1dv);
+- SET_TexCoord1f(disp, glTexCoord1f);
+- SET_TexCoord1fv(disp, glTexCoord1fv);
+- SET_TexCoord1i(disp, glTexCoord1i);
+- SET_TexCoord1iv(disp, glTexCoord1iv);
+- SET_TexCoord1s(disp, glTexCoord1s);
+- SET_TexCoord1sv(disp, glTexCoord1sv);
+- SET_TexCoord2d(disp, glTexCoord2d);
+- SET_TexCoord2dv(disp, glTexCoord2dv);
+- SET_TexCoord2f(disp, glTexCoord2f);
+- SET_TexCoord2fv(disp, glTexCoord2fv);
+- SET_TexCoord2i(disp, glTexCoord2i);
+- SET_TexCoord2iv(disp, glTexCoord2iv);
+- SET_TexCoord2s(disp, glTexCoord2s);
+- SET_TexCoord2sv(disp, glTexCoord2sv);
+- SET_TexCoord3d(disp, glTexCoord3d);
+- SET_TexCoord3dv(disp, glTexCoord3dv);
+- SET_TexCoord3f(disp, glTexCoord3f);
+- SET_TexCoord3fv(disp, glTexCoord3fv);
+- SET_TexCoord3i(disp, glTexCoord3i);
+- SET_TexCoord3iv(disp, glTexCoord3iv);
+- SET_TexCoord3s(disp, glTexCoord3s);
+- SET_TexCoord3sv(disp, glTexCoord3sv);
+- SET_TexCoord4d(disp, glTexCoord4d);
+- SET_TexCoord4dv(disp, glTexCoord4dv);
+- SET_TexCoord4f(disp, glTexCoord4f);
+- SET_TexCoord4fv(disp, glTexCoord4fv);
+- SET_TexCoord4i(disp, glTexCoord4i);
+- SET_TexCoord4iv(disp, glTexCoord4iv);
+- SET_TexCoord4s(disp, glTexCoord4s);
+- SET_TexCoord4sv(disp, glTexCoord4sv);
+- SET_TexCoordPointer(disp, glTexCoordPointer);
+- SET_TexEnvf(disp, glTexEnvf);
+- SET_TexEnvfv(disp, glTexEnvfv);
+- SET_TexEnvi(disp, glTexEnvi);
+- SET_TexEnviv(disp, glTexEnviv);
+- SET_TexGend(disp, glTexGend);
+- SET_TexGendv(disp, glTexGendv);
+- SET_TexGenf(disp, glTexGenf);
+- SET_TexGenfv(disp, glTexGenfv);
+- SET_TexGeni(disp, glTexGeni);
+- SET_TexGeniv(disp, glTexGeniv);
++ SET_Accum(disp, dlsym(RTLD_DEFAULT, "glAccum"));
++ SET_AlphaFunc(disp, dlsym(RTLD_DEFAULT, "glAlphaFunc"));
++ SET_AreTexturesResident(disp, dlsym(RTLD_DEFAULT, "glAreTexturesResident"));
++ SET_ArrayElement(disp, dlsym(RTLD_DEFAULT, "glArrayElement"));
++ SET_Begin(disp, dlsym(RTLD_DEFAULT, "glBegin"));
++ SET_BindTexture(disp, dlsym(RTLD_DEFAULT, "glBindTexture"));
++ SET_Bitmap(disp, dlsym(RTLD_DEFAULT, "glBitmap"));
++ SET_BlendColor(disp, dlsym(RTLD_DEFAULT, "glBlendColor"));
++ SET_BlendEquation(disp, dlsym(RTLD_DEFAULT, "glBlendEquation"));
++ SET_BlendFunc(disp, dlsym(RTLD_DEFAULT, "glBlendFunc"));
++ SET_CallList(disp, dlsym(RTLD_DEFAULT, "glCallList"));
++ SET_CallLists(disp, dlsym(RTLD_DEFAULT, "glCallLists"));
++ SET_Clear(disp, dlsym(RTLD_DEFAULT, "glClear"));
++ SET_ClearAccum(disp, dlsym(RTLD_DEFAULT, "glClearAccum"));
++ SET_ClearColor(disp, dlsym(RTLD_DEFAULT, "glClearColor"));
++ SET_ClearDepth(disp, dlsym(RTLD_DEFAULT, "glClearDepth"));
++ SET_ClearIndex(disp, dlsym(RTLD_DEFAULT, "glClearIndex"));
++ SET_ClearStencil(disp, dlsym(RTLD_DEFAULT, "glClearStencil"));
++ SET_ClipPlane(disp, dlsym(RTLD_DEFAULT, "glClipPlane"));
++ SET_Color3b(disp, dlsym(RTLD_DEFAULT, "glColor3b"));
++ SET_Color3bv(disp, dlsym(RTLD_DEFAULT, "glColor3bv"));
++ SET_Color3d(disp, dlsym(RTLD_DEFAULT, "glColor3d"));
++ SET_Color3dv(disp, dlsym(RTLD_DEFAULT, "glColor3dv"));
++ SET_Color3f(disp, dlsym(RTLD_DEFAULT, "glColor3f"));
++ SET_Color3fv(disp, dlsym(RTLD_DEFAULT, "glColor3fv"));
++ SET_Color3i(disp, dlsym(RTLD_DEFAULT, "glColor3i"));
++ SET_Color3iv(disp, dlsym(RTLD_DEFAULT, "glColor3iv"));
++ SET_Color3s(disp, dlsym(RTLD_DEFAULT, "glColor3s"));
++ SET_Color3sv(disp, dlsym(RTLD_DEFAULT, "glColor3sv"));
++ SET_Color3ub(disp, dlsym(RTLD_DEFAULT, "glColor3ub"));
++ SET_Color3ubv(disp, dlsym(RTLD_DEFAULT, "glColor3ubv"));
++ SET_Color3ui(disp, dlsym(RTLD_DEFAULT, "glColor3ui"));
++ SET_Color3uiv(disp, dlsym(RTLD_DEFAULT, "glColor3uiv"));
++ SET_Color3us(disp, dlsym(RTLD_DEFAULT, "glColor3us"));
++ SET_Color3usv(disp, dlsym(RTLD_DEFAULT, "glColor3usv"));
++ SET_Color4b(disp, dlsym(RTLD_DEFAULT, "glColor4b"));
++ SET_Color4bv(disp, dlsym(RTLD_DEFAULT, "glColor4bv"));
++ SET_Color4d(disp, dlsym(RTLD_DEFAULT, "glColor4d"));
++ SET_Color4dv(disp, dlsym(RTLD_DEFAULT, "glColor4dv"));
++ SET_Color4f(disp, dlsym(RTLD_DEFAULT, "glColor4f"));
++ SET_Color4fv(disp, dlsym(RTLD_DEFAULT, "glColor4fv"));
++ SET_Color4i(disp, dlsym(RTLD_DEFAULT, "glColor4i"));
++ SET_Color4iv(disp, dlsym(RTLD_DEFAULT, "glColor4iv"));
++ SET_Color4s(disp, dlsym(RTLD_DEFAULT, "glColor4s"));
++ SET_Color4sv(disp, dlsym(RTLD_DEFAULT, "glColor4sv"));
++ SET_Color4ub(disp, dlsym(RTLD_DEFAULT, "glColor4ub"));
++ SET_Color4ubv(disp, dlsym(RTLD_DEFAULT, "glColor4ubv"));
++ SET_Color4ui(disp, dlsym(RTLD_DEFAULT, "glColor4ui"));
++ SET_Color4uiv(disp, dlsym(RTLD_DEFAULT, "glColor4uiv"));
++ SET_Color4us(disp, dlsym(RTLD_DEFAULT, "glColor4us"));
++ SET_Color4usv(disp, dlsym(RTLD_DEFAULT, "glColor4usv"));
++ SET_ColorMask(disp, dlsym(RTLD_DEFAULT, "glColorMask"));
++ SET_ColorMaterial(disp, dlsym(RTLD_DEFAULT, "glColorMaterial"));
++ SET_ColorPointer(disp, dlsym(RTLD_DEFAULT, "glColorPointer"));
++ SET_ColorSubTable(disp, dlsym(RTLD_DEFAULT, "glColorSubTable"));
++ SET_ColorTable(disp, dlsym(RTLD_DEFAULT, "glColorTable"));
++ SET_ColorTableParameterfv(disp, dlsym(RTLD_DEFAULT, "glColorTableParameterfv"));
++ SET_ColorTableParameteriv(disp, dlsym(RTLD_DEFAULT, "glColorTableParameteriv"));
++ SET_ConvolutionFilter1D(disp, dlsym(RTLD_DEFAULT, "glConvolutionFilter1D"));
++ SET_ConvolutionFilter2D(disp, dlsym(RTLD_DEFAULT, "glConvolutionFilter2D"));
++ SET_ConvolutionParameterf(disp, dlsym(RTLD_DEFAULT, "glConvolutionParameterf"));
++ SET_ConvolutionParameterfv(disp, dlsym(RTLD_DEFAULT, "glConvolutionParameterfv"));
++ SET_ConvolutionParameteri(disp, dlsym(RTLD_DEFAULT, "glConvolutionParameteri"));
++ SET_ConvolutionParameteriv(disp, dlsym(RTLD_DEFAULT, "glConvolutionParameteriv"));
++ SET_CopyColorSubTable(disp, dlsym(RTLD_DEFAULT, "glCopyColorSubTable"));
++ SET_CopyColorTable(disp, dlsym(RTLD_DEFAULT, "glCopyColorTable"));
++ SET_CopyConvolutionFilter1D(disp, dlsym(RTLD_DEFAULT, "glCopyConvolutionFilter1D"));
++ SET_CopyConvolutionFilter2D(disp, dlsym(RTLD_DEFAULT, "glCopyConvolutionFilter2D"));
++ SET_CopyPixels(disp, dlsym(RTLD_DEFAULT, "glCopyPixels"));
++ SET_CopyTexImage1D(disp, dlsym(RTLD_DEFAULT, "glCopyTexImage1D"));
++ SET_CopyTexImage2D(disp, dlsym(RTLD_DEFAULT, "glCopyTexImage2D"));
++ SET_CopyTexSubImage1D(disp, dlsym(RTLD_DEFAULT, "glCopyTexSubImage1D"));
++ SET_CopyTexSubImage2D(disp, dlsym(RTLD_DEFAULT, "glCopyTexSubImage2D"));
++ SET_CopyTexSubImage3D(disp, dlsym(RTLD_DEFAULT, "glCopyTexSubImage3D"));
++ SET_CullFace(disp, dlsym(RTLD_DEFAULT, "glCullFace"));
++ SET_DeleteLists(disp, dlsym(RTLD_DEFAULT, "glDeleteLists"));
++ SET_DeleteTextures(disp, dlsym(RTLD_DEFAULT, "glDeleteTextures"));
++ SET_DepthFunc(disp, dlsym(RTLD_DEFAULT, "glDepthFunc"));
++ SET_DepthMask(disp, dlsym(RTLD_DEFAULT, "glDepthMask"));
++ SET_DepthRange(disp, dlsym(RTLD_DEFAULT, "glDepthRange"));
++ SET_Disable(disp, dlsym(RTLD_DEFAULT, "glDisable"));
++ SET_DisableClientState(disp, dlsym(RTLD_DEFAULT, "glDisableClientState"));
++ SET_DrawArrays(disp, dlsym(RTLD_DEFAULT, "glDrawArrays"));
++ SET_DrawBuffer(disp, dlsym(RTLD_DEFAULT, "glDrawBuffer"));
++ SET_DrawElements(disp, dlsym(RTLD_DEFAULT, "glDrawElements"));
++ SET_DrawPixels(disp, dlsym(RTLD_DEFAULT, "glDrawPixels"));
++ SET_DrawRangeElements(disp, dlsym(RTLD_DEFAULT, "glDrawRangeElements"));
++ SET_EdgeFlag(disp, dlsym(RTLD_DEFAULT, "glEdgeFlag"));
++ SET_EdgeFlagPointer(disp, dlsym(RTLD_DEFAULT, "glEdgeFlagPointer"));
++ SET_EdgeFlagv(disp, dlsym(RTLD_DEFAULT, "glEdgeFlagv"));
++ SET_Enable(disp, dlsym(RTLD_DEFAULT, "glEnable"));
++ SET_EnableClientState(disp, dlsym(RTLD_DEFAULT, "glEnableClientState"));
++ SET_End(disp, dlsym(RTLD_DEFAULT, "glEnd"));
++ SET_EndList(disp, dlsym(RTLD_DEFAULT, "glEndList"));
++ SET_EvalCoord1d(disp, dlsym(RTLD_DEFAULT, "glEvalCoord1d"));
++ SET_EvalCoord1dv(disp, dlsym(RTLD_DEFAULT, "glEvalCoord1dv"));
++ SET_EvalCoord1f(disp, dlsym(RTLD_DEFAULT, "glEvalCoord1f"));
++ SET_EvalCoord1fv(disp, dlsym(RTLD_DEFAULT, "glEvalCoord1fv"));
++ SET_EvalCoord2d(disp, dlsym(RTLD_DEFAULT, "glEvalCoord2d"));
++ SET_EvalCoord2dv(disp, dlsym(RTLD_DEFAULT, "glEvalCoord2dv"));
++ SET_EvalCoord2f(disp, dlsym(RTLD_DEFAULT, "glEvalCoord2f"));
++ SET_EvalCoord2fv(disp, dlsym(RTLD_DEFAULT, "glEvalCoord2fv"));
++ SET_EvalMesh1(disp, dlsym(RTLD_DEFAULT, "glEvalMesh1"));
++ SET_EvalMesh2(disp, dlsym(RTLD_DEFAULT, "glEvalMesh2"));
++ SET_EvalPoint1(disp, dlsym(RTLD_DEFAULT, "glEvalPoint1"));
++ SET_EvalPoint2(disp, dlsym(RTLD_DEFAULT, "glEvalPoint2"));
++ SET_FeedbackBuffer(disp, dlsym(RTLD_DEFAULT, "glFeedbackBuffer"));
++ SET_Finish(disp, dlsym(RTLD_DEFAULT, "glFinish"));
++ SET_Flush(disp, dlsym(RTLD_DEFAULT, "glFlush"));
++ SET_Fogf(disp, dlsym(RTLD_DEFAULT, "glFogf"));
++ SET_Fogfv(disp, dlsym(RTLD_DEFAULT, "glFogfv"));
++ SET_Fogi(disp, dlsym(RTLD_DEFAULT, "glFogi"));
++ SET_Fogiv(disp, dlsym(RTLD_DEFAULT, "glFogiv"));
++ SET_FrontFace(disp, dlsym(RTLD_DEFAULT, "glFrontFace"));
++ SET_Frustum(disp, dlsym(RTLD_DEFAULT, "glFrustum"));
++ SET_GenLists(disp, dlsym(RTLD_DEFAULT, "glGenLists"));
++ SET_GenTextures(disp, dlsym(RTLD_DEFAULT, "glGenTextures"));
++ SET_GetBooleanv(disp, dlsym(RTLD_DEFAULT, "glGetBooleanv"));
++ SET_GetClipPlane(disp, dlsym(RTLD_DEFAULT, "glGetClipPlane"));
++ SET_GetColorTable(disp, dlsym(RTLD_DEFAULT, "glGetColorTable"));
++ SET_GetColorTableParameterfv(disp, dlsym(RTLD_DEFAULT, "glGetColorTableParameterfv"));
++ SET_GetColorTableParameteriv(disp, dlsym(RTLD_DEFAULT, "glGetColorTableParameteriv"));
++ SET_GetConvolutionFilter(disp, dlsym(RTLD_DEFAULT, "glGetConvolutionFilter"));
++ SET_GetConvolutionParameterfv(disp, dlsym(RTLD_DEFAULT, "glGetConvolutionParameterfv"));
++ SET_GetConvolutionParameteriv(disp, dlsym(RTLD_DEFAULT, "glGetConvolutionParameteriv"));
++ SET_GetDoublev(disp, dlsym(RTLD_DEFAULT, "glGetDoublev"));
++ SET_GetError(disp, dlsym(RTLD_DEFAULT, "glGetError"));
++ SET_GetFloatv(disp, dlsym(RTLD_DEFAULT, "glGetFloatv"));
++ SET_GetHistogram(disp, dlsym(RTLD_DEFAULT, "glGetHistogram"));
++ SET_GetHistogramParameterfv(disp, dlsym(RTLD_DEFAULT, "glGetHistogramParameterfv"));
++ SET_GetHistogramParameteriv(disp, dlsym(RTLD_DEFAULT, "glGetHistogramParameteriv"));
++ SET_GetIntegerv(disp, dlsym(RTLD_DEFAULT, "glGetIntegerv"));
++ SET_GetLightfv(disp, dlsym(RTLD_DEFAULT, "glGetLightfv"));
++ SET_GetLightiv(disp, dlsym(RTLD_DEFAULT, "glGetLightiv"));
++ SET_GetMapdv(disp, dlsym(RTLD_DEFAULT, "glGetMapdv"));
++ SET_GetMapfv(disp, dlsym(RTLD_DEFAULT, "glGetMapfv"));
++ SET_GetMapiv(disp, dlsym(RTLD_DEFAULT, "glGetMapiv"));
++ SET_GetMaterialfv(disp, dlsym(RTLD_DEFAULT, "glGetMaterialfv"));
++ SET_GetMaterialiv(disp, dlsym(RTLD_DEFAULT, "glGetMaterialiv"));
++ SET_GetMinmax(disp, dlsym(RTLD_DEFAULT, "glGetMinmax"));
++ SET_GetMinmaxParameterfv(disp, dlsym(RTLD_DEFAULT, "glGetMinmaxParameterfv"));
++ SET_GetMinmaxParameteriv(disp, dlsym(RTLD_DEFAULT, "glGetMinmaxParameteriv"));
++ SET_GetPixelMapfv(disp, dlsym(RTLD_DEFAULT, "glGetPixelMapfv"));
++ SET_GetPixelMapuiv(disp, dlsym(RTLD_DEFAULT, "glGetPixelMapuiv"));
++ SET_GetPixelMapusv(disp, dlsym(RTLD_DEFAULT, "glGetPixelMapusv"));
++ SET_GetPointerv(disp, dlsym(RTLD_DEFAULT, "glGetPointerv"));
++ SET_GetPolygonStipple(disp, dlsym(RTLD_DEFAULT, "glGetPolygonStipple"));
++ SET_GetSeparableFilter(disp, dlsym(RTLD_DEFAULT, "glGetSeparableFilter"));
++ SET_GetString(disp, dlsym(RTLD_DEFAULT, "glGetString"));
++ SET_GetTexEnvfv(disp, dlsym(RTLD_DEFAULT, "glGetTexEnvfv"));
++ SET_GetTexEnviv(disp, dlsym(RTLD_DEFAULT, "glGetTexEnviv"));
++ SET_GetTexGendv(disp, dlsym(RTLD_DEFAULT, "glGetTexGendv"));
++ SET_GetTexGenfv(disp, dlsym(RTLD_DEFAULT, "glGetTexGenfv"));
++ SET_GetTexGeniv(disp, dlsym(RTLD_DEFAULT, "glGetTexGeniv"));
++ SET_GetTexImage(disp, dlsym(RTLD_DEFAULT, "glGetTexImage"));
++ SET_GetTexLevelParameterfv(disp, dlsym(RTLD_DEFAULT, "glGetTexLevelParameterfv"));
++ SET_GetTexLevelParameteriv(disp, dlsym(RTLD_DEFAULT, "glGetTexLevelParameteriv"));
++ SET_GetTexParameterfv(disp, dlsym(RTLD_DEFAULT, "glGetTexParameterfv"));
++ SET_GetTexParameteriv(disp, dlsym(RTLD_DEFAULT, "glGetTexParameteriv"));
++ SET_Hint(disp, dlsym(RTLD_DEFAULT, "glHint"));
++ SET_Histogram(disp, dlsym(RTLD_DEFAULT, "glHistogram"));
++ SET_IndexMask(disp, dlsym(RTLD_DEFAULT, "glIndexMask"));
++ SET_IndexPointer(disp, dlsym(RTLD_DEFAULT, "glIndexPointer"));
++ SET_Indexd(disp, dlsym(RTLD_DEFAULT, "glIndexd"));
++ SET_Indexdv(disp, dlsym(RTLD_DEFAULT, "glIndexdv"));
++ SET_Indexf(disp, dlsym(RTLD_DEFAULT, "glIndexf"));
++ SET_Indexfv(disp, dlsym(RTLD_DEFAULT, "glIndexfv"));
++ SET_Indexi(disp, dlsym(RTLD_DEFAULT, "glIndexi"));
++ SET_Indexiv(disp, dlsym(RTLD_DEFAULT, "glIndexiv"));
++ SET_Indexs(disp, dlsym(RTLD_DEFAULT, "glIndexs"));
++ SET_Indexsv(disp, dlsym(RTLD_DEFAULT, "glIndexsv"));
++ SET_Indexub(disp, dlsym(RTLD_DEFAULT, "glIndexub"));
++ SET_Indexubv(disp, dlsym(RTLD_DEFAULT, "glIndexubv"));
++ SET_InitNames(disp, dlsym(RTLD_DEFAULT, "glInitNames"));
++ SET_InterleavedArrays(disp, dlsym(RTLD_DEFAULT, "glInterleavedArrays"));
++ SET_IsEnabled(disp, dlsym(RTLD_DEFAULT, "glIsEnabled"));
++ SET_IsList(disp, dlsym(RTLD_DEFAULT, "glIsList"));
++ SET_IsTexture(disp, dlsym(RTLD_DEFAULT, "glIsTexture"));
++ SET_LightModelf(disp, dlsym(RTLD_DEFAULT, "glLightModelf"));
++ SET_LightModelfv(disp, dlsym(RTLD_DEFAULT, "glLightModelfv"));
++ SET_LightModeli(disp, dlsym(RTLD_DEFAULT, "glLightModeli"));
++ SET_LightModeliv(disp, dlsym(RTLD_DEFAULT, "glLightModeliv"));
++ SET_Lightf(disp, dlsym(RTLD_DEFAULT, "glLightf"));
++ SET_Lightfv(disp, dlsym(RTLD_DEFAULT, "glLightfv"));
++ SET_Lighti(disp, dlsym(RTLD_DEFAULT, "glLighti"));
++ SET_Lightiv(disp, dlsym(RTLD_DEFAULT, "glLightiv"));
++ SET_LineStipple(disp, dlsym(RTLD_DEFAULT, "glLineStipple"));
++ SET_LineWidth(disp, dlsym(RTLD_DEFAULT, "glLineWidth"));
++ SET_ListBase(disp, dlsym(RTLD_DEFAULT, "glListBase"));
++ SET_LoadIdentity(disp, dlsym(RTLD_DEFAULT, "glLoadIdentity"));
++ SET_LoadMatrixd(disp, dlsym(RTLD_DEFAULT, "glLoadMatrixd"));
++ SET_LoadMatrixf(disp, dlsym(RTLD_DEFAULT, "glLoadMatrixf"));
++ SET_LoadName(disp, dlsym(RTLD_DEFAULT, "glLoadName"));
++ SET_LogicOp(disp, dlsym(RTLD_DEFAULT, "glLogicOp"));
++ SET_Map1d(disp, dlsym(RTLD_DEFAULT, "glMap1d"));
++ SET_Map1f(disp, dlsym(RTLD_DEFAULT, "glMap1f"));
++ SET_Map2d(disp, dlsym(RTLD_DEFAULT, "glMap2d"));
++ SET_Map2f(disp, dlsym(RTLD_DEFAULT, "glMap2f"));
++ SET_MapGrid1d(disp, dlsym(RTLD_DEFAULT, "glMapGrid1d"));
++ SET_MapGrid1f(disp, dlsym(RTLD_DEFAULT, "glMapGrid1f"));
++ SET_MapGrid2d(disp, dlsym(RTLD_DEFAULT, "glMapGrid2d"));
++ SET_MapGrid2f(disp, dlsym(RTLD_DEFAULT, "glMapGrid2f"));
++ SET_Materialf(disp, dlsym(RTLD_DEFAULT, "glMaterialf"));
++ SET_Materialfv(disp, dlsym(RTLD_DEFAULT, "glMaterialfv"));
++ SET_Materiali(disp, dlsym(RTLD_DEFAULT, "glMateriali"));
++ SET_Materialiv(disp, dlsym(RTLD_DEFAULT, "glMaterialiv"));
++ SET_MatrixMode(disp, dlsym(RTLD_DEFAULT, "glMatrixMode"));
++ SET_Minmax(disp, dlsym(RTLD_DEFAULT, "glMinmax"));
++ SET_MultMatrixd(disp, dlsym(RTLD_DEFAULT, "glMultMatrixd"));
++ SET_MultMatrixf(disp, dlsym(RTLD_DEFAULT, "glMultMatrixf"));
++ SET_NewList(disp, dlsym(RTLD_DEFAULT, "glNewList"));
++ SET_Normal3b(disp, dlsym(RTLD_DEFAULT, "glNormal3b"));
++ SET_Normal3bv(disp, dlsym(RTLD_DEFAULT, "glNormal3bv"));
++ SET_Normal3d(disp, dlsym(RTLD_DEFAULT, "glNormal3d"));
++ SET_Normal3dv(disp, dlsym(RTLD_DEFAULT, "glNormal3dv"));
++ SET_Normal3f(disp, dlsym(RTLD_DEFAULT, "glNormal3f"));
++ SET_Normal3fv(disp, dlsym(RTLD_DEFAULT, "glNormal3fv"));
++ SET_Normal3i(disp, dlsym(RTLD_DEFAULT, "glNormal3i"));
++ SET_Normal3iv(disp, dlsym(RTLD_DEFAULT, "glNormal3iv"));
++ SET_Normal3s(disp, dlsym(RTLD_DEFAULT, "glNormal3s"));
++ SET_Normal3sv(disp, dlsym(RTLD_DEFAULT, "glNormal3sv"));
++ SET_NormalPointer(disp, dlsym(RTLD_DEFAULT, "glNormalPointer"));
++ SET_Ortho(disp, dlsym(RTLD_DEFAULT, "glOrtho"));
++ SET_PassThrough(disp, dlsym(RTLD_DEFAULT, "glPassThrough"));
++ SET_PixelMapfv(disp, dlsym(RTLD_DEFAULT, "glPixelMapfv"));
++ SET_PixelMapuiv(disp, dlsym(RTLD_DEFAULT, "glPixelMapuiv"));
++ SET_PixelMapusv(disp, dlsym(RTLD_DEFAULT, "glPixelMapusv"));
++ SET_PixelStoref(disp, dlsym(RTLD_DEFAULT, "glPixelStoref"));
++ SET_PixelStorei(disp, dlsym(RTLD_DEFAULT, "glPixelStorei"));
++ SET_PixelTransferf(disp, dlsym(RTLD_DEFAULT, "glPixelTransferf"));
++ SET_PixelTransferi(disp, dlsym(RTLD_DEFAULT, "glPixelTransferi"));
++ SET_PixelZoom(disp, dlsym(RTLD_DEFAULT, "glPixelZoom"));
++ SET_PointSize(disp, dlsym(RTLD_DEFAULT, "glPointSize"));
++ SET_PolygonMode(disp, dlsym(RTLD_DEFAULT, "glPolygonMode"));
++ SET_PolygonOffset(disp, dlsym(RTLD_DEFAULT, "glPolygonOffset"));
++ SET_PolygonStipple(disp, dlsym(RTLD_DEFAULT, "glPolygonStipple"));
++ SET_PopAttrib(disp, dlsym(RTLD_DEFAULT, "glPopAttrib"));
++ SET_PopClientAttrib(disp, dlsym(RTLD_DEFAULT, "glPopClientAttrib"));
++ SET_PopMatrix(disp, dlsym(RTLD_DEFAULT, "glPopMatrix"));
++ SET_PopName(disp, dlsym(RTLD_DEFAULT, "glPopName"));
++ SET_PrioritizeTextures(disp, dlsym(RTLD_DEFAULT, "glPrioritizeTextures"));
++ SET_PushAttrib(disp, dlsym(RTLD_DEFAULT, "glPushAttrib"));
++ SET_PushClientAttrib(disp, dlsym(RTLD_DEFAULT, "glPushClientAttrib"));
++ SET_PushMatrix(disp, dlsym(RTLD_DEFAULT, "glPushMatrix"));
++ SET_PushName(disp, dlsym(RTLD_DEFAULT, "glPushName"));
++ SET_RasterPos2d(disp, dlsym(RTLD_DEFAULT, "glRasterPos2d"));
++ SET_RasterPos2dv(disp, dlsym(RTLD_DEFAULT, "glRasterPos2dv"));
++ SET_RasterPos2f(disp, dlsym(RTLD_DEFAULT, "glRasterPos2f"));
++ SET_RasterPos2fv(disp, dlsym(RTLD_DEFAULT, "glRasterPos2fv"));
++ SET_RasterPos2i(disp, dlsym(RTLD_DEFAULT, "glRasterPos2i"));
++ SET_RasterPos2iv(disp, dlsym(RTLD_DEFAULT, "glRasterPos2iv"));
++ SET_RasterPos2s(disp, dlsym(RTLD_DEFAULT, "glRasterPos2s"));
++ SET_RasterPos2sv(disp, dlsym(RTLD_DEFAULT, "glRasterPos2sv"));
++ SET_RasterPos3d(disp, dlsym(RTLD_DEFAULT, "glRasterPos3d"));
++ SET_RasterPos3dv(disp, dlsym(RTLD_DEFAULT, "glRasterPos3dv"));
++ SET_RasterPos3f(disp, dlsym(RTLD_DEFAULT, "glRasterPos3f"));
++ SET_RasterPos3fv(disp, dlsym(RTLD_DEFAULT, "glRasterPos3fv"));
++ SET_RasterPos3i(disp, dlsym(RTLD_DEFAULT, "glRasterPos3i"));
++ SET_RasterPos3iv(disp, dlsym(RTLD_DEFAULT, "glRasterPos3iv"));
++ SET_RasterPos3s(disp, dlsym(RTLD_DEFAULT, "glRasterPos3s"));
++ SET_RasterPos3sv(disp, dlsym(RTLD_DEFAULT, "glRasterPos3sv"));
++ SET_RasterPos4d(disp, dlsym(RTLD_DEFAULT, "glRasterPos4d"));
++ SET_RasterPos4dv(disp, dlsym(RTLD_DEFAULT, "glRasterPos4dv"));
++ SET_RasterPos4f(disp, dlsym(RTLD_DEFAULT, "glRasterPos4f"));
++ SET_RasterPos4fv(disp, dlsym(RTLD_DEFAULT, "glRasterPos4fv"));
++ SET_RasterPos4i(disp, dlsym(RTLD_DEFAULT, "glRasterPos4i"));
++ SET_RasterPos4iv(disp, dlsym(RTLD_DEFAULT, "glRasterPos4iv"));
++ SET_RasterPos4s(disp, dlsym(RTLD_DEFAULT, "glRasterPos4s"));
++ SET_RasterPos4sv(disp, dlsym(RTLD_DEFAULT, "glRasterPos4sv"));
++ SET_ReadBuffer(disp, dlsym(RTLD_DEFAULT, "glReadBuffer"));
++ SET_ReadPixels(disp, dlsym(RTLD_DEFAULT, "glReadPixels"));
++ SET_Rectd(disp, dlsym(RTLD_DEFAULT, "glRectd"));
++ SET_Rectdv(disp, dlsym(RTLD_DEFAULT, "glRectdv"));
++ SET_Rectf(disp, dlsym(RTLD_DEFAULT, "glRectf"));
++ SET_Rectfv(disp, dlsym(RTLD_DEFAULT, "glRectfv"));
++ SET_Recti(disp, dlsym(RTLD_DEFAULT, "glRecti"));
++ SET_Rectiv(disp, dlsym(RTLD_DEFAULT, "glRectiv"));
++ SET_Rects(disp, dlsym(RTLD_DEFAULT, "glRects"));
++ SET_Rectsv(disp, dlsym(RTLD_DEFAULT, "glRectsv"));
++ SET_RenderMode(disp, dlsym(RTLD_DEFAULT, "glRenderMode"));
++ SET_ResetHistogram(disp, dlsym(RTLD_DEFAULT, "glResetHistogram"));
++ SET_ResetMinmax(disp, dlsym(RTLD_DEFAULT, "glResetMinmax"));
++ SET_Rotated(disp, dlsym(RTLD_DEFAULT, "glRotated"));
++ SET_Rotatef(disp, dlsym(RTLD_DEFAULT, "glRotatef"));
++ SET_Scaled(disp, dlsym(RTLD_DEFAULT, "glScaled"));
++ SET_Scalef(disp, dlsym(RTLD_DEFAULT, "glScalef"));
++ SET_Scissor(disp, dlsym(RTLD_DEFAULT, "glScissor"));
++ SET_SelectBuffer(disp, dlsym(RTLD_DEFAULT, "glSelectBuffer"));
++ SET_SeparableFilter2D(disp, dlsym(RTLD_DEFAULT, "glSeparableFilter2D"));
++ SET_ShadeModel(disp, dlsym(RTLD_DEFAULT, "glShadeModel"));
++ SET_StencilFunc(disp, dlsym(RTLD_DEFAULT, "glStencilFunc"));
++ SET_StencilMask(disp, dlsym(RTLD_DEFAULT, "glStencilMask"));
++ SET_StencilOp(disp, dlsym(RTLD_DEFAULT, "glStencilOp"));
++ SET_TexCoord1d(disp, dlsym(RTLD_DEFAULT, "glTexCoord1d"));
++ SET_TexCoord1dv(disp, dlsym(RTLD_DEFAULT, "glTexCoord1dv"));
++ SET_TexCoord1f(disp, dlsym(RTLD_DEFAULT, "glTexCoord1f"));
++ SET_TexCoord1fv(disp, dlsym(RTLD_DEFAULT, "glTexCoord1fv"));
++ SET_TexCoord1i(disp, dlsym(RTLD_DEFAULT, "glTexCoord1i"));
++ SET_TexCoord1iv(disp, dlsym(RTLD_DEFAULT, "glTexCoord1iv"));
++ SET_TexCoord1s(disp, dlsym(RTLD_DEFAULT, "glTexCoord1s"));
++ SET_TexCoord1sv(disp, dlsym(RTLD_DEFAULT, "glTexCoord1sv"));
++ SET_TexCoord2d(disp, dlsym(RTLD_DEFAULT, "glTexCoord2d"));
++ SET_TexCoord2dv(disp, dlsym(RTLD_DEFAULT, "glTexCoord2dv"));
++ SET_TexCoord2f(disp, dlsym(RTLD_DEFAULT, "glTexCoord2f"));
++ SET_TexCoord2fv(disp, dlsym(RTLD_DEFAULT, "glTexCoord2fv"));
++ SET_TexCoord2i(disp, dlsym(RTLD_DEFAULT, "glTexCoord2i"));
++ SET_TexCoord2iv(disp, dlsym(RTLD_DEFAULT, "glTexCoord2iv"));
++ SET_TexCoord2s(disp, dlsym(RTLD_DEFAULT, "glTexCoord2s"));
++ SET_TexCoord2sv(disp, dlsym(RTLD_DEFAULT, "glTexCoord2sv"));
++ SET_TexCoord3d(disp, dlsym(RTLD_DEFAULT, "glTexCoord3d"));
++ SET_TexCoord3dv(disp, dlsym(RTLD_DEFAULT, "glTexCoord3dv"));
++ SET_TexCoord3f(disp, dlsym(RTLD_DEFAULT, "glTexCoord3f"));
++ SET_TexCoord3fv(disp, dlsym(RTLD_DEFAULT, "glTexCoord3fv"));
++ SET_TexCoord3i(disp, dlsym(RTLD_DEFAULT, "glTexCoord3i"));
++ SET_TexCoord3iv(disp, dlsym(RTLD_DEFAULT, "glTexCoord3iv"));
++ SET_TexCoord3s(disp, dlsym(RTLD_DEFAULT, "glTexCoord3s"));
++ SET_TexCoord3sv(disp, dlsym(RTLD_DEFAULT, "glTexCoord3sv"));
++ SET_TexCoord4d(disp, dlsym(RTLD_DEFAULT, "glTexCoord4d"));
++ SET_TexCoord4dv(disp, dlsym(RTLD_DEFAULT, "glTexCoord4dv"));
++ SET_TexCoord4f(disp, dlsym(RTLD_DEFAULT, "glTexCoord4f"));
++ SET_TexCoord4fv(disp, dlsym(RTLD_DEFAULT, "glTexCoord4fv"));
++ SET_TexCoord4i(disp, dlsym(RTLD_DEFAULT, "glTexCoord4i"));
++ SET_TexCoord4iv(disp, dlsym(RTLD_DEFAULT, "glTexCoord4iv"));
++ SET_TexCoord4s(disp, dlsym(RTLD_DEFAULT, "glTexCoord4s"));
++ SET_TexCoord4sv(disp, dlsym(RTLD_DEFAULT, "glTexCoord4sv"));
++ SET_TexCoordPointer(disp, dlsym(RTLD_DEFAULT, "glTexCoordPointer"));
++ SET_TexEnvf(disp, dlsym(RTLD_DEFAULT, "glTexEnvf"));
++ SET_TexEnvfv(disp, dlsym(RTLD_DEFAULT, "glTexEnvfv"));
++ SET_TexEnvi(disp, dlsym(RTLD_DEFAULT, "glTexEnvi"));
++ SET_TexEnviv(disp, dlsym(RTLD_DEFAULT, "glTexEnviv"));
++ SET_TexGend(disp, dlsym(RTLD_DEFAULT, "glTexGend"));
++ SET_TexGendv(disp, dlsym(RTLD_DEFAULT, "glTexGendv"));
++ SET_TexGenf(disp, dlsym(RTLD_DEFAULT, "glTexGenf"));
++ SET_TexGenfv(disp, dlsym(RTLD_DEFAULT, "glTexGenfv"));
++ SET_TexGeni(disp, dlsym(RTLD_DEFAULT, "glTexGeni"));
++ SET_TexGeniv(disp, dlsym(RTLD_DEFAULT, "glTexGeniv"));
+
+ /* Pointer Incompatability:
+ * internalformat is a GLenum according to /System/Library/Frameworks/OpenGL.framework/Headers/gl.h
+@@ -1027,385 +946,363 @@ static void setup_dispatch_table(void) {
+ * <rdar://problem/6953344> gl.h contains incorrect prototypes for glTexImage[123]D
+ */
+
+- SET_TexImage1D(disp, (void *)glTexImage1D);
+- SET_TexImage2D(disp, (void *)glTexImage2D);
+- SET_TexImage3D(disp, (void *)glTexImage3D);
+- SET_TexParameterf(disp, glTexParameterf);
+- SET_TexParameterfv(disp, glTexParameterfv);
+- SET_TexParameteri(disp, glTexParameteri);
+- SET_TexParameteriv(disp, glTexParameteriv);
+- SET_TexSubImage1D(disp, glTexSubImage1D);
+- SET_TexSubImage2D(disp, glTexSubImage2D);
+- SET_TexSubImage3D(disp, glTexSubImage3D);
+- SET_Translated(disp, glTranslated);
+- SET_Translatef(disp, glTranslatef);
+- SET_Vertex2d(disp, glVertex2d);
+- SET_Vertex2dv(disp, glVertex2dv);
+- SET_Vertex2f(disp, glVertex2f);
+- SET_Vertex2fv(disp, glVertex2fv);
+- SET_Vertex2i(disp, glVertex2i);
+- SET_Vertex2iv(disp, glVertex2iv);
+- SET_Vertex2s(disp, glVertex2s);
+- SET_Vertex2sv(disp, glVertex2sv);
+- SET_Vertex3d(disp, glVertex3d);
+- SET_Vertex3dv(disp, glVertex3dv);
+- SET_Vertex3f(disp, glVertex3f);
+- SET_Vertex3fv(disp, glVertex3fv);
+- SET_Vertex3i(disp, glVertex3i);
+- SET_Vertex3iv(disp, glVertex3iv);
+- SET_Vertex3s(disp, glVertex3s);
+- SET_Vertex3sv(disp, glVertex3sv);
+- SET_Vertex4d(disp, glVertex4d);
+- SET_Vertex4dv(disp, glVertex4dv);
+- SET_Vertex4f(disp, glVertex4f);
+- SET_Vertex4fv(disp, glVertex4fv);
+- SET_Vertex4i(disp, glVertex4i);
+- SET_Vertex4iv(disp, glVertex4iv);
+- SET_Vertex4s(disp, glVertex4s);
+- SET_Vertex4sv(disp, glVertex4sv);
+- SET_VertexPointer(disp, glVertexPointer);
+- SET_Viewport(disp, glViewport);
+-
+-#if GL_VERSION_2_0
+- SET_AttachShader(disp, glAttachShader);
+- SET_DeleteShader(disp, glDeleteShader);
+- SET_DetachShader(disp, glDetachShader);
+- SET_GetAttachedShaders(disp, glGetAttachedShaders);
+- SET_GetProgramInfoLog(disp, glGetProgramInfoLog);
+- SET_GetShaderInfoLog(disp, glGetShaderInfoLog);
+- SET_GetShaderiv(disp, glGetShaderiv);
+- SET_IsShader(disp, glIsShader);
+- SET_StencilFuncSeparate(disp, glStencilFuncSeparate);
+- SET_StencilMaskSeparate(disp, glStencilMaskSeparate);
+- SET_StencilOpSeparate(disp, glStencilOpSeparate);
+-#endif
+-
+-#if GL_VERSION_2_1
+- SET_UniformMatrix2x3fv(disp, glUniformMatrix2x3fv);
+- SET_UniformMatrix2x4fv(disp, glUniformMatrix2x4fv);
+- SET_UniformMatrix3x2fv(disp, glUniformMatrix3x2fv);
+- SET_UniformMatrix3x4fv(disp, glUniformMatrix3x4fv);
+- SET_UniformMatrix4x2fv(disp, glUniformMatrix4x2fv);
+- SET_UniformMatrix4x3fv(disp, glUniformMatrix4x3fv);
+-#endif
+-
+-#if GL_APPLE_vertex_array_object
+- SET_BindVertexArrayAPPLE(disp, glBindVertexArrayAPPLE);
+- SET_DeleteVertexArraysAPPLE(disp, glDeleteVertexArraysAPPLE);
+- SET_GenVertexArraysAPPLE(disp, glGenVertexArraysAPPLE);
+- SET_IsVertexArrayAPPLE(disp, glIsVertexArrayAPPLE);
+-#endif
+-
+-#if GL_ARB_draw_buffers
+- SET_DrawBuffersARB(disp, glDrawBuffersARB);
+-#endif
+-
+-#if GL_ARB_multisample
+- SET_SampleCoverageARB(disp, glSampleCoverageARB);
+-#endif
+-
+-#if GL_ARB_multitexture
+- SET_ActiveTextureARB(disp, glActiveTextureARB);
+- SET_ClientActiveTextureARB(disp, glClientActiveTextureARB);
+- SET_MultiTexCoord1dARB(disp, glMultiTexCoord1dARB);
+- SET_MultiTexCoord1dvARB(disp, glMultiTexCoord1dvARB);
+- SET_MultiTexCoord1fARB(disp, glMultiTexCoord1fARB);
+- SET_MultiTexCoord1fvARB(disp, glMultiTexCoord1fvARB);
+- SET_MultiTexCoord1iARB(disp, glMultiTexCoord1iARB);
+- SET_MultiTexCoord1ivARB(disp, glMultiTexCoord1ivARB);
+- SET_MultiTexCoord1sARB(disp, glMultiTexCoord1sARB);
+- SET_MultiTexCoord1svARB(disp, glMultiTexCoord1svARB);
+- SET_MultiTexCoord2dARB(disp, glMultiTexCoord2dARB);
+- SET_MultiTexCoord2dvARB(disp, glMultiTexCoord2dvARB);
+- SET_MultiTexCoord2fARB(disp, glMultiTexCoord2fARB);
+- SET_MultiTexCoord2fvARB(disp, glMultiTexCoord2fvARB);
+- SET_MultiTexCoord2iARB(disp, glMultiTexCoord2iARB);
+- SET_MultiTexCoord2ivARB(disp, glMultiTexCoord2ivARB);
+- SET_MultiTexCoord2sARB(disp, glMultiTexCoord2sARB);
+- SET_MultiTexCoord2svARB(disp, glMultiTexCoord2svARB);
+- SET_MultiTexCoord3dARB(disp, glMultiTexCoord3dARB);
+- SET_MultiTexCoord3dvARB(disp, glMultiTexCoord3dvARB);
+- SET_MultiTexCoord3fARB(disp, glMultiTexCoord3fARB);
+- SET_MultiTexCoord3fvARB(disp, glMultiTexCoord3fvARB);
+- SET_MultiTexCoord3iARB(disp, glMultiTexCoord3iARB);
+- SET_MultiTexCoord3ivARB(disp, glMultiTexCoord3ivARB);
+- SET_MultiTexCoord3sARB(disp, glMultiTexCoord3sARB);
+- SET_MultiTexCoord3svARB(disp, glMultiTexCoord3svARB);
+- SET_MultiTexCoord4dARB(disp, glMultiTexCoord4dARB);
+- SET_MultiTexCoord4dvARB(disp, glMultiTexCoord4dvARB);
+- SET_MultiTexCoord4fARB(disp, glMultiTexCoord4fARB);
+- SET_MultiTexCoord4fvARB(disp, glMultiTexCoord4fvARB);
+- SET_MultiTexCoord4iARB(disp, glMultiTexCoord4iARB);
+- SET_MultiTexCoord4ivARB(disp, glMultiTexCoord4ivARB);
+- SET_MultiTexCoord4sARB(disp, glMultiTexCoord4sARB);
+- SET_MultiTexCoord4svARB(disp, glMultiTexCoord4svARB);
+-#endif
+-
+-#if GL_ARB_occlusion_query
+- SET_BeginQueryARB(disp, glBeginQueryARB);
+- SET_DeleteQueriesARB(disp, glDeleteQueriesARB);
+- SET_EndQueryARB(disp, glEndQueryARB);
+- SET_GenQueriesARB(disp, glGenQueriesARB);
+- SET_GetQueryObjectivARB(disp, glGetQueryObjectivARB);
+- SET_GetQueryObjectuivARB(disp, glGetQueryObjectuivARB);
+- SET_GetQueryivARB(disp, glGetQueryivARB);
+- SET_IsQueryARB(disp, glIsQueryARB);
+-#endif
+-
+-#if GL_ARB_shader_objects
+- SET_AttachObjectARB(disp, glAttachObjectARB);
+- SET_CompileShaderARB(disp, glCompileShaderARB);
+- SET_DeleteObjectARB(disp, glDeleteObjectARB);
+- SET_GetHandleARB(disp, glGetHandleARB);
+- SET_DetachObjectARB(disp, glDetachObjectARB);
+- SET_CreateProgramObjectARB(disp, glCreateProgramObjectARB);
+- SET_CreateShaderObjectARB(disp, glCreateShaderObjectARB);
+- SET_GetInfoLogARB(disp, glGetInfoLogARB);
+- SET_GetActiveUniformARB(disp, glGetActiveUniformARB);
+- SET_GetAttachedObjectsARB(disp, glGetAttachedObjectsARB);
+- SET_GetObjectParameterfvARB(disp, glGetObjectParameterfvARB);
+- SET_GetObjectParameterivARB(disp, glGetObjectParameterivARB);
+- SET_GetShaderSourceARB(disp, glGetShaderSourceARB);
+- SET_GetUniformLocationARB(disp, glGetUniformLocationARB);
+- SET_GetUniformfvARB(disp, glGetUniformfvARB);
+- SET_GetUniformivARB(disp, glGetUniformivARB);
+- SET_LinkProgramARB(disp, glLinkProgramARB);
+- SET_ShaderSourceARB(disp, glShaderSourceARB);
+- SET_Uniform1fARB(disp, glUniform1fARB);
+- SET_Uniform1fvARB(disp, glUniform1fvARB);
+- SET_Uniform1iARB(disp, glUniform1iARB);
+- SET_Uniform1ivARB(disp, glUniform1ivARB);
+- SET_Uniform2fARB(disp, glUniform2fARB);
+- SET_Uniform2fvARB(disp, glUniform2fvARB);
+- SET_Uniform2iARB(disp, glUniform2iARB);
+- SET_Uniform2ivARB(disp, glUniform2ivARB);
+- SET_Uniform3fARB(disp, glUniform3fARB);
+- SET_Uniform3fvARB(disp, glUniform3fvARB);
+- SET_Uniform3iARB(disp, glUniform3iARB);
+- SET_Uniform3ivARB(disp, glUniform3ivARB);
+- SET_Uniform4fARB(disp, glUniform4fARB);
+- SET_Uniform4fvARB(disp, glUniform4fvARB);
+- SET_Uniform4iARB(disp, glUniform4iARB);
+- SET_Uniform4ivARB(disp, glUniform4ivARB);
+- SET_UniformMatrix2fvARB(disp, glUniformMatrix2fvARB);
+- SET_UniformMatrix3fvARB(disp, glUniformMatrix3fvARB);
+- SET_UniformMatrix4fvARB(disp, glUniformMatrix4fvARB);
+- SET_UseProgramObjectARB(disp, glUseProgramObjectARB);
+- SET_ValidateProgramARB(disp, glValidateProgramARB);
+-#endif
+-
+-#if GL_ARB_texture_compression
+- SET_CompressedTexImage1DARB(disp, glCompressedTexImage1DARB);
+- SET_CompressedTexImage2DARB(disp, glCompressedTexImage2DARB);
+- SET_CompressedTexImage3DARB(disp, glCompressedTexImage3DARB);
+- SET_CompressedTexSubImage1DARB(disp, glCompressedTexSubImage1DARB);
+- SET_CompressedTexSubImage2DARB(disp, glCompressedTexSubImage2DARB);
+- SET_CompressedTexSubImage3DARB(disp, glCompressedTexSubImage3DARB);
+- SET_GetCompressedTexImageARB(disp, glGetCompressedTexImageARB);
+-#endif
+-
+-#if GL_ARB_transpose_matrix
+- SET_LoadTransposeMatrixdARB(disp, glLoadTransposeMatrixdARB);
+- SET_LoadTransposeMatrixfARB(disp, glLoadTransposeMatrixfARB);
+- SET_MultTransposeMatrixdARB(disp, glMultTransposeMatrixdARB);
+- SET_MultTransposeMatrixfARB(disp, glMultTransposeMatrixfARB);
+-#endif
+-
+-#if GL_ARB_vertex_buffer_object
+- SET_BindBufferARB(disp, glBindBufferARB);
+- SET_BufferDataARB(disp, glBufferDataARB);
+- SET_BufferSubDataARB(disp, glBufferSubDataARB);
+- SET_DeleteBuffersARB(disp, glDeleteBuffersARB);
+- SET_GenBuffersARB(disp, glGenBuffersARB);
+- SET_GetBufferParameterivARB(disp, glGetBufferParameterivARB);
+- SET_GetBufferPointervARB(disp, glGetBufferPointervARB);
+- SET_GetBufferSubDataARB(disp, glGetBufferSubDataARB);
+- SET_IsBufferARB(disp, glIsBufferARB);
+- SET_MapBufferARB(disp, glMapBufferARB);
+- SET_UnmapBufferARB(disp, glUnmapBufferARB);
+-#endif
+-
+-#if GL_ARB_vertex_program
+- SET_DisableVertexAttribArrayARB(disp, glDisableVertexAttribArrayARB);
+- SET_EnableVertexAttribArrayARB(disp, glEnableVertexAttribArrayARB);
+- SET_GetProgramEnvParameterdvARB(disp, glGetProgramEnvParameterdvARB);
+- SET_GetProgramEnvParameterfvARB(disp, glGetProgramEnvParameterfvARB);
+- SET_GetProgramLocalParameterdvARB(disp, glGetProgramLocalParameterdvARB);
+- SET_GetProgramLocalParameterfvARB(disp, glGetProgramLocalParameterfvARB);
+- SET_GetProgramStringARB(disp, glGetProgramStringARB);
+- SET_GetProgramivARB(disp, glGetProgramivARB);
+- SET_GetVertexAttribdvARB(disp, glGetVertexAttribdvARB);
+- SET_GetVertexAttribfvARB(disp, glGetVertexAttribfvARB);
+- SET_GetVertexAttribivARB(disp, glGetVertexAttribivARB);
+- SET_ProgramEnvParameter4dARB(disp, glProgramEnvParameter4dARB);
+- SET_ProgramEnvParameter4dvARB(disp, glProgramEnvParameter4dvARB);
+- SET_ProgramEnvParameter4fARB(disp, glProgramEnvParameter4fARB);
+- SET_ProgramEnvParameter4fvARB(disp, glProgramEnvParameter4fvARB);
+- SET_ProgramLocalParameter4dARB(disp, glProgramLocalParameter4dARB);
+- SET_ProgramLocalParameter4dvARB(disp, glProgramLocalParameter4dvARB);
+- SET_ProgramLocalParameter4fARB(disp, glProgramLocalParameter4fARB);
+- SET_ProgramLocalParameter4fvARB(disp, glProgramLocalParameter4fvARB);
+- SET_ProgramStringARB(disp, glProgramStringARB);
+- SET_VertexAttrib1dARB(disp, glVertexAttrib1dARB);
+- SET_VertexAttrib1dvARB(disp, glVertexAttrib1dvARB);
+- SET_VertexAttrib1fARB(disp, glVertexAttrib1fARB);
+- SET_VertexAttrib1fvARB(disp, glVertexAttrib1fvARB);
+- SET_VertexAttrib1sARB(disp, glVertexAttrib1sARB);
+- SET_VertexAttrib1svARB(disp, glVertexAttrib1svARB);
+- SET_VertexAttrib2dARB(disp, glVertexAttrib2dARB);
+- SET_VertexAttrib2dvARB(disp, glVertexAttrib2dvARB);
+- SET_VertexAttrib2fARB(disp, glVertexAttrib2fARB);
+- SET_VertexAttrib2fvARB(disp, glVertexAttrib2fvARB);
+- SET_VertexAttrib2sARB(disp, glVertexAttrib2sARB);
+- SET_VertexAttrib2svARB(disp, glVertexAttrib2svARB);
+- SET_VertexAttrib3dARB(disp, glVertexAttrib3dARB);
+- SET_VertexAttrib3dvARB(disp, glVertexAttrib3dvARB);
+- SET_VertexAttrib3fARB(disp, glVertexAttrib3fARB);
+- SET_VertexAttrib3fvARB(disp, glVertexAttrib3fvARB);
+- SET_VertexAttrib3sARB(disp, glVertexAttrib3sARB);
+- SET_VertexAttrib3svARB(disp, glVertexAttrib3svARB);
+- SET_VertexAttrib4NbvARB(disp, glVertexAttrib4NbvARB);
+- SET_VertexAttrib4NivARB(disp, glVertexAttrib4NivARB);
+- SET_VertexAttrib4NsvARB(disp, glVertexAttrib4NsvARB);
+- SET_VertexAttrib4NubARB(disp, glVertexAttrib4NubARB);
+- SET_VertexAttrib4NubvARB(disp, glVertexAttrib4NubvARB);
+- SET_VertexAttrib4NuivARB(disp, glVertexAttrib4NuivARB);
+- SET_VertexAttrib4NusvARB(disp, glVertexAttrib4NusvARB);
+- SET_VertexAttrib4bvARB(disp, glVertexAttrib4bvARB);
+- SET_VertexAttrib4dARB(disp, glVertexAttrib4dARB);
+- SET_VertexAttrib4dvARB(disp, glVertexAttrib4dvARB);
+- SET_VertexAttrib4fARB(disp, glVertexAttrib4fARB);
+- SET_VertexAttrib4fvARB(disp, glVertexAttrib4fvARB);
+- SET_VertexAttrib4ivARB(disp, glVertexAttrib4ivARB);
+- SET_VertexAttrib4sARB(disp, glVertexAttrib4sARB);
+- SET_VertexAttrib4svARB(disp, glVertexAttrib4svARB);
+- SET_VertexAttrib4ubvARB(disp, glVertexAttrib4ubvARB);
+- SET_VertexAttrib4uivARB(disp, glVertexAttrib4uivARB);
+- SET_VertexAttrib4usvARB(disp, glVertexAttrib4usvARB);
+- SET_VertexAttribPointerARB(disp, glVertexAttribPointerARB);
+-#endif
+-
+-#if GL_ARB_vertex_shader
+- SET_BindAttribLocationARB(disp, glBindAttribLocationARB);
+- SET_GetActiveAttribARB(disp, glGetActiveAttribARB);
+- SET_GetAttribLocationARB(disp, glGetAttribLocationARB);
+-#endif
+-
+-#if GL_ARB_window_pos
+- SET_WindowPos2dMESA(disp, glWindowPos2dARB);
+- SET_WindowPos2dvMESA(disp, glWindowPos2dvARB);
+- SET_WindowPos2fMESA(disp, glWindowPos2fARB);
+- SET_WindowPos2fvMESA(disp, glWindowPos2fvARB);
+- SET_WindowPos2iMESA(disp, glWindowPos2iARB);
+- SET_WindowPos2ivMESA(disp, glWindowPos2ivARB);
+- SET_WindowPos2sMESA(disp, glWindowPos2sARB);
+- SET_WindowPos2svMESA(disp, glWindowPos2svARB);
+- SET_WindowPos3dMESA(disp, glWindowPos3dARB);
+- SET_WindowPos3dvMESA(disp, glWindowPos3dvARB);
+- SET_WindowPos3fMESA(disp, glWindowPos3fARB);
+- SET_WindowPos3fvMESA(disp, glWindowPos3fvARB);
+- SET_WindowPos3iMESA(disp, glWindowPos3iARB);
+- SET_WindowPos3ivMESA(disp, glWindowPos3ivARB);
+- SET_WindowPos3sMESA(disp, glWindowPos3sARB);
+- SET_WindowPos3svMESA(disp, glWindowPos3svARB);
+-#endif
+-
+-#if GL_ATI_fragment_shader
+- SET_AlphaFragmentOp1ATI(disp, glAlphaFragmentOp1ATI);
+- SET_AlphaFragmentOp2ATI(disp, glAlphaFragmentOp2ATI);
+- SET_AlphaFragmentOp3ATI(disp, glAlphaFragmentOp3ATI);
+- SET_BeginFragmentShaderATI(disp, glBeginFragmentShaderATI);
+- SET_BindFragmentShaderATI(disp, glBindFragmentShaderATI);
+- SET_ColorFragmentOp1ATI(disp, glColorFragmentOp1ATI);
+- SET_ColorFragmentOp2ATI(disp, glColorFragmentOp2ATI);
+- SET_ColorFragmentOp3ATI(disp, glColorFragmentOp3ATI);
+- SET_DeleteFragmentShaderATI(disp, glDeleteFragmentShaderATI);
+- SET_EndFragmentShaderATI(disp, glEndFragmentShaderATI);
+- SET_GenFragmentShadersATI(disp, glGenFragmentShadersATI);
+- SET_PassTexCoordATI(disp, glPassTexCoordATI);
+- SET_SampleMapATI(disp, glSampleMapATI);
+- SET_SetFragmentShaderConstantATI(disp, glSetFragmentShaderConstantATI);
+-#elif GL_EXT_fragment_shader
+- SET_AlphaFragmentOp1ATI(disp, glAlphaFragmentOp1EXT);
+- SET_AlphaFragmentOp2ATI(disp, glAlphaFragmentOp2EXT);
+- SET_AlphaFragmentOp3ATI(disp, glAlphaFragmentOp3EXT);
+- SET_BeginFragmentShaderATI(disp, glBeginFragmentShaderEXT);
+- SET_BindFragmentShaderATI(disp, glBindFragmentShaderEXT);
+- SET_ColorFragmentOp1ATI(disp, glColorFragmentOp1EXT);
+- SET_ColorFragmentOp2ATI(disp, glColorFragmentOp2EXT);
+- SET_ColorFragmentOp3ATI(disp, glColorFragmentOp3EXT);
+- SET_DeleteFragmentShaderATI(disp, glDeleteFragmentShaderEXT);
+- SET_EndFragmentShaderATI(disp, glEndFragmentShaderEXT);
+- SET_GenFragmentShadersATI(disp, glGenFragmentShadersEXT);
+- SET_PassTexCoordATI(disp, glPassTexCoordEXT);
+- SET_SampleMapATI(disp, glSampleMapEXT);
+- SET_SetFragmentShaderConstantATI(disp, glSetFragmentShaderConstantEXT);
+-#endif
+-
+-#if GL_ATI_separate_stencil
+- SET_StencilFuncSeparateATI(disp, glStencilFuncSeparateATI);
+-#endif
+-
+-#if GL_EXT_blend_equation_separate
+- SET_BlendEquationSeparateEXT(disp, glBlendEquationSeparateEXT);
+-#endif
+-
+-#if GL_EXT_blend_func_separate
+- SET_BlendFuncSeparateEXT(disp, glBlendFuncSeparateEXT);
+-#endif
+-
+-#if GL_EXT_depth_bounds_test
+- SET_DepthBoundsEXT(disp, glDepthBoundsEXT);
+-#endif
+-
+-#if GL_EXT_compiled_vertex_array
+- SET_LockArraysEXT(disp, glLockArraysEXT);
+- SET_UnlockArraysEXT(disp, glUnlockArraysEXT);
+-#endif
+-
+-#if GL_EXT_cull_vertex
+- SET_CullParameterdvEXT(disp, glCullParameterdvEXT);
+- SET_CullParameterfvEXT(disp, glCullParameterfvEXT);
+-#endif
+-
+-#if GL_EXT_fog_coord
+- SET_FogCoordPointerEXT(disp, glFogCoordPointerEXT);
+- SET_FogCoorddEXT(disp, glFogCoorddEXT);
+- SET_FogCoorddvEXT(disp, glFogCoorddvEXT);
+- SET_FogCoordfEXT(disp, glFogCoordfEXT);
+- SET_FogCoordfvEXT(disp, glFogCoordfvEXT);
+-#endif
+-
+-#if GL_EXT_framebuffer_blit
+- SET_BlitFramebufferEXT(disp, glBlitFramebufferEXT);
+-#endif
+-
+-#if GL_EXT_framebuffer_object
+- SET_BindFramebufferEXT(disp, glBindFramebufferEXT);
+- SET_BindRenderbufferEXT(disp, glBindRenderbufferEXT);
+- SET_CheckFramebufferStatusEXT(disp, glCheckFramebufferStatusEXT);
+- SET_DeleteFramebuffersEXT(disp, glDeleteFramebuffersEXT);
+- SET_DeleteRenderbuffersEXT(disp, glDeleteRenderbuffersEXT);
+- SET_FramebufferRenderbufferEXT(disp, glFramebufferRenderbufferEXT);
+- SET_FramebufferTexture1DEXT(disp, glFramebufferTexture1DEXT);
+- SET_FramebufferTexture2DEXT(disp, glFramebufferTexture2DEXT);
+- SET_FramebufferTexture3DEXT(disp, glFramebufferTexture3DEXT);
+- SET_GenerateMipmapEXT(disp, glGenerateMipmapEXT);
+- SET_GenFramebuffersEXT(disp, glGenFramebuffersEXT);
+- SET_GenRenderbuffersEXT(disp, glGenRenderbuffersEXT);
+- SET_GetFramebufferAttachmentParameterivEXT(disp, glGetFramebufferAttachmentParameterivEXT);
+- SET_GetRenderbufferParameterivEXT(disp, glGetRenderbufferParameterivEXT);
+- SET_IsFramebufferEXT(disp, glIsFramebufferEXT);
+- SET_IsRenderbufferEXT(disp, glIsRenderbufferEXT);
+- SET_RenderbufferStorageEXT(disp, glRenderbufferStorageEXT);
+-#endif
++ SET_TexImage1D(disp, dlsym(RTLD_DEFAULT, "glTexImage1D"));
++ SET_TexImage2D(disp, dlsym(RTLD_DEFAULT, "glTexImage2D"));
++ SET_TexImage3D(disp, dlsym(RTLD_DEFAULT, "glTexImage3D"));
++ SET_TexParameterf(disp, dlsym(RTLD_DEFAULT, "glTexParameterf"));
++ SET_TexParameterfv(disp, dlsym(RTLD_DEFAULT, "glTexParameterfv"));
++ SET_TexParameteri(disp, dlsym(RTLD_DEFAULT, "glTexParameteri"));
++ SET_TexParameteriv(disp, dlsym(RTLD_DEFAULT, "glTexParameteriv"));
++ SET_TexSubImage1D(disp, dlsym(RTLD_DEFAULT, "glTexSubImage1D"));
++ SET_TexSubImage2D(disp, dlsym(RTLD_DEFAULT, "glTexSubImage2D"));
++ SET_TexSubImage3D(disp, dlsym(RTLD_DEFAULT, "glTexSubImage3D"));
++ SET_Translated(disp, dlsym(RTLD_DEFAULT, "glTranslated"));
++ SET_Translatef(disp, dlsym(RTLD_DEFAULT, "glTranslatef"));
++ SET_Vertex2d(disp, dlsym(RTLD_DEFAULT, "glVertex2d"));
++ SET_Vertex2dv(disp, dlsym(RTLD_DEFAULT, "glVertex2dv"));
++ SET_Vertex2f(disp, dlsym(RTLD_DEFAULT, "glVertex2f"));
++ SET_Vertex2fv(disp, dlsym(RTLD_DEFAULT, "glVertex2fv"));
++ SET_Vertex2i(disp, dlsym(RTLD_DEFAULT, "glVertex2i"));
++ SET_Vertex2iv(disp, dlsym(RTLD_DEFAULT, "glVertex2iv"));
++ SET_Vertex2s(disp, dlsym(RTLD_DEFAULT, "glVertex2s"));
++ SET_Vertex2sv(disp, dlsym(RTLD_DEFAULT, "glVertex2sv"));
++ SET_Vertex3d(disp, dlsym(RTLD_DEFAULT, "glVertex3d"));
++ SET_Vertex3dv(disp, dlsym(RTLD_DEFAULT, "glVertex3dv"));
++ SET_Vertex3f(disp, dlsym(RTLD_DEFAULT, "glVertex3f"));
++ SET_Vertex3fv(disp, dlsym(RTLD_DEFAULT, "glVertex3fv"));
++ SET_Vertex3i(disp, dlsym(RTLD_DEFAULT, "glVertex3i"));
++ SET_Vertex3iv(disp, dlsym(RTLD_DEFAULT, "glVertex3iv"));
++ SET_Vertex3s(disp, dlsym(RTLD_DEFAULT, "glVertex3s"));
++ SET_Vertex3sv(disp, dlsym(RTLD_DEFAULT, "glVertex3sv"));
++ SET_Vertex4d(disp, dlsym(RTLD_DEFAULT, "glVertex4d"));
++ SET_Vertex4dv(disp, dlsym(RTLD_DEFAULT, "glVertex4dv"));
++ SET_Vertex4f(disp, dlsym(RTLD_DEFAULT, "glVertex4f"));
++ SET_Vertex4fv(disp, dlsym(RTLD_DEFAULT, "glVertex4fv"));
++ SET_Vertex4i(disp, dlsym(RTLD_DEFAULT, "glVertex4i"));
++ SET_Vertex4iv(disp, dlsym(RTLD_DEFAULT, "glVertex4iv"));
++ SET_Vertex4s(disp, dlsym(RTLD_DEFAULT, "glVertex4s"));
++ SET_Vertex4sv(disp, dlsym(RTLD_DEFAULT, "glVertex4sv"));
++ SET_VertexPointer(disp, dlsym(RTLD_DEFAULT, "glVertexPointer"));
++ SET_Viewport(disp, dlsym(RTLD_DEFAULT, "glViewport"));
++
++ /* GL_VERSION_2_0 */
++ SET_AttachShader(disp, dlsym(RTLD_DEFAULT, "glAttachShader"));
++ SET_DeleteShader(disp, dlsym(RTLD_DEFAULT, "glDeleteShader"));
++ SET_DetachShader(disp, dlsym(RTLD_DEFAULT, "glDetachShader"));
++ SET_GetAttachedShaders(disp, dlsym(RTLD_DEFAULT, "glGetAttachedShaders"));
++ SET_GetProgramInfoLog(disp, dlsym(RTLD_DEFAULT, "glGetProgramInfoLog"));
++ SET_GetShaderInfoLog(disp, dlsym(RTLD_DEFAULT, "glGetShaderInfoLog"));
++ SET_GetShaderiv(disp, dlsym(RTLD_DEFAULT, "glGetShaderiv"));
++ SET_IsShader(disp, dlsym(RTLD_DEFAULT, "glIsShader"));
++ SET_StencilFuncSeparate(disp, dlsym(RTLD_DEFAULT, "glStencilFuncSeparate"));
++ SET_StencilMaskSeparate(disp, dlsym(RTLD_DEFAULT, "glStencilMaskSeparate"));
++ SET_StencilOpSeparate(disp, dlsym(RTLD_DEFAULT, "glStencilOpSeparate"));
++
++ /* GL_VERSION_2_1 */
++ SET_UniformMatrix2x3fv(disp, dlsym(RTLD_DEFAULT, "glUniformMatrix2x3fv"));
++ SET_UniformMatrix2x4fv(disp, dlsym(RTLD_DEFAULT, "glUniformMatrix2x4fv"));
++ SET_UniformMatrix3x2fv(disp, dlsym(RTLD_DEFAULT, "glUniformMatrix3x2fv"));
++ SET_UniformMatrix3x4fv(disp, dlsym(RTLD_DEFAULT, "glUniformMatrix3x4fv"));
++ SET_UniformMatrix4x2fv(disp, dlsym(RTLD_DEFAULT, "glUniformMatrix4x2fv"));
++ SET_UniformMatrix4x3fv(disp, dlsym(RTLD_DEFAULT, "glUniformMatrix4x3fv"));
++
++ /* GL_APPLE_vertex_array_object */
++ SET_BindVertexArrayAPPLE(disp, dlsym(RTLD_DEFAULT, "glBindVertexArrayAPPLE"));
++ SET_DeleteVertexArraysAPPLE(disp, dlsym(RTLD_DEFAULT, "glDeleteVertexArraysAPPLE"));
++ SET_GenVertexArraysAPPLE(disp, dlsym(RTLD_DEFAULT, "glGenVertexArraysAPPLE"));
++ SET_IsVertexArrayAPPLE(disp, dlsym(RTLD_DEFAULT, "glIsVertexArrayAPPLE"));
++
++ /* GL_ARB_draw_buffers */
++ SET_DrawBuffersARB(disp, dlsym(RTLD_DEFAULT, "glDrawBuffersARB"));
++
++ /* GL_ARB_multisample */
++ SET_SampleCoverageARB(disp, dlsym(RTLD_DEFAULT, "glSampleCoverageARB"));
++
++ /* GL_ARB_multitexture */
++ SET_ActiveTextureARB(disp, dlsym(RTLD_DEFAULT, "glActiveTextureARB"));
++ SET_ClientActiveTextureARB(disp, dlsym(RTLD_DEFAULT, "glClientActiveTextureARB"));
++ SET_MultiTexCoord1dARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord1dARB"));
++ SET_MultiTexCoord1dvARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord1dvARB"));
++ SET_MultiTexCoord1fARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord1fARB"));
++ SET_MultiTexCoord1fvARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord1fvARB"));
++ SET_MultiTexCoord1iARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord1iARB"));
++ SET_MultiTexCoord1ivARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord1ivARB"));
++ SET_MultiTexCoord1sARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord1sARB"));
++ SET_MultiTexCoord1svARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord1svARB"));
++ SET_MultiTexCoord2dARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord2dARB"));
++ SET_MultiTexCoord2dvARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord2dvARB"));
++ SET_MultiTexCoord2fARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord2fARB"));
++ SET_MultiTexCoord2fvARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord2fvARB"));
++ SET_MultiTexCoord2iARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord2iARB"));
++ SET_MultiTexCoord2ivARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord2ivARB"));
++ SET_MultiTexCoord2sARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord2sARB"));
++ SET_MultiTexCoord2svARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord2svARB"));
++ SET_MultiTexCoord3dARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord3dARB"));
++ SET_MultiTexCoord3dvARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord3dvARB"));
++ SET_MultiTexCoord3fARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord3fARB"));
++ SET_MultiTexCoord3fvARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord3fvARB"));
++ SET_MultiTexCoord3iARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord3iARB"));
++ SET_MultiTexCoord3ivARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord3ivARB"));
++ SET_MultiTexCoord3sARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord3sARB"));
++ SET_MultiTexCoord3svARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord3svARB"));
++ SET_MultiTexCoord4dARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord4dARB"));
++ SET_MultiTexCoord4dvARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord4dvARB"));
++ SET_MultiTexCoord4fARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord4fARB"));
++ SET_MultiTexCoord4fvARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord4fvARB"));
++ SET_MultiTexCoord4iARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord4iARB"));
++ SET_MultiTexCoord4ivARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord4ivARB"));
++ SET_MultiTexCoord4sARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord4sARB"));
++ SET_MultiTexCoord4svARB(disp, dlsym(RTLD_DEFAULT, "glMultiTexCoord4svARB"));
++
++ /* GL_ARB_occlusion_query */
++ SET_BeginQueryARB(disp, dlsym(RTLD_DEFAULT, "glBeginQueryARB"));
++ SET_DeleteQueriesARB(disp, dlsym(RTLD_DEFAULT, "glDeleteQueriesARB"));
++ SET_EndQueryARB(disp, dlsym(RTLD_DEFAULT, "glEndQueryARB"));
++ SET_GenQueriesARB(disp, dlsym(RTLD_DEFAULT, "glGenQueriesARB"));
++ SET_GetQueryObjectivARB(disp, dlsym(RTLD_DEFAULT, "glGetQueryObjectivARB"));
++ SET_GetQueryObjectuivARB(disp, dlsym(RTLD_DEFAULT, "glGetQueryObjectuivARB"));
++ SET_GetQueryivARB(disp, dlsym(RTLD_DEFAULT, "glGetQueryivARB"));
++ SET_IsQueryARB(disp, dlsym(RTLD_DEFAULT, "glIsQueryARB"));
++
++ /* GL_ARB_shader_objects */
++ SET_AttachObjectARB(disp, dlsym(RTLD_DEFAULT, "glAttachObjectARB"));
++ SET_CompileShaderARB(disp, dlsym(RTLD_DEFAULT, "glCompileShaderARB"));
++ SET_DeleteObjectARB(disp, dlsym(RTLD_DEFAULT, "glDeleteObjectARB"));
++ SET_GetHandleARB(disp, dlsym(RTLD_DEFAULT, "glGetHandleARB"));
++ SET_DetachObjectARB(disp, dlsym(RTLD_DEFAULT, "glDetachObjectARB"));
++ SET_CreateProgramObjectARB(disp, dlsym(RTLD_DEFAULT, "glCreateProgramObjectARB"));
++ SET_CreateShaderObjectARB(disp, dlsym(RTLD_DEFAULT, "glCreateShaderObjectARB"));
++ SET_GetInfoLogARB(disp, dlsym(RTLD_DEFAULT, "glGetInfoLogARB"));
++ SET_GetActiveUniformARB(disp, dlsym(RTLD_DEFAULT, "glGetActiveUniformARB"));
++ SET_GetAttachedObjectsARB(disp, dlsym(RTLD_DEFAULT, "glGetAttachedObjectsARB"));
++ SET_GetObjectParameterfvARB(disp, dlsym(RTLD_DEFAULT, "glGetObjectParameterfvARB"));
++ SET_GetObjectParameterivARB(disp, dlsym(RTLD_DEFAULT, "glGetObjectParameterivARB"));
++ SET_GetShaderSourceARB(disp, dlsym(RTLD_DEFAULT, "glGetShaderSourceARB"));
++ SET_GetUniformLocationARB(disp, dlsym(RTLD_DEFAULT, "glGetUniformLocationARB"));
++ SET_GetUniformfvARB(disp, dlsym(RTLD_DEFAULT, "glGetUniformfvARB"));
++ SET_GetUniformivARB(disp, dlsym(RTLD_DEFAULT, "glGetUniformivARB"));
++ SET_LinkProgramARB(disp, dlsym(RTLD_DEFAULT, "glLinkProgramARB"));
++ SET_ShaderSourceARB(disp, dlsym(RTLD_DEFAULT, "glShaderSourceARB"));
++ SET_Uniform1fARB(disp, dlsym(RTLD_DEFAULT, "glUniform1fARB"));
++ SET_Uniform1fvARB(disp, dlsym(RTLD_DEFAULT, "glUniform1fvARB"));
++ SET_Uniform1iARB(disp, dlsym(RTLD_DEFAULT, "glUniform1iARB"));
++ SET_Uniform1ivARB(disp, dlsym(RTLD_DEFAULT, "glUniform1ivARB"));
++ SET_Uniform2fARB(disp, dlsym(RTLD_DEFAULT, "glUniform2fARB"));
++ SET_Uniform2fvARB(disp, dlsym(RTLD_DEFAULT, "glUniform2fvARB"));
++ SET_Uniform2iARB(disp, dlsym(RTLD_DEFAULT, "glUniform2iARB"));
++ SET_Uniform2ivARB(disp, dlsym(RTLD_DEFAULT, "glUniform2ivARB"));
++ SET_Uniform3fARB(disp, dlsym(RTLD_DEFAULT, "glUniform3fARB"));
++ SET_Uniform3fvARB(disp, dlsym(RTLD_DEFAULT, "glUniform3fvARB"));
++ SET_Uniform3iARB(disp, dlsym(RTLD_DEFAULT, "glUniform3iARB"));
++ SET_Uniform3ivARB(disp, dlsym(RTLD_DEFAULT, "glUniform3ivARB"));
++ SET_Uniform4fARB(disp, dlsym(RTLD_DEFAULT, "glUniform4fARB"));
++ SET_Uniform4fvARB(disp, dlsym(RTLD_DEFAULT, "glUniform4fvARB"));
++ SET_Uniform4iARB(disp, dlsym(RTLD_DEFAULT, "glUniform4iARB"));
++ SET_Uniform4ivARB(disp, dlsym(RTLD_DEFAULT, "glUniform4ivARB"));
++ SET_UniformMatrix2fvARB(disp, dlsym(RTLD_DEFAULT, "glUniformMatrix2fvARB"));
++ SET_UniformMatrix3fvARB(disp, dlsym(RTLD_DEFAULT, "glUniformMatrix3fvARB"));
++ SET_UniformMatrix4fvARB(disp, dlsym(RTLD_DEFAULT, "glUniformMatrix4fvARB"));
++ SET_UseProgramObjectARB(disp, dlsym(RTLD_DEFAULT, "glUseProgramObjectARB"));
++ SET_ValidateProgramARB(disp, dlsym(RTLD_DEFAULT, "glValidateProgramARB"));
++
++ /* GL_ARB_texture_compression */
++ SET_CompressedTexImage1DARB(disp, dlsym(RTLD_DEFAULT, "glCompressedTexImage1DARB"));
++ SET_CompressedTexImage2DARB(disp, dlsym(RTLD_DEFAULT, "glCompressedTexImage2DARB"));
++ SET_CompressedTexImage3DARB(disp, dlsym(RTLD_DEFAULT, "glCompressedTexImage3DARB"));
++ SET_CompressedTexSubImage1DARB(disp, dlsym(RTLD_DEFAULT, "glCompressedTexSubImage1DARB"));
++ SET_CompressedTexSubImage2DARB(disp, dlsym(RTLD_DEFAULT, "glCompressedTexSubImage2DARB"));
++ SET_CompressedTexSubImage3DARB(disp, dlsym(RTLD_DEFAULT, "glCompressedTexSubImage3DARB"));
++ SET_GetCompressedTexImageARB(disp, dlsym(RTLD_DEFAULT, "glGetCompressedTexImageARB"));
++
++ /* GL_ARB_transpose_matrix */
++ SET_LoadTransposeMatrixdARB(disp, dlsym(RTLD_DEFAULT, "glLoadTransposeMatrixdARB"));
++ SET_LoadTransposeMatrixfARB(disp, dlsym(RTLD_DEFAULT, "glLoadTransposeMatrixfARB"));
++ SET_MultTransposeMatrixdARB(disp, dlsym(RTLD_DEFAULT, "glMultTransposeMatrixdARB"));
++ SET_MultTransposeMatrixfARB(disp, dlsym(RTLD_DEFAULT, "glMultTransposeMatrixfARB"));
++
++ /* GL_ARB_vertex_buffer_object */
++ SET_BindBufferARB(disp, dlsym(RTLD_DEFAULT, "glBindBufferARB"));
++ SET_BufferDataARB(disp, dlsym(RTLD_DEFAULT, "glBufferDataARB"));
++ SET_BufferSubDataARB(disp, dlsym(RTLD_DEFAULT, "glBufferSubDataARB"));
++ SET_DeleteBuffersARB(disp, dlsym(RTLD_DEFAULT, "glDeleteBuffersARB"));
++ SET_GenBuffersARB(disp, dlsym(RTLD_DEFAULT, "glGenBuffersARB"));
++ SET_GetBufferParameterivARB(disp, dlsym(RTLD_DEFAULT, "glGetBufferParameterivARB"));
++ SET_GetBufferPointervARB(disp, dlsym(RTLD_DEFAULT, "glGetBufferPointervARB"));
++ SET_GetBufferSubDataARB(disp, dlsym(RTLD_DEFAULT, "glGetBufferSubDataARB"));
++ SET_IsBufferARB(disp, dlsym(RTLD_DEFAULT, "glIsBufferARB"));
++ SET_MapBufferARB(disp, dlsym(RTLD_DEFAULT, "glMapBufferARB"));
++ SET_UnmapBufferARB(disp, dlsym(RTLD_DEFAULT, "glUnmapBufferARB"));
++
++ /* GL_ARB_vertex_program */
++ SET_DisableVertexAttribArrayARB(disp, dlsym(RTLD_DEFAULT, "glDisableVertexAttribArrayARB"));
++ SET_EnableVertexAttribArrayARB(disp, dlsym(RTLD_DEFAULT, "glEnableVertexAttribArrayARB"));
++ SET_GetProgramEnvParameterdvARB(disp, dlsym(RTLD_DEFAULT, "glGetProgramEnvParameterdvARB"));
++ SET_GetProgramEnvParameterfvARB(disp, dlsym(RTLD_DEFAULT, "glGetProgramEnvParameterfvARB"));
++ SET_GetProgramLocalParameterdvARB(disp, dlsym(RTLD_DEFAULT, "glGetProgramLocalParameterdvARB"));
++ SET_GetProgramLocalParameterfvARB(disp, dlsym(RTLD_DEFAULT, "glGetProgramLocalParameterfvARB"));
++ SET_GetProgramStringARB(disp, dlsym(RTLD_DEFAULT, "glGetProgramStringARB"));
++ SET_GetProgramivARB(disp, dlsym(RTLD_DEFAULT, "glGetProgramivARB"));
++ SET_GetVertexAttribdvARB(disp, dlsym(RTLD_DEFAULT, "glGetVertexAttribdvARB"));
++ SET_GetVertexAttribfvARB(disp, dlsym(RTLD_DEFAULT, "glGetVertexAttribfvARB"));
++ SET_GetVertexAttribivARB(disp, dlsym(RTLD_DEFAULT, "glGetVertexAttribivARB"));
++ SET_ProgramEnvParameter4dARB(disp, dlsym(RTLD_DEFAULT, "glProgramEnvParameter4dARB"));
++ SET_ProgramEnvParameter4dvARB(disp, dlsym(RTLD_DEFAULT, "glProgramEnvParameter4dvARB"));
++ SET_ProgramEnvParameter4fARB(disp, dlsym(RTLD_DEFAULT, "glProgramEnvParameter4fARB"));
++ SET_ProgramEnvParameter4fvARB(disp, dlsym(RTLD_DEFAULT, "glProgramEnvParameter4fvARB"));
++ SET_ProgramLocalParameter4dARB(disp, dlsym(RTLD_DEFAULT, "glProgramLocalParameter4dARB"));
++ SET_ProgramLocalParameter4dvARB(disp, dlsym(RTLD_DEFAULT, "glProgramLocalParameter4dvARB"));
++ SET_ProgramLocalParameter4fARB(disp, dlsym(RTLD_DEFAULT, "glProgramLocalParameter4fARB"));
++ SET_ProgramLocalParameter4fvARB(disp, dlsym(RTLD_DEFAULT, "glProgramLocalParameter4fvARB"));
++ SET_ProgramStringARB(disp, dlsym(RTLD_DEFAULT, "glProgramStringARB"));
++ SET_VertexAttrib1dARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib1dARB"));
++ SET_VertexAttrib1dvARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib1dvARB"));
++ SET_VertexAttrib1fARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib1fARB"));
++ SET_VertexAttrib1fvARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib1fvARB"));
++ SET_VertexAttrib1sARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib1sARB"));
++ SET_VertexAttrib1svARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib1svARB"));
++ SET_VertexAttrib2dARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib2dARB"));
++ SET_VertexAttrib2dvARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib2dvARB"));
++ SET_VertexAttrib2fARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib2fARB"));
++ SET_VertexAttrib2fvARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib2fvARB"));
++ SET_VertexAttrib2sARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib2sARB"));
++ SET_VertexAttrib2svARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib2svARB"));
++ SET_VertexAttrib3dARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib3dARB"));
++ SET_VertexAttrib3dvARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib3dvARB"));
++ SET_VertexAttrib3fARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib3fARB"));
++ SET_VertexAttrib3fvARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib3fvARB"));
++ SET_VertexAttrib3sARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib3sARB"));
++ SET_VertexAttrib3svARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib3svARB"));
++ SET_VertexAttrib4NbvARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4NbvARB"));
++ SET_VertexAttrib4NivARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4NivARB"));
++ SET_VertexAttrib4NsvARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4NsvARB"));
++ SET_VertexAttrib4NubARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4NubARB"));
++ SET_VertexAttrib4NubvARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4NubvARB"));
++ SET_VertexAttrib4NuivARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4NuivARB"));
++ SET_VertexAttrib4NusvARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4NusvARB"));
++ SET_VertexAttrib4bvARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4bvARB"));
++ SET_VertexAttrib4dARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4dARB"));
++ SET_VertexAttrib4dvARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4dvARB"));
++ SET_VertexAttrib4fARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4fARB"));
++ SET_VertexAttrib4fvARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4fvARB"));
++ SET_VertexAttrib4ivARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4ivARB"));
++ SET_VertexAttrib4sARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4sARB"));
++ SET_VertexAttrib4svARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4svARB"));
++ SET_VertexAttrib4ubvARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4ubvARB"));
++ SET_VertexAttrib4uivARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4uivARB"));
++ SET_VertexAttrib4usvARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4usvARB"));
++ SET_VertexAttribPointerARB(disp, dlsym(RTLD_DEFAULT, "glVertexAttribPointerARB"));
++
++ /* GL_ARB_vertex_shader */
++ SET_BindAttribLocationARB(disp, dlsym(RTLD_DEFAULT, "glBindAttribLocationARB"));
++ SET_GetActiveAttribARB(disp, dlsym(RTLD_DEFAULT, "glGetActiveAttribARB"));
++ SET_GetAttribLocationARB(disp, dlsym(RTLD_DEFAULT, "glGetAttribLocationARB"));
++
++ /* GL_ARB_window_pos */
++ SET_WindowPos2dMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos2dARB"));
++ SET_WindowPos2dvMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos2dvARB"));
++ SET_WindowPos2fMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos2fARB"));
++ SET_WindowPos2fvMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos2fvARB"));
++ SET_WindowPos2iMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos2iARB"));
++ SET_WindowPos2ivMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos2ivARB"));
++ SET_WindowPos2sMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos2sARB"));
++ SET_WindowPos2svMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos2svARB"));
++ SET_WindowPos3dMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos3dARB"));
++ SET_WindowPos3dvMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos3dvARB"));
++ SET_WindowPos3fMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos3fARB"));
++ SET_WindowPos3fvMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos3fvARB"));
++ SET_WindowPos3iMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos3iARB"));
++ SET_WindowPos3ivMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos3ivARB"));
++ SET_WindowPos3sMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos3sARB"));
++ SET_WindowPos3svMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos3svARB"));
++
++ /* GL_ATI_fragment_shader / GL_EXT_fragment_shader */
++ if(dlsym(RTLD_DEFAULT, "glAlphaFragmentOp1ATI")) {
++ /* GL_ATI_fragment_shader */
++ SET_AlphaFragmentOp1ATI(disp, dlsym(RTLD_DEFAULT, "glAlphaFragmentOp1ATI"));
++ SET_AlphaFragmentOp2ATI(disp, dlsym(RTLD_DEFAULT, "glAlphaFragmentOp2ATI"));
++ SET_AlphaFragmentOp3ATI(disp, dlsym(RTLD_DEFAULT, "glAlphaFragmentOp3ATI"));
++ SET_BeginFragmentShaderATI(disp, dlsym(RTLD_DEFAULT, "glBeginFragmentShaderATI"));
++ SET_BindFragmentShaderATI(disp, dlsym(RTLD_DEFAULT, "glBindFragmentShaderATI"));
++ SET_ColorFragmentOp1ATI(disp, dlsym(RTLD_DEFAULT, "glColorFragmentOp1ATI"));
++ SET_ColorFragmentOp2ATI(disp, dlsym(RTLD_DEFAULT, "glColorFragmentOp2ATI"));
++ SET_ColorFragmentOp3ATI(disp, dlsym(RTLD_DEFAULT, "glColorFragmentOp3ATI"));
++ SET_DeleteFragmentShaderATI(disp, dlsym(RTLD_DEFAULT, "glDeleteFragmentShaderATI"));
++ SET_EndFragmentShaderATI(disp, dlsym(RTLD_DEFAULT, "glEndFragmentShaderATI"));
++ SET_GenFragmentShadersATI(disp, dlsym(RTLD_DEFAULT, "glGenFragmentShadersATI"));
++ SET_PassTexCoordATI(disp, dlsym(RTLD_DEFAULT, "glPassTexCoordATI"));
++ SET_SampleMapATI(disp, dlsym(RTLD_DEFAULT, "glSampleMapATI"));
++ SET_SetFragmentShaderConstantATI(disp, dlsym(RTLD_DEFAULT, "glSetFragmentShaderConstantATI"));
++ } else {
++ /* GL_EXT_fragment_shader */
++ SET_AlphaFragmentOp1ATI(disp, dlsym(RTLD_DEFAULT, "glAlphaFragmentOp1EXT"));
++ SET_AlphaFragmentOp2ATI(disp, dlsym(RTLD_DEFAULT, "glAlphaFragmentOp2EXT"));
++ SET_AlphaFragmentOp3ATI(disp, dlsym(RTLD_DEFAULT, "glAlphaFragmentOp3EXT"));
++ SET_BeginFragmentShaderATI(disp, dlsym(RTLD_DEFAULT, "glBeginFragmentShaderEXT"));
++ SET_BindFragmentShaderATI(disp, dlsym(RTLD_DEFAULT, "glBindFragmentShaderEXT"));
++ SET_ColorFragmentOp1ATI(disp, dlsym(RTLD_DEFAULT, "glColorFragmentOp1EXT"));
++ SET_ColorFragmentOp2ATI(disp, dlsym(RTLD_DEFAULT, "glColorFragmentOp2EXT"));
++ SET_ColorFragmentOp3ATI(disp, dlsym(RTLD_DEFAULT, "glColorFragmentOp3EXT"));
++ SET_DeleteFragmentShaderATI(disp, dlsym(RTLD_DEFAULT, "glDeleteFragmentShaderEXT"));
++ SET_EndFragmentShaderATI(disp, dlsym(RTLD_DEFAULT, "glEndFragmentShaderEXT"));
++ SET_GenFragmentShadersATI(disp, dlsym(RTLD_DEFAULT, "glGenFragmentShadersEXT"));
++ SET_PassTexCoordATI(disp, dlsym(RTLD_DEFAULT, "glPassTexCoordEXT"));
++ SET_SampleMapATI(disp, dlsym(RTLD_DEFAULT, "glSampleMapEXT"));
++ SET_SetFragmentShaderConstantATI(disp, dlsym(RTLD_DEFAULT, "glSetFragmentShaderConstantEXT"));
++ }
+
+-#if GL_EXT_gpu_program_parameters
+- SET_ProgramEnvParameters4fvEXT(disp, glProgramEnvParameters4fvEXT);
+- SET_ProgramLocalParameters4fvEXT(disp, glProgramLocalParameters4fvEXT);
+-#endif
++ /* GL_ATI_separate_stencil */
++ SET_StencilFuncSeparateATI(disp, dlsym(RTLD_DEFAULT, "glStencilFuncSeparateATI"));
++
++ /* GL_EXT_blend_equation_separate */
++ SET_BlendEquationSeparateEXT(disp, dlsym(RTLD_DEFAULT, "glBlendEquationSeparateEXT"));
++
++ /* GL_EXT_blend_func_separate */
++ SET_BlendFuncSeparateEXT(disp, dlsym(RTLD_DEFAULT, "glBlendFuncSeparateEXT"));
++
++ /* GL_EXT_depth_bounds_test */
++ SET_DepthBoundsEXT(disp, dlsym(RTLD_DEFAULT, "glDepthBoundsEXT"));
++
++ /* GL_EXT_compiled_vertex_array */
++ SET_LockArraysEXT(disp, dlsym(RTLD_DEFAULT, "glLockArraysEXT"));
++ SET_UnlockArraysEXT(disp, dlsym(RTLD_DEFAULT, "glUnlockArraysEXT"));
++
++ /* GL_EXT_cull_vertex */
++ SET_CullParameterdvEXT(disp, dlsym(RTLD_DEFAULT, "glCullParameterdvEXT"));
++ SET_CullParameterfvEXT(disp, dlsym(RTLD_DEFAULT, "glCullParameterfvEXT"));
++
++ /* GL_EXT_fog_coord */
++ SET_FogCoordPointerEXT(disp, dlsym(RTLD_DEFAULT, "glFogCoordPointerEXT"));
++ SET_FogCoorddEXT(disp, dlsym(RTLD_DEFAULT, "glFogCoorddEXT"));
++ SET_FogCoorddvEXT(disp, dlsym(RTLD_DEFAULT, "glFogCoorddvEXT"));
++ SET_FogCoordfEXT(disp, dlsym(RTLD_DEFAULT, "glFogCoordfEXT"));
++ SET_FogCoordfvEXT(disp, dlsym(RTLD_DEFAULT, "glFogCoordfvEXT"));
++
++ /* GL_EXT_framebuffer_blit */
++ SET_BlitFramebufferEXT(disp, dlsym(RTLD_DEFAULT, "glBlitFramebufferEXT"));
++
++ /* GL_EXT_framebuffer_object */
++ SET_BindFramebufferEXT(disp, dlsym(RTLD_DEFAULT, "glBindFramebufferEXT"));
++ SET_BindRenderbufferEXT(disp, dlsym(RTLD_DEFAULT, "glBindRenderbufferEXT"));
++ SET_CheckFramebufferStatusEXT(disp, dlsym(RTLD_DEFAULT, "glCheckFramebufferStatusEXT"));
++ SET_DeleteFramebuffersEXT(disp, dlsym(RTLD_DEFAULT, "glDeleteFramebuffersEXT"));
++ SET_DeleteRenderbuffersEXT(disp, dlsym(RTLD_DEFAULT, "glDeleteRenderbuffersEXT"));
++ SET_FramebufferRenderbufferEXT(disp, dlsym(RTLD_DEFAULT, "glFramebufferRenderbufferEXT"));
++ SET_FramebufferTexture1DEXT(disp, dlsym(RTLD_DEFAULT, "glFramebufferTexture1DEXT"));
++ SET_FramebufferTexture2DEXT(disp, dlsym(RTLD_DEFAULT, "glFramebufferTexture2DEXT"));
++ SET_FramebufferTexture3DEXT(disp, dlsym(RTLD_DEFAULT, "glFramebufferTexture3DEXT"));
++ SET_GenerateMipmapEXT(disp, dlsym(RTLD_DEFAULT, "glGenerateMipmapEXT"));
++ SET_GenFramebuffersEXT(disp, dlsym(RTLD_DEFAULT, "glGenFramebuffersEXT"));
++ SET_GenRenderbuffersEXT(disp, dlsym(RTLD_DEFAULT, "glGenRenderbuffersEXT"));
++ SET_GetFramebufferAttachmentParameterivEXT(disp, dlsym(RTLD_DEFAULT, "glGetFramebufferAttachmentParameterivEXT"));
++ SET_GetRenderbufferParameterivEXT(disp, dlsym(RTLD_DEFAULT, "glGetRenderbufferParameterivEXT"));
++ SET_IsFramebufferEXT(disp, dlsym(RTLD_DEFAULT, "glIsFramebufferEXT"));
++ SET_IsRenderbufferEXT(disp, dlsym(RTLD_DEFAULT, "glIsRenderbufferEXT"));
++ SET_RenderbufferStorageEXT(disp, dlsym(RTLD_DEFAULT, "glRenderbufferStorageEXT"));
++
++ /* GL_EXT_gpu_program_parameters */
++ SET_ProgramEnvParameters4fvEXT(disp, dlsym(RTLD_DEFAULT, "glProgramEnvParameters4fvEXT"));
++ SET_ProgramLocalParameters4fvEXT(disp, dlsym(RTLD_DEFAULT, "glProgramLocalParameters4fvEXT"));
+
+-#if GL_EXT_multi_draw_arrays
+ /* Pointer Incompatability:
+ * This warning can be safely ignored. OpenGL.framework adds const to the
+ * two pointers.
+@@ -1414,206 +1311,193 @@ static void setup_dispatch_table(void) {
+ *
+ * void ( * MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount);
+ */
+- SET_MultiDrawArraysEXT(disp, (void *)glMultiDrawArraysEXT);
+- SET_MultiDrawElementsEXT(disp, glMultiDrawElementsEXT);
+-#endif
+-
+-#if GL_EXT_point_parameters
+- SET_PointParameterfEXT(disp, glPointParameterfEXT);
+- SET_PointParameterfvEXT(disp, glPointParameterfvEXT);
+-#elif GL_ARB_point_parameters
+- SET_PointParameterfEXT(disp, glPointParameterfARB);
+- SET_PointParameterfvEXT(disp, glPointParameterfvARB);
+-#endif
+-
+-#if GL_EXT_polygon_offset
+- SET_PolygonOffsetEXT(disp, glPolygonOffsetEXT);
+-#endif
+
+-#if GL_EXT_secondary_color
+- SET_SecondaryColor3bEXT(disp, glSecondaryColor3bEXT);
+- SET_SecondaryColor3bvEXT(disp, glSecondaryColor3bvEXT);
+- SET_SecondaryColor3dEXT(disp, glSecondaryColor3dEXT);
+- SET_SecondaryColor3dvEXT(disp, glSecondaryColor3dvEXT);
+- SET_SecondaryColor3fEXT(disp, glSecondaryColor3fEXT);
+- SET_SecondaryColor3fvEXT(disp, glSecondaryColor3fvEXT);
+- SET_SecondaryColor3iEXT(disp, glSecondaryColor3iEXT);
+- SET_SecondaryColor3ivEXT(disp, glSecondaryColor3ivEXT);
+- SET_SecondaryColor3sEXT(disp, glSecondaryColor3sEXT);
+- SET_SecondaryColor3svEXT(disp, glSecondaryColor3svEXT);
+- SET_SecondaryColor3ubEXT(disp, glSecondaryColor3ubEXT);
+- SET_SecondaryColor3ubvEXT(disp, glSecondaryColor3ubvEXT);
+- SET_SecondaryColor3uiEXT(disp, glSecondaryColor3uiEXT);
+- SET_SecondaryColor3uivEXT(disp, glSecondaryColor3uivEXT);
+- SET_SecondaryColor3usEXT(disp, glSecondaryColor3usEXT);
+- SET_SecondaryColor3usvEXT(disp, glSecondaryColor3usvEXT);
+- SET_SecondaryColorPointerEXT(disp, glSecondaryColorPointerEXT);
+-#endif
+-
+-#if GL_EXT_stencil_two_side
+- SET_ActiveStencilFaceEXT(disp, glActiveStencilFaceEXT);
+-#endif
+-
+-#if GL_EXT_timer_query
+- SET_GetQueryObjecti64vEXT(disp, glGetQueryObjecti64vEXT);
+- SET_GetQueryObjectui64vEXT(disp, glGetQueryObjectui64vEXT);
+-#endif
+-
+-#if GL_EXT_vertex_array
+- SET_ColorPointerEXT(disp, glColorPointerEXT);
+- SET_EdgeFlagPointerEXT(disp, glEdgeFlagPointerEXT);
+- SET_IndexPointerEXT(disp, glIndexPointerEXT);
+- SET_NormalPointerEXT(disp, glNormalPointerEXT);
+- SET_TexCoordPointerEXT(disp, glTexCoordPointerEXT);
+- SET_VertexPointerEXT(disp, glVertexPointerEXT);
+-#endif
+-
+-#if GL_IBM_multimode_draw_arrays
+- SET_MultiModeDrawArraysIBM(disp, glMultiModeDrawArraysIBM);
+- SET_MultiModeDrawElementsIBM(disp, glMultiModeDrawElementsIBM);
+-#endif
+-
+-#if GL_MESA_resize_buffers
+- SET_ResizeBuffersMESA(disp, glResizeBuffersMESA);
+-#endif
+-
+-#if GL_MESA_window_pos
+- SET_WindowPos4dMESA(disp, glWindowPos4dMESA);
+- SET_WindowPos4dvMESA(disp, glWindowPos4dvMESA);
+- SET_WindowPos4fMESA(disp, glWindowPos4fMESA);
+- SET_WindowPos4fvMESA(disp, glWindowPos4fvMESA);
+- SET_WindowPos4iMESA(disp, glWindowPos4iMESA);
+- SET_WindowPos4ivMESA(disp, glWindowPos4ivMESA);
+- SET_WindowPos4sMESA(disp, glWindowPos4sMESA);
+- SET_WindowPos4svMESA(disp, glWindowPos4svMESA);
+-#endif
+-
+-#if GL_NV_fence
+- SET_DeleteFencesNV(disp, glDeleteFencesNV);
+- SET_FinishFenceNV(disp, glFinishFenceNV);
+- SET_GenFencesNV(disp, glGenFencesNV);
+- SET_GetFenceivNV(disp, glGetFenceivNV);
+- SET_IsFenceNV(disp, glIsFenceNV);
+- SET_SetFenceNV(disp, glSetFenceNV);
+- SET_TestFenceNV(disp, glTestFenceNV);
+-#endif
+-
+-#if GL_NV_fragment_program
+- SET_GetProgramNamedParameterdvNV(disp, glGetProgramNamedParameterdvNV);
+- SET_GetProgramNamedParameterfvNV(disp, glGetProgramNamedParameterfvNV);
+- SET_ProgramNamedParameter4dNV(disp, glProgramNamedParameter4dNV);
+- SET_ProgramNamedParameter4dvNV(disp, glProgramNamedParameter4dvNV);
+- SET_ProgramNamedParameter4fNV(disp, glProgramNamedParameter4fNV);
+- SET_ProgramNamedParameter4fvNV(disp, glProgramNamedParameter4fvNV);
+-#endif
+-
+-#if GL_NV_geometry_program4
+- SET_FramebufferTextureLayerEXT(disp, glFramebufferTextureLayerEXT);
+-#endif
+-
+-#if GL_NV_point_sprite
+- SET_PointParameteriNV(disp, glPointParameteriNV);
+- SET_PointParameterivNV(disp, glPointParameterivNV);
+-#endif
+-
+-#if GL_NV_register_combiners
+- SET_CombinerInputNV(disp, glCombinerInputNV);
+- SET_CombinerOutputNV(disp, glCombinerOutputNV);
+- SET_CombinerParameterfNV(disp, glCombinerParameterfNV);
+- SET_CombinerParameterfvNV(disp, glCombinerParameterfvNV);
+- SET_CombinerParameteriNV(disp, glCombinerParameteriNV);
+- SET_CombinerParameterivNV(disp, glCombinerParameterivNV);
+- SET_FinalCombinerInputNV(disp, glFinalCombinerInputNV);
+- SET_GetCombinerInputParameterfvNV(disp, glGetCombinerInputParameterfvNV);
+- SET_GetCombinerInputParameterivNV(disp, glGetCombinerInputParameterivNV);
+- SET_GetCombinerOutputParameterfvNV(disp, glGetCombinerOutputParameterfvNV);
+- SET_GetCombinerOutputParameterivNV(disp, glGetCombinerOutputParameterivNV);
+- SET_GetFinalCombinerInputParameterfvNV(disp, glGetFinalCombinerInputParameterfvNV);
+- SET_GetFinalCombinerInputParameterivNV(disp, glGetFinalCombinerInputParameterivNV);
+-#endif
+-
+-#if GL_NV_vertex_array_range
+- SET_FlushVertexArrayRangeNV(disp, glFlushVertexArrayRangeNV);
+- SET_VertexArrayRangeNV(disp, glVertexArrayRangeNV);
+-#endif
+-
+-#if GL_NV_vertex_program
+- SET_AreProgramsResidentNV(disp, glAreProgramsResidentNV);
+- SET_BindProgramNV(disp, glBindProgramNV);
+- SET_DeleteProgramsNV(disp, glDeleteProgramsNV);
+- SET_ExecuteProgramNV(disp, glExecuteProgramNV);
+- SET_GenProgramsNV(disp, glGenProgramsNV);
+- SET_GetProgramParameterdvNV(disp, glGetProgramParameterdvNV);
+- SET_GetProgramParameterfvNV(disp, glGetProgramParameterfvNV);
+- SET_GetProgramStringNV(disp, glGetProgramStringNV);
+- SET_GetProgramivNV(disp, glGetProgramivNV);
+- SET_GetTrackMatrixivNV(disp, glGetTrackMatrixivNV);
+- SET_GetVertexAttribPointervNV(disp, glGetVertexAttribPointervNV);
+- SET_GetVertexAttribdvNV(disp, glGetVertexAttribdvNV);
+- SET_GetVertexAttribfvNV(disp, glGetVertexAttribfvNV);
+- SET_GetVertexAttribivNV(disp, glGetVertexAttribivNV);
+- SET_IsProgramNV(disp, glIsProgramNV);
+- SET_LoadProgramNV(disp, glLoadProgramNV);
+- SET_ProgramParameters4dvNV(disp, glProgramParameters4dvNV);
+- SET_ProgramParameters4fvNV(disp, glProgramParameters4fvNV);
+- SET_RequestResidentProgramsNV(disp, glRequestResidentProgramsNV);
+- SET_TrackMatrixNV(disp, glTrackMatrixNV);
+- SET_VertexAttrib1dNV(disp, glVertexAttrib1dNV)
+- SET_VertexAttrib1dvNV(disp, glVertexAttrib1dvNV)
+- SET_VertexAttrib1fNV(disp, glVertexAttrib1fNV)
+- SET_VertexAttrib1fvNV(disp, glVertexAttrib1fvNV)
+- SET_VertexAttrib1sNV(disp, glVertexAttrib1sNV)
+- SET_VertexAttrib1svNV(disp, glVertexAttrib1svNV)
+- SET_VertexAttrib2dNV(disp, glVertexAttrib2dNV)
+- SET_VertexAttrib2dvNV(disp, glVertexAttrib2dvNV)
+- SET_VertexAttrib2fNV(disp, glVertexAttrib2fNV)
+- SET_VertexAttrib2fvNV(disp, glVertexAttrib2fvNV)
+- SET_VertexAttrib2sNV(disp, glVertexAttrib2sNV)
+- SET_VertexAttrib2svNV(disp, glVertexAttrib2svNV)
+- SET_VertexAttrib3dNV(disp, glVertexAttrib3dNV)
+- SET_VertexAttrib3dvNV(disp, glVertexAttrib3dvNV)
+- SET_VertexAttrib3fNV(disp, glVertexAttrib3fNV)
+- SET_VertexAttrib3fvNV(disp, glVertexAttrib3fvNV)
+- SET_VertexAttrib3sNV(disp, glVertexAttrib3sNV)
+- SET_VertexAttrib3svNV(disp, glVertexAttrib3svNV)
+- SET_VertexAttrib4dNV(disp, glVertexAttrib4dNV)
+- SET_VertexAttrib4dvNV(disp, glVertexAttrib4dvNV)
+- SET_VertexAttrib4fNV(disp, glVertexAttrib4fNV)
+- SET_VertexAttrib4fvNV(disp, glVertexAttrib4fvNV)
+- SET_VertexAttrib4sNV(disp, glVertexAttrib4sNV)
+- SET_VertexAttrib4svNV(disp, glVertexAttrib4svNV)
+- SET_VertexAttrib4ubNV(disp, glVertexAttrib4ubNV)
+- SET_VertexAttrib4ubvNV(disp, glVertexAttrib4ubvNV)
+- SET_VertexAttribPointerNV(disp, glVertexAttribPointerNV)
+- SET_VertexAttribs1dvNV(disp, glVertexAttribs1dvNV)
+- SET_VertexAttribs1fvNV(disp, glVertexAttribs1fvNV)
+- SET_VertexAttribs1svNV(disp, glVertexAttribs1svNV)
+- SET_VertexAttribs2dvNV(disp, glVertexAttribs2dvNV)
+- SET_VertexAttribs2fvNV(disp, glVertexAttribs2fvNV)
+- SET_VertexAttribs2svNV(disp, glVertexAttribs2svNV)
+- SET_VertexAttribs3dvNV(disp, glVertexAttribs3dvNV)
+- SET_VertexAttribs3fvNV(disp, glVertexAttribs3fvNV)
+- SET_VertexAttribs3svNV(disp, glVertexAttribs3svNV)
+- SET_VertexAttribs4dvNV(disp, glVertexAttribs4dvNV)
+- SET_VertexAttribs4fvNV(disp, glVertexAttribs4fvNV)
+- SET_VertexAttribs4svNV(disp, glVertexAttribs4svNV)
+- SET_VertexAttribs4ubvNV(disp, glVertexAttribs4ubvNV)
+-#endif
+-
+-#if GL_SGIS_multisample
+- SET_SampleMaskSGIS(disp, glSampleMaskSGIS);
+- SET_SamplePatternSGIS(disp, glSamplePatternSGIS);
+-#endif
++ /* GL_EXT_multi_draw_arrays */
++ SET_MultiDrawArraysEXT(disp, (void *)dlsym(RTLD_DEFAULT, "glMultiDrawArraysEXT"));
++ SET_MultiDrawElementsEXT(disp, dlsym(RTLD_DEFAULT, "glMultiDrawElementsEXT"));
++
++ /* GL_EXT_point_parameters / GL_ARB_point_parameters */
++ if(dlsym(RTLD_DEFAULT, "glPointParameterfEXT")) {
++ /* GL_EXT_point_parameters */
++ SET_PointParameterfEXT(disp, dlsym(RTLD_DEFAULT, "glPointParameterfEXT"));
++ SET_PointParameterfvEXT(disp, dlsym(RTLD_DEFAULT, "glPointParameterfvEXT"));
++ } else {
++ /* GL_ARB_point_parameters */
++ SET_PointParameterfEXT(disp, dlsym(RTLD_DEFAULT, "glPointParameterfARB"));
++ SET_PointParameterfvEXT(disp, dlsym(RTLD_DEFAULT, "glPointParameterfvARB"));
++ }
+
+-#if GL_SGIS_pixel_texture
+- SET_GetPixelTexGenParameterfvSGIS(disp, glGetPixelTexGenParameterfvSGIS);
+- SET_GetPixelTexGenParameterivSGIS(disp, glGetPixelTexGenParameterivSGIS);
+- SET_PixelTexGenParameterfSGIS(disp, glPixelTexGenParameterfSGIS);
+- SET_PixelTexGenParameterfvSGIS(disp, glPixelTexGenParameterfvSGIS);
+- SET_PixelTexGenParameteriSGIS(disp, glPixelTexGenParameteriSGIS);
+- SET_PixelTexGenParameterivSGIS(disp, glPixelTexGenParameterivSGIS);
+- SET_PixelTexGenSGIX(disp, glPixelTexGenSGIX);
+-#endif
++ /* GL_EXT_polygon_offset */
++ SET_PolygonOffsetEXT(disp, dlsym(RTLD_DEFAULT, "glPolygonOffsetEXT"));
++
++ /* GL_EXT_secondary_color */
++ SET_SecondaryColor3bEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColor3bEXT"));
++ SET_SecondaryColor3bvEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColor3bvEXT"));
++ SET_SecondaryColor3dEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColor3dEXT"));
++ SET_SecondaryColor3dvEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColor3dvEXT"));
++ SET_SecondaryColor3fEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColor3fEXT"));
++ SET_SecondaryColor3fvEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColor3fvEXT"));
++ SET_SecondaryColor3iEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColor3iEXT"));
++ SET_SecondaryColor3ivEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColor3ivEXT"));
++ SET_SecondaryColor3sEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColor3sEXT"));
++ SET_SecondaryColor3svEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColor3svEXT"));
++ SET_SecondaryColor3ubEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColor3ubEXT"));
++ SET_SecondaryColor3ubvEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColor3ubvEXT"));
++ SET_SecondaryColor3uiEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColor3uiEXT"));
++ SET_SecondaryColor3uivEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColor3uivEXT"));
++ SET_SecondaryColor3usEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColor3usEXT"));
++ SET_SecondaryColor3usvEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColor3usvEXT"));
++ SET_SecondaryColorPointerEXT(disp, dlsym(RTLD_DEFAULT, "glSecondaryColorPointerEXT"));
++
++ /* GL_EXT_stencil_two_side */
++ SET_ActiveStencilFaceEXT(disp, dlsym(RTLD_DEFAULT, "glActiveStencilFaceEXT"));
++
++ /* GL_EXT_timer_query */
++ SET_GetQueryObjecti64vEXT(disp, dlsym(RTLD_DEFAULT, "glGetQueryObjecti64vEXT"));
++ SET_GetQueryObjectui64vEXT(disp, dlsym(RTLD_DEFAULT, "glGetQueryObjectui64vEXT"));
++
++ /* GL_EXT_vertex_array */
++ SET_ColorPointerEXT(disp, dlsym(RTLD_DEFAULT, "glColorPointerEXT"));
++ SET_EdgeFlagPointerEXT(disp, dlsym(RTLD_DEFAULT, "glEdgeFlagPointerEXT"));
++ SET_IndexPointerEXT(disp, dlsym(RTLD_DEFAULT, "glIndexPointerEXT"));
++ SET_NormalPointerEXT(disp, dlsym(RTLD_DEFAULT, "glNormalPointerEXT"));
++ SET_TexCoordPointerEXT(disp, dlsym(RTLD_DEFAULT, "glTexCoordPointerEXT"));
++ SET_VertexPointerEXT(disp, dlsym(RTLD_DEFAULT, "glVertexPointerEXT"));
++
++ /* GL_IBM_multimode_draw_arrays */
++ SET_MultiModeDrawArraysIBM(disp, dlsym(RTLD_DEFAULT, "glMultiModeDrawArraysIBM"));
++ SET_MultiModeDrawElementsIBM(disp, dlsym(RTLD_DEFAULT, "glMultiModeDrawElementsIBM"));
++
++ /* GL_MESA_resize_buffers */
++ SET_ResizeBuffersMESA(disp, dlsym(RTLD_DEFAULT, "glResizeBuffersMESA"));
++
++ /* GL_MESA_window_pos */
++ SET_WindowPos4dMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos4dMESA"));
++ SET_WindowPos4dvMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos4dvMESA"));
++ SET_WindowPos4fMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos4fMESA"));
++ SET_WindowPos4fvMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos4fvMESA"));
++ SET_WindowPos4iMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos4iMESA"));
++ SET_WindowPos4ivMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos4ivMESA"));
++ SET_WindowPos4sMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos4sMESA"));
++ SET_WindowPos4svMESA(disp, dlsym(RTLD_DEFAULT, "glWindowPos4svMESA"));
++
++ /* GL_NV_fence */
++ SET_DeleteFencesNV(disp, dlsym(RTLD_DEFAULT, "glDeleteFencesNV"));
++ SET_FinishFenceNV(disp, dlsym(RTLD_DEFAULT, "glFinishFenceNV"));
++ SET_GenFencesNV(disp, dlsym(RTLD_DEFAULT, "glGenFencesNV"));
++ SET_GetFenceivNV(disp, dlsym(RTLD_DEFAULT, "glGetFenceivNV"));
++ SET_IsFenceNV(disp, dlsym(RTLD_DEFAULT, "glIsFenceNV"));
++ SET_SetFenceNV(disp, dlsym(RTLD_DEFAULT, "glSetFenceNV"));
++ SET_TestFenceNV(disp, dlsym(RTLD_DEFAULT, "glTestFenceNV"));
++
++ /* GL_NV_fragment_program */
++ SET_GetProgramNamedParameterdvNV(disp, dlsym(RTLD_DEFAULT, "glGetProgramNamedParameterdvNV"));
++ SET_GetProgramNamedParameterfvNV(disp, dlsym(RTLD_DEFAULT, "glGetProgramNamedParameterfvNV"));
++ SET_ProgramNamedParameter4dNV(disp, dlsym(RTLD_DEFAULT, "glProgramNamedParameter4dNV"));
++ SET_ProgramNamedParameter4dvNV(disp, dlsym(RTLD_DEFAULT, "glProgramNamedParameter4dvNV"));
++ SET_ProgramNamedParameter4fNV(disp, dlsym(RTLD_DEFAULT, "glProgramNamedParameter4fNV"));
++ SET_ProgramNamedParameter4fvNV(disp, dlsym(RTLD_DEFAULT, "glProgramNamedParameter4fvNV"));
++
++ /* GL_NV_geometry_program4 */
++ SET_FramebufferTextureLayerEXT(disp, dlsym(RTLD_DEFAULT, "glFramebufferTextureLayerEXT"));
++
++ /* GL_NV_point_sprite */
++ SET_PointParameteriNV(disp, dlsym(RTLD_DEFAULT, "glPointParameteriNV"));
++ SET_PointParameterivNV(disp, dlsym(RTLD_DEFAULT, "glPointParameterivNV"));
++
++ /* GL_NV_register_combiners */
++ SET_CombinerInputNV(disp, dlsym(RTLD_DEFAULT, "glCombinerInputNV"));
++ SET_CombinerOutputNV(disp, dlsym(RTLD_DEFAULT, "glCombinerOutputNV"));
++ SET_CombinerParameterfNV(disp, dlsym(RTLD_DEFAULT, "glCombinerParameterfNV"));
++ SET_CombinerParameterfvNV(disp, dlsym(RTLD_DEFAULT, "glCombinerParameterfvNV"));
++ SET_CombinerParameteriNV(disp, dlsym(RTLD_DEFAULT, "glCombinerParameteriNV"));
++ SET_CombinerParameterivNV(disp, dlsym(RTLD_DEFAULT, "glCombinerParameterivNV"));
++ SET_FinalCombinerInputNV(disp, dlsym(RTLD_DEFAULT, "glFinalCombinerInputNV"));
++ SET_GetCombinerInputParameterfvNV(disp, dlsym(RTLD_DEFAULT, "glGetCombinerInputParameterfvNV"));
++ SET_GetCombinerInputParameterivNV(disp, dlsym(RTLD_DEFAULT, "glGetCombinerInputParameterivNV"));
++ SET_GetCombinerOutputParameterfvNV(disp, dlsym(RTLD_DEFAULT, "glGetCombinerOutputParameterfvNV"));
++ SET_GetCombinerOutputParameterivNV(disp, dlsym(RTLD_DEFAULT, "glGetCombinerOutputParameterivNV"));
++ SET_GetFinalCombinerInputParameterfvNV(disp, dlsym(RTLD_DEFAULT, "glGetFinalCombinerInputParameterfvNV"));
++ SET_GetFinalCombinerInputParameterivNV(disp, dlsym(RTLD_DEFAULT, "glGetFinalCombinerInputParameterivNV"));
++
++ /* GL_NV_vertex_array_range */
++ SET_FlushVertexArrayRangeNV(disp, dlsym(RTLD_DEFAULT, "glFlushVertexArrayRangeNV"));
++ SET_VertexArrayRangeNV(disp, dlsym(RTLD_DEFAULT, "glVertexArrayRangeNV"));
++
++ /* GL_NV_vertex_program */
++ SET_AreProgramsResidentNV(disp, dlsym(RTLD_DEFAULT, "glAreProgramsResidentNV"));
++ SET_BindProgramNV(disp, dlsym(RTLD_DEFAULT, "glBindProgramNV"));
++ SET_DeleteProgramsNV(disp, dlsym(RTLD_DEFAULT, "glDeleteProgramsNV"));
++ SET_ExecuteProgramNV(disp, dlsym(RTLD_DEFAULT, "glExecuteProgramNV"));
++ SET_GenProgramsNV(disp, dlsym(RTLD_DEFAULT, "glGenProgramsNV"));
++ SET_GetProgramParameterdvNV(disp, dlsym(RTLD_DEFAULT, "glGetProgramParameterdvNV"));
++ SET_GetProgramParameterfvNV(disp, dlsym(RTLD_DEFAULT, "glGetProgramParameterfvNV"));
++ SET_GetProgramStringNV(disp, dlsym(RTLD_DEFAULT, "glGetProgramStringNV"));
++ SET_GetProgramivNV(disp, dlsym(RTLD_DEFAULT, "glGetProgramivNV"));
++ SET_GetTrackMatrixivNV(disp, dlsym(RTLD_DEFAULT, "glGetTrackMatrixivNV"));
++ SET_GetVertexAttribPointervNV(disp, dlsym(RTLD_DEFAULT, "glGetVertexAttribPointervNV"));
++ SET_GetVertexAttribdvNV(disp, dlsym(RTLD_DEFAULT, "glGetVertexAttribdvNV"));
++ SET_GetVertexAttribfvNV(disp, dlsym(RTLD_DEFAULT, "glGetVertexAttribfvNV"));
++ SET_GetVertexAttribivNV(disp, dlsym(RTLD_DEFAULT, "glGetVertexAttribivNV"));
++ SET_IsProgramNV(disp, dlsym(RTLD_DEFAULT, "glIsProgramNV"));
++ SET_LoadProgramNV(disp, dlsym(RTLD_DEFAULT, "glLoadProgramNV"));
++ SET_ProgramParameters4dvNV(disp, dlsym(RTLD_DEFAULT, "glProgramParameters4dvNV"));
++ SET_ProgramParameters4fvNV(disp, dlsym(RTLD_DEFAULT, "glProgramParameters4fvNV"));
++ SET_RequestResidentProgramsNV(disp, dlsym(RTLD_DEFAULT, "glRequestResidentProgramsNV"));
++ SET_TrackMatrixNV(disp, dlsym(RTLD_DEFAULT, "glTrackMatrixNV"));
++ SET_VertexAttrib1dNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib1dNV"));
++ SET_VertexAttrib1dvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib1dvNV"));
++ SET_VertexAttrib1fNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib1fNV"));
++ SET_VertexAttrib1fvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib1fvNV"));
++ SET_VertexAttrib1sNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib1sNV"));
++ SET_VertexAttrib1svNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib1svNV"));
++ SET_VertexAttrib2dNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib2dNV"));
++ SET_VertexAttrib2dvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib2dvNV"));
++ SET_VertexAttrib2fNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib2fNV"));
++ SET_VertexAttrib2fvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib2fvNV"));
++ SET_VertexAttrib2sNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib2sNV"));
++ SET_VertexAttrib2svNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib2svNV"));
++ SET_VertexAttrib3dNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib3dNV"));
++ SET_VertexAttrib3dvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib3dvNV"));
++ SET_VertexAttrib3fNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib3fNV"));
++ SET_VertexAttrib3fvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib3fvNV"));
++ SET_VertexAttrib3sNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib3sNV"));
++ SET_VertexAttrib3svNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib3svNV"));
++ SET_VertexAttrib4dNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4dNV"));
++ SET_VertexAttrib4dvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4dvNV"));
++ SET_VertexAttrib4fNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4fNV"));
++ SET_VertexAttrib4fvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4fvNV"));
++ SET_VertexAttrib4sNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4sNV"));
++ SET_VertexAttrib4svNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4svNV"));
++ SET_VertexAttrib4ubNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4ubNV"));
++ SET_VertexAttrib4ubvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttrib4ubvNV"));
++ SET_VertexAttribPointerNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttribPointerNV"));
++ SET_VertexAttribs1dvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttribs1dvNV"));
++ SET_VertexAttribs1fvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttribs1fvNV"));
++ SET_VertexAttribs1svNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttribs1svNV"));
++ SET_VertexAttribs2dvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttribs2dvNV"));
++ SET_VertexAttribs2fvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttribs2fvNV"));
++ SET_VertexAttribs2svNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttribs2svNV"));
++ SET_VertexAttribs3dvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttribs3dvNV"));
++ SET_VertexAttribs3fvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttribs3fvNV"));
++ SET_VertexAttribs3svNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttribs3svNV"));
++ SET_VertexAttribs4dvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttribs4dvNV"));
++ SET_VertexAttribs4fvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttribs4fvNV"));
++ SET_VertexAttribs4svNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttribs4svNV"));
++ SET_VertexAttribs4ubvNV(disp, dlsym(RTLD_DEFAULT, "glVertexAttribs4ubvNV"));
++
++ /* GL_SGIS_multisample */
++ SET_SampleMaskSGIS(disp, dlsym(RTLD_DEFAULT, "glSampleMaskSGIS"));
++ SET_SamplePatternSGIS(disp, dlsym(RTLD_DEFAULT, "glSamplePatternSGIS"));
++
++ /* GL_SGIS_pixel_texture */
++ SET_GetPixelTexGenParameterfvSGIS(disp, dlsym(RTLD_DEFAULT, "glGetPixelTexGenParameterfvSGIS"));
++ SET_GetPixelTexGenParameterivSGIS(disp, dlsym(RTLD_DEFAULT, "glGetPixelTexGenParameterivSGIS"));
++ SET_PixelTexGenParameterfSGIS(disp, dlsym(RTLD_DEFAULT, "glPixelTexGenParameterfSGIS"));
++ SET_PixelTexGenParameterfvSGIS(disp, dlsym(RTLD_DEFAULT, "glPixelTexGenParameterfvSGIS"));
++ SET_PixelTexGenParameteriSGIS(disp, dlsym(RTLD_DEFAULT, "glPixelTexGenParameteriSGIS"));
++ SET_PixelTexGenParameterivSGIS(disp, dlsym(RTLD_DEFAULT, "glPixelTexGenParameterivSGIS"));
++ SET_PixelTexGenSGIX(disp, dlsym(RTLD_DEFAULT, "glPixelTexGenSGIX"));
+
+ _glapi_set_dispatch(disp);
+ }
+--
+1.7.5.2
+
Added: trunk/dports/x11/xorg-server-devel/files/0013-XQuartz-AIGLX-Remove-unnecessary-includes-in-indirec.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/0013-XQuartz-AIGLX-Remove-unnecessary-includes-in-indirec.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/0013-XQuartz-AIGLX-Remove-unnecessary-includes-in-indirec.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -0,0 +1,76 @@
+From 0ec78a0cda64453bba2d69abc0c779803a62ba50 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Fri, 3 Jun 2011 02:50:40 -0400
+Subject: [PATCH 13/16] XQuartz: AIGLX: Remove unnecessary includes in
+ indirect.c
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+ hw/xquartz/GL/indirect.c | 32 +++++++++-----------------------
+ 1 files changed, 9 insertions(+), 23 deletions(-)
+
+diff --git xorg-server-1.10.99.901/hw/xquartz/GL/indirect.c xorg-server-1.10.99.901/hw/xquartz/GL/indirect.c
+index 40f1e93..ca25e73 100644
+--- xorg-server-1.10.99.901/hw/xquartz/GL/indirect.c
++++ xorg-server-1.10.99.901/hw/xquartz/GL/indirect.c
+@@ -35,48 +35,34 @@
+ #include <dix-config.h>
+ #endif
+
+-#include "dri.h"
+-
+ #include <AvailabilityMacros.h>
+
+ #include <dlfcn.h>
+
+-#define GL_GLEXT_WUNDEF_SUPPORT
+-
+ #include <OpenGL/OpenGL.h>
+-#include <OpenGL/CGLContext.h>
++#include <OpenGL/gl.h> /* Just to prevent glxserver.h from loading mesa's and colliding with OpenGL.h */
+
++#include <X11/Xproto.h>
+ #include <GL/glxproto.h>
+-#include <windowstr.h>
+-#include <resource.h>
+-#include <GL/glxint.h>
+-#include <GL/glxtokens.h>
+-#include <scrnintstr.h>
++
+ #include <glxserver.h>
+-#include <glxscreens.h>
+-#include <glxdrawable.h>
+-#include <glxcontext.h>
+-#include <glxext.h>
+ #include <glxutil.h>
+-#include <GL/internal/glcore.h>
+-#include "x-hash.h"
+-#include "x-list.h"
+-
+-//#include "capabilities.h"
+-#include "visualConfigs.h"
+
+ typedef unsigned long long GLuint64EXT;
+ typedef long long GLint64EXT;
+ #include <dispatch.h>
+-#include <Xplugin.h>
+ #include <glapi.h>
+-#include <glapitable.h>
+
+-__GLXprovider * GlxGetDRISWrastProvider (void);
++#include "x-hash.h"
++
++#include "visualConfigs.h"
++#include "dri.h"
+
+ #include "darwin.h"
+ #define GLAQUA_DEBUG_MSG(msg, args...) ASL_LOG(ASL_LEVEL_DEBUG, "GLXAqua", msg, ##args)
+
++__GLXprovider * GlxGetDRISWrastProvider (void);
++
+ static void setup_dispatch_table(void);
+ GLuint __glFloorLog2(GLuint val);
+ void warn_func(void * p1, char *format, ...);
+--
+1.7.5.2
+
Deleted: trunk/dports/x11/xorg-server-devel/files/5001-Workaround-the-GC-clipping-problem-in-miPaintWindow-.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/5001-Workaround-the-GC-clipping-problem-in-miPaintWindow-.patch 2011-06-03 16:03:42 UTC (rev 79155)
+++ trunk/dports/x11/xorg-server-devel/files/5001-Workaround-the-GC-clipping-problem-in-miPaintWindow-.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -1,164 +0,0 @@
-From 8dbbbfd7d241ba0e19eb892810f02eedb4f50a63 Mon Sep 17 00:00:00 2001
-From: Jeremy Huddleston <jeremyhu at apple.com>
-Date: Fri, 30 Apr 2010 13:08:25 -0700
-Subject: [PATCH 1/3] Workaround the GC clipping problem in miPaintWindow and add some debugging output.
-
-Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
----
- mi/miexpose.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++------
- 1 files changed, 94 insertions(+), 11 deletions(-)
-
-diff --git xorg-server-1.10.1/mi/miexpose.c xorg-server-1.10.1/mi/miexpose.c
-index 94258b8..4f25c23 100644
---- xorg-server-1.10.1/mi/miexpose.c
-+++ xorg-server-1.10.1/mi/miexpose.c
-@@ -521,6 +521,7 @@ void RootlessSetPixmapOfAncestors(WindowPtr pWin);
- void RootlessStartDrawing(WindowPtr pWin);
- void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn);
- Bool IsFramedWindow(WindowPtr pWin);
-+#include "../fb/fb.h"
- #endif
-
- void
-@@ -548,24 +549,37 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
- Bool solid = TRUE;
- DrawablePtr drawable = &pWin->drawable;
-
-+#ifdef XQUARTZ_CLIP_DEBUG
-+ ErrorF("START %d BS %d (pR = %ld)\n", what, pWin->backgroundState, ParentRelative);
-+ ErrorF(" Rgn: %d %d %d %d\n", prgn->extents.x1, prgn->extents.y1,
-+ prgn->extents.x2 - prgn->extents.x1,
-+ prgn->extents.y2 - prgn->extents.y1);
-+ ErrorF(" Win: %d %d (%d %d) %d %d\n", pWin->origin.x, pWin->origin.y,
-+ pWin->winSize.extents.x1, pWin->winSize.extents.y1,
-+ pWin->winSize.extents.x2 - pWin->winSize.extents.x1,
-+ pWin->winSize.extents.y2 - pWin->winSize.extents.y1);
-+ ErrorF(" Draw: %d %d %d %d\n", pWin->drawable.x, pWin->drawable.y,
-+ pWin->drawable.width, pWin->drawable.height);
-+#endif
-+
- #ifdef ROOTLESS
- if(!drawable || drawable->type == UNDRAWABLE_WINDOW)
- return;
--
-- if(IsFramedWindow(pWin)) {
-- RootlessStartDrawing(pWin);
-- RootlessDamageRegion(pWin, prgn);
--
-- if(pWin->backgroundState == ParentRelative) {
-- if((what == PW_BACKGROUND) ||
-- (what == PW_BORDER && !pWin->borderIsPixel))
-- RootlessSetPixmapOfAncestors(pWin);
-- }
-- }
- #endif
-
- if (what == PW_BACKGROUND)
- {
-+#ifdef ROOTLESS
-+ if(IsFramedWindow(pWin)) {
-+ RootlessStartDrawing(pWin);
-+ RootlessDamageRegion(pWin, prgn);
-+
-+ if(pWin->backgroundState == ParentRelative) {
-+ RootlessSetPixmapOfAncestors(pWin);
-+ }
-+ }
-+#endif
-+
- while (pWin->backgroundState == ParentRelative)
- pWin = pWin->parent;
-
-@@ -587,6 +601,18 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
- {
- PixmapPtr pixmap;
-
-+#ifdef ROOTLESS
-+ if(IsFramedWindow(pWin)) {
-+ RootlessStartDrawing(pWin);
-+ RootlessDamageRegion(pWin, prgn);
-+
-+ if(!pWin->borderIsPixel &&
-+ pWin->backgroundState == ParentRelative) {
-+ RootlessSetPixmapOfAncestors(pWin);
-+ }
-+ }
-+#endif
-+
- tile_x_off = drawable->x;
- tile_y_off = drawable->y;
-
-@@ -595,6 +621,12 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
- return;
- pixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) drawable);
- drawable = &pixmap->drawable;
-+
-+#ifdef XQUARTZ_CLIP_DEBUG
-+ ErrorF(" Draw: %d %d %d %d\n",
-+ drawable->x, drawable->y, drawable->width, drawable->height);
-+#endif
-+
- #ifdef COMPOSITE
- draw_x_off = pixmap->screen_x;
- draw_y_off = pixmap->screen_y;
-@@ -657,6 +689,57 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
- ChangeGC (NullClient, pGC, gcmask, gcval);
- ValidateGC (drawable, pGC);
-
-+#ifdef XQUARTZ_CLIP_DEBUG
-+ ErrorF(" GC: %d %d %d %d\n",
-+ pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
-+ pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
-+ pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);
-+#endif
-+
-+#ifdef XQUARTZ
-+ /* Looks like our clipping isn't set right for some reason:
-+ * http://xquartz.macosforge.org/trac/ticket/290
-+ */
-+ if(what == PW_BORDER) {
-+
-+#if 0
-+ if(solid) {
-+#if 1
-+ fbFillRegionSolid(&pWin->drawable,
-+ prgn,
-+ 0,
-+ fbReplicatePixel(fill.pixel,
-+ pWin->drawable.bitsPerPixel));
-+#else
-+ fbFillRegionSolid(drawable,
-+ prgn,
-+ 0,
-+ fbReplicatePixel(fill.pixel,
-+ drawable->bitsPerPixel));
-+#endif
-+ return;
-+ }
-+#endif
-+
-+ pGC->pCompositeClip->extents.x1 += prgn->extents.x1;
-+ pGC->pCompositeClip->extents.y1 += prgn->extents.y1;
-+ pGC->pCompositeClip->extents.x2 += prgn->extents.x1;
-+ pGC->pCompositeClip->extents.y2 += prgn->extents.y1;
-+
-+ if(pGC->pCompositeClip->extents.x2 > drawable->pScreen->width)
-+ pGC->pCompositeClip->extents.x2 = drawable->pScreen->width;
-+ if(pGC->pCompositeClip->extents.y2 > drawable->pScreen->height)
-+ pGC->pCompositeClip->extents.y2 = drawable->pScreen->height;
-+ }
-+#endif
-+
-+#ifdef XQUARTZ_CLIP_DEBUG
-+ ErrorF(" GC: %d %d %d %d\n",
-+ pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
-+ pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
-+ pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);
-+#endif
-+
- numRects = RegionNumRects(prgn);
- pbox = RegionRects(prgn);
- for (i= numRects; --i >= 0; pbox++, prect++)
---
-1.7.4.1
-
Added: trunk/dports/x11/xorg-server-devel/files/5001-configure.ac-Add-fno-strict-aliasing-to-CFLAGS.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/5001-configure.ac-Add-fno-strict-aliasing-to-CFLAGS.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/5001-configure.ac-Add-fno-strict-aliasing-to-CFLAGS.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -0,0 +1,32 @@
+From 5b328c442b7816187780a52988b385e5c2fc148b Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Sat, 30 Oct 2010 14:55:06 -0700
+Subject: [PATCH 14/16] configure.ac: Add -fno-strict-aliasing to CFLAGS
+
+This should address https://bugs.freedesktop.org/show_bug.cgi?id=31238
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+ configure.ac | 6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git xorg-server-1.10.99.901/configure.ac xorg-server-1.10.99.901/configure.ac
+index 22566c9..f3f298e 100644
+--- xorg-server-1.10.99.901/configure.ac
++++ xorg-server-1.10.99.901/configure.ac
+@@ -87,6 +87,12 @@ XORG_PROG_RAWCPP
+ # easier overrides at build time.
+ XSERVER_CFLAGS='$(CWARNFLAGS)'
+
++dnl Explicitly add -fno-strict-aliasing since this option should disappear
++dnl from util-macros CWARNFLAGS
++if test "x$GCC" = xyes ; then
++ XSERVER_CFLAGS="$XSERVER_CFLAGS -fno-strict-aliasing"
++fi
++
+ dnl Check for dtrace program (needed to build Xserver dtrace probes)
+ dnl Also checks for <sys/sdt.h>, since some Linux distros have an
+ dnl ISDN trace program named dtrace
+--
+1.7.5.2
+
Added: trunk/dports/x11/xorg-server-devel/files/5002-Workaround-the-GC-clipping-problem-in-miPaintWindow-.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/5002-Workaround-the-GC-clipping-problem-in-miPaintWindow-.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/5002-Workaround-the-GC-clipping-problem-in-miPaintWindow-.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -0,0 +1,165 @@
+From a7e35ac35ed6d7dc1bcf4252c3dbc3ed7764f261 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Fri, 30 Apr 2010 13:08:25 -0700
+Subject: [PATCH 15/16] Workaround the GC clipping problem in miPaintWindow
+ and add some debugging output.
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+ mi/miexpose.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++------
+ 1 files changed, 94 insertions(+), 11 deletions(-)
+
+diff --git xorg-server-1.10.99.901/mi/miexpose.c xorg-server-1.10.99.901/mi/miexpose.c
+index 94258b8..4f25c23 100644
+--- xorg-server-1.10.99.901/mi/miexpose.c
++++ xorg-server-1.10.99.901/mi/miexpose.c
+@@ -521,6 +521,7 @@ void RootlessSetPixmapOfAncestors(WindowPtr pWin);
+ void RootlessStartDrawing(WindowPtr pWin);
+ void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn);
+ Bool IsFramedWindow(WindowPtr pWin);
++#include "../fb/fb.h"
+ #endif
+
+ void
+@@ -548,24 +549,37 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
+ Bool solid = TRUE;
+ DrawablePtr drawable = &pWin->drawable;
+
++#ifdef XQUARTZ_CLIP_DEBUG
++ ErrorF("START %d BS %d (pR = %ld)\n", what, pWin->backgroundState, ParentRelative);
++ ErrorF(" Rgn: %d %d %d %d\n", prgn->extents.x1, prgn->extents.y1,
++ prgn->extents.x2 - prgn->extents.x1,
++ prgn->extents.y2 - prgn->extents.y1);
++ ErrorF(" Win: %d %d (%d %d) %d %d\n", pWin->origin.x, pWin->origin.y,
++ pWin->winSize.extents.x1, pWin->winSize.extents.y1,
++ pWin->winSize.extents.x2 - pWin->winSize.extents.x1,
++ pWin->winSize.extents.y2 - pWin->winSize.extents.y1);
++ ErrorF(" Draw: %d %d %d %d\n", pWin->drawable.x, pWin->drawable.y,
++ pWin->drawable.width, pWin->drawable.height);
++#endif
++
+ #ifdef ROOTLESS
+ if(!drawable || drawable->type == UNDRAWABLE_WINDOW)
+ return;
+-
+- if(IsFramedWindow(pWin)) {
+- RootlessStartDrawing(pWin);
+- RootlessDamageRegion(pWin, prgn);
+-
+- if(pWin->backgroundState == ParentRelative) {
+- if((what == PW_BACKGROUND) ||
+- (what == PW_BORDER && !pWin->borderIsPixel))
+- RootlessSetPixmapOfAncestors(pWin);
+- }
+- }
+ #endif
+
+ if (what == PW_BACKGROUND)
+ {
++#ifdef ROOTLESS
++ if(IsFramedWindow(pWin)) {
++ RootlessStartDrawing(pWin);
++ RootlessDamageRegion(pWin, prgn);
++
++ if(pWin->backgroundState == ParentRelative) {
++ RootlessSetPixmapOfAncestors(pWin);
++ }
++ }
++#endif
++
+ while (pWin->backgroundState == ParentRelative)
+ pWin = pWin->parent;
+
+@@ -587,6 +601,18 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
+ {
+ PixmapPtr pixmap;
+
++#ifdef ROOTLESS
++ if(IsFramedWindow(pWin)) {
++ RootlessStartDrawing(pWin);
++ RootlessDamageRegion(pWin, prgn);
++
++ if(!pWin->borderIsPixel &&
++ pWin->backgroundState == ParentRelative) {
++ RootlessSetPixmapOfAncestors(pWin);
++ }
++ }
++#endif
++
+ tile_x_off = drawable->x;
+ tile_y_off = drawable->y;
+
+@@ -595,6 +621,12 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
+ return;
+ pixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) drawable);
+ drawable = &pixmap->drawable;
++
++#ifdef XQUARTZ_CLIP_DEBUG
++ ErrorF(" Draw: %d %d %d %d\n",
++ drawable->x, drawable->y, drawable->width, drawable->height);
++#endif
++
+ #ifdef COMPOSITE
+ draw_x_off = pixmap->screen_x;
+ draw_y_off = pixmap->screen_y;
+@@ -657,6 +689,57 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
+ ChangeGC (NullClient, pGC, gcmask, gcval);
+ ValidateGC (drawable, pGC);
+
++#ifdef XQUARTZ_CLIP_DEBUG
++ ErrorF(" GC: %d %d %d %d\n",
++ pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
++ pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
++ pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);
++#endif
++
++#ifdef XQUARTZ
++ /* Looks like our clipping isn't set right for some reason:
++ * http://xquartz.macosforge.org/trac/ticket/290
++ */
++ if(what == PW_BORDER) {
++
++#if 0
++ if(solid) {
++#if 1
++ fbFillRegionSolid(&pWin->drawable,
++ prgn,
++ 0,
++ fbReplicatePixel(fill.pixel,
++ pWin->drawable.bitsPerPixel));
++#else
++ fbFillRegionSolid(drawable,
++ prgn,
++ 0,
++ fbReplicatePixel(fill.pixel,
++ drawable->bitsPerPixel));
++#endif
++ return;
++ }
++#endif
++
++ pGC->pCompositeClip->extents.x1 += prgn->extents.x1;
++ pGC->pCompositeClip->extents.y1 += prgn->extents.y1;
++ pGC->pCompositeClip->extents.x2 += prgn->extents.x1;
++ pGC->pCompositeClip->extents.y2 += prgn->extents.y1;
++
++ if(pGC->pCompositeClip->extents.x2 > drawable->pScreen->width)
++ pGC->pCompositeClip->extents.x2 = drawable->pScreen->width;
++ if(pGC->pCompositeClip->extents.y2 > drawable->pScreen->height)
++ pGC->pCompositeClip->extents.y2 = drawable->pScreen->height;
++ }
++#endif
++
++#ifdef XQUARTZ_CLIP_DEBUG
++ ErrorF(" GC: %d %d %d %d\n",
++ pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
++ pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
++ pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);
++#endif
++
+ numRects = RegionNumRects(prgn);
+ pbox = RegionRects(prgn);
+ for (i= numRects; --i >= 0; pbox++, prect++)
+--
+1.7.5.2
+
Deleted: trunk/dports/x11/xorg-server-devel/files/5002-fb-Revert-fb-changes-that-broke-XQuartz.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/5002-fb-Revert-fb-changes-that-broke-XQuartz.patch 2011-06-03 16:03:42 UTC (rev 79155)
+++ trunk/dports/x11/xorg-server-devel/files/5002-fb-Revert-fb-changes-that-broke-XQuartz.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -1,245 +0,0 @@
-From 3f0fc2f1f27cc427bcbda618a7cb5844c61f5d3b Mon Sep 17 00:00:00 2001
-From: Jeremy Huddleston <jeremyhu at apple.com>
-Date: Fri, 12 Feb 2010 19:48:52 -0800
-Subject: [PATCH 2/3] fb: Revert fb changes that broke XQuartz
-
-http://bugs.freedesktop.org/show_bug.cgi?id=26124
-
-Revert "Fix source pictures getting random transforms after 2d6a8f668342a5190cdf43b5."
-Revert "fb: Adjust transform or composite coordinates for pixman operations"
-
-http://bugs.freedesktop.org/26124
-
-This reverts commit a72c65e9176c51de95db2fdbf4c5d946a4911695.
-This reverts commit a6bd5d2e482a5aa84acb3d4932e2a166d8670ef1.
-
-Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
----
- fb/fb.h | 7 +----
- fb/fbpict.c | 78 +++++++++++++++++++----------------------------------------
- fb/fbtrap.c | 6 +---
- 3 files changed, 29 insertions(+), 62 deletions(-)
-
-diff --git xorg-server-1.10.1/fb/fb.h xorg-server-1.10.1/fb/fb.h
-index 021a940..0b248e1 100644
---- xorg-server-1.10.1/fb/fb.h
-+++ xorg-server-1.10.1/fb/fb.h
-@@ -2079,11 +2079,8 @@ fbFillRegionSolid (DrawablePtr pDrawable,
- FbBits xor);
-
- extern _X_EXPORT pixman_image_t *
--image_from_pict (PicturePtr pict,
-- Bool has_clip,
-- int *xoff,
-- int *yoff);
--
-+image_from_pict (PicturePtr pict,
-+ Bool has_clip);
- extern _X_EXPORT void free_pixman_pict (PicturePtr, pixman_image_t *);
-
- #endif /* _FB_H_ */
-diff --git xorg-server-1.10.1/fb/fbpict.c xorg-server-1.10.1/fb/fbpict.c
-index 7636040..af1920b 100644
---- xorg-server-1.10.1/fb/fbpict.c
-+++ xorg-server-1.10.1/fb/fbpict.c
-@@ -50,24 +50,19 @@ fbComposite (CARD8 op,
- CARD16 height)
- {
- pixman_image_t *src, *mask, *dest;
-- int src_xoff, src_yoff;
-- int msk_xoff, msk_yoff;
-- int dst_xoff, dst_yoff;
-
- miCompositeSourceValidate (pSrc, xSrc - xDst, ySrc - yDst, width, height);
- if (pMask)
- miCompositeSourceValidate (pMask, xMask - xDst, yMask - yDst, width, height);
-
-- src = image_from_pict (pSrc, FALSE, &src_xoff, &src_yoff);
-- mask = image_from_pict (pMask, FALSE, &msk_xoff, &msk_yoff);
-- dest = image_from_pict (pDst, TRUE, &dst_xoff, &dst_yoff);
-+ src = image_from_pict (pSrc, TRUE);
-+ mask = image_from_pict (pMask, TRUE);
-+ dest = image_from_pict (pDst, TRUE);
-
- if (src && dest && !(pMask && !mask))
- {
- pixman_image_composite (op, src, mask, dest,
-- xSrc + src_xoff, ySrc + src_yoff,
-- xMask + msk_xoff, yMask + msk_yoff,
-- xDst + dst_xoff, yDst + dst_yoff,
-+ xSrc, ySrc, xMask, yMask, xDst, yDst,
- width, height);
- }
-
-@@ -146,22 +141,22 @@ create_conical_gradient_image (PictGradient *gradient)
-
- static pixman_image_t *
- create_bits_picture (PicturePtr pict,
-- Bool has_clip,
-- int *xoff,
-- int *yoff)
-+ Bool has_clip)
- {
-- PixmapPtr pixmap;
- FbBits *bits;
- FbStride stride;
-- int bpp;
-+ int bpp, xoff, yoff;
- pixman_image_t *image;
-
-- fbGetDrawablePixmap (pict->pDrawable, pixmap, *xoff, *yoff);
-- fbGetPixmapBitsData(pixmap, bits, stride, bpp);
-+ fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
-+
-+ bits = (FbBits*)((CARD8*)bits +
-+ (pict->pDrawable->y + yoff) * stride * sizeof(FbBits) +
-+ (pict->pDrawable->x + xoff) * (bpp / 8));
-
- image = pixman_image_create_bits (
- pict->format,
-- pixmap->drawable.width, pixmap->drawable.height,
-+ pict->pDrawable->width, pict->pDrawable->height,
- (uint32_t *)bits, stride * sizeof (FbStride));
-
-
-@@ -187,55 +182,33 @@ create_bits_picture (PicturePtr pict,
- if (pict->clientClipType != CT_NONE)
- pixman_image_set_has_client_clip (image, TRUE);
-
-- if (*xoff || *yoff)
-- pixman_region_translate (pict->pCompositeClip, *xoff, *yoff);
-+ pixman_region_translate (pict->pCompositeClip, - pict->pDrawable->x, - pict->pDrawable->y);
-
- pixman_image_set_clip_region (image, pict->pCompositeClip);
-
-- if (*xoff || *yoff)
-- pixman_region_translate (pict->pCompositeClip, -*xoff, -*yoff);
-+ pixman_region_translate (pict->pCompositeClip, pict->pDrawable->x, pict->pDrawable->y);
- }
-
- /* Indexed table */
- if (pict->pFormat->index.devPrivate)
- pixman_image_set_indexed (image, pict->pFormat->index.devPrivate);
-
-- /* Add in drawable origin to position within the image */
-- *xoff += pict->pDrawable->x;
-- *yoff += pict->pDrawable->y;
--
- return image;
- }
-
- static pixman_image_t *
--image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map);
-+image_from_pict_internal (PicturePtr pict, Bool has_clip, Bool is_alpha_map);
-
- static void
--set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map)
-+set_image_properties (pixman_image_t *image, PicturePtr pict, Bool is_alpha_map)
- {
- pixman_repeat_t repeat;
- pixman_filter_t filter;
-
- if (pict->transform)
- {
-- /* For source images, adjust the transform to account
-- * for the drawable offset within the pixman image,
-- * then set the offset to 0 as it will be used
-- * to compute positions within the transformed image.
-- */
-- if (!has_clip) {
-- struct pixman_transform adjusted;
--
-- adjusted = *pict->transform;
-- pixman_transform_translate(&adjusted,
-- NULL,
-- pixman_int_to_fixed(*xoff),
-- pixman_int_to_fixed(*yoff));
-- pixman_image_set_transform (image, &adjusted);
-- *xoff = 0;
-- *yoff = 0;
-- } else
-- pixman_image_set_transform (image, pict->transform);
-+ pixman_image_set_transform (
-+ image, (pixman_transform_t *)pict->transform);
- }
-
- switch (pict->repeatType)
-@@ -265,8 +238,7 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
- */
- if (pict->alphaMap && !is_alpha_map)
- {
-- int alpha_xoff, alpha_yoff;
-- pixman_image_t *alpha_map = image_from_pict_internal (pict->alphaMap, FALSE, &alpha_xoff, &alpha_yoff, TRUE);
-+ pixman_image_t *alpha_map = image_from_pict_internal (pict->alphaMap, TRUE, TRUE);
-
- pixman_image_set_alpha_map (
- image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
-@@ -299,7 +271,8 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
- }
-
- static pixman_image_t *
--image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map)
-+image_from_pict_internal (PicturePtr pict,
-+ Bool has_clip, Bool is_alpha_map)
- {
- pixman_image_t *image = NULL;
-
-@@ -308,7 +281,7 @@ image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
-
- if (pict->pDrawable)
- {
-- image = create_bits_picture (pict, has_clip, xoff, yoff);
-+ image = create_bits_picture (pict, has_clip);
- }
- else if (pict->pSourcePict)
- {
-@@ -329,19 +302,18 @@ image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
- else if (sp->type == SourcePictTypeConical)
- image = create_conical_gradient_image (gradient);
- }
-- *xoff = *yoff = 0;
- }
-
- if (image)
-- set_image_properties (image, pict, has_clip, xoff, yoff, is_alpha_map);
-+ set_image_properties (image, pict, is_alpha_map);
-
- return image;
- }
-
- pixman_image_t *
--image_from_pict (PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
-+image_from_pict (PicturePtr pict, Bool has_clip)
- {
-- return image_from_pict_internal (pict, has_clip, xoff, yoff, FALSE);
-+ return image_from_pict_internal (pict, has_clip, FALSE);
- }
-
- void
-diff --git xorg-server-1.10.1/fb/fbtrap.c xorg-server-1.10.1/fb/fbtrap.c
-index c309ceb..40cffd9 100644
---- xorg-server-1.10.1/fb/fbtrap.c
-+++ xorg-server-1.10.1/fb/fbtrap.c
-@@ -37,8 +37,7 @@ fbAddTraps (PicturePtr pPicture,
- int ntrap,
- xTrap *traps)
- {
-- int image_xoff, image_yoff;
-- pixman_image_t *image = image_from_pict (pPicture, FALSE, &image_xoff, &image_yoff);
-+ pixman_image_t *image = image_from_pict (pPicture, FALSE);
-
- if (!image)
- return;
-@@ -54,8 +53,7 @@ fbRasterizeTrapezoid (PicturePtr pPicture,
- int x_off,
- int y_off)
- {
-- int mask_xoff, mask_yoff;
-- pixman_image_t *image = image_from_pict (pPicture, FALSE, &mask_xoff, &mask_yoff);
-+ pixman_image_t *image = image_from_pict (pPicture, FALSE);
-
- if (!image)
- return;
---
-1.7.4.1
-
Deleted: trunk/dports/x11/xorg-server-devel/files/5003-configure.ac-Add-fno-strict-aliasing-to-CFLAGS.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/5003-configure.ac-Add-fno-strict-aliasing-to-CFLAGS.patch 2011-06-03 16:03:42 UTC (rev 79155)
+++ trunk/dports/x11/xorg-server-devel/files/5003-configure.ac-Add-fno-strict-aliasing-to-CFLAGS.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -1,32 +0,0 @@
-From 2c50f1784445d55d4c4c91eb901c3da12b4becb7 Mon Sep 17 00:00:00 2001
-From: Jeremy Huddleston <jeremyhu at apple.com>
-Date: Sat, 30 Oct 2010 14:55:06 -0700
-Subject: [PATCH 3/3] configure.ac: Add -fno-strict-aliasing to CFLAGS
-
-This should address https://bugs.freedesktop.org/show_bug.cgi?id=31238
-
-Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
----
- configure.ac | 6 ++++++
- 1 files changed, 6 insertions(+), 0 deletions(-)
-
-diff --git xorg-server-1.10.1/configure.ac xorg-server-1.10.1/configure.ac
-index 756733e..72fc979 100644
---- xorg-server-1.10.1/configure.ac
-+++ xorg-server-1.10.1/configure.ac
-@@ -80,6 +80,12 @@ XORG_PROG_RAWCPP
- # easier overrides at build time.
- XSERVER_CFLAGS='$(CWARNFLAGS)'
-
-+dnl Explicitly add -fno-strict-aliasing since this option should disappear
-+dnl from util-macros CWARNFLAGS
-+if test "x$GCC" = xyes ; then
-+ XSERVER_CFLAGS="$XSERVER_CFLAGS -fno-strict-aliasing"
-+fi
-+
- dnl Check for dtrace program (needed to build Xserver dtrace probes)
- dnl Also checks for <sys/sdt.h>, since some Linux distros have an
- dnl ISDN trace program named dtrace
---
-1.7.4.1
-
Added: trunk/dports/x11/xorg-server-devel/files/5003-fb-Revert-fb-changes-that-broke-XQuartz.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/5003-fb-Revert-fb-changes-that-broke-XQuartz.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/5003-fb-Revert-fb-changes-that-broke-XQuartz.patch 2011-06-03 16:11:33 UTC (rev 79156)
@@ -0,0 +1,320 @@
+From 9dfac85c5dccd63a0b97659898e0a06b6ac6079c Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Fri, 12 Feb 2010 19:48:52 -0800
+Subject: [PATCH 16/16] fb: Revert fb changes that broke XQuartz
+
+http://bugs.freedesktop.org/show_bug.cgi?id=26124
+
+Revert "Fix source pictures getting random transforms after 2d6a8f668342a5190cdf43b5."
+Revert "fb: Adjust transform or composite coordinates for pixman operations"
+
+http://bugs.freedesktop.org/26124
+
+This reverts commit a72c65e9176c51de95db2fdbf4c5d946a4911695.
+This reverts commit a6bd5d2e482a5aa84acb3d4932e2a166d8670ef1.
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+ fb/fb.h | 7 +----
+ fb/fbpict.c | 78 +++++++++++++++++++----------------------------------------
+ fb/fbtrap.c | 39 +++++++++++++----------------
+ 3 files changed, 44 insertions(+), 80 deletions(-)
+
+diff --git xorg-server-1.10.99.901/fb/fb.h xorg-server-1.10.99.901/fb/fb.h
+index eaa21ad..e65a1c0 100644
+--- xorg-server-1.10.99.901/fb/fb.h
++++ xorg-server-1.10.99.901/fb/fb.h
+@@ -2049,11 +2049,8 @@ fbFillRegionSolid (DrawablePtr pDrawable,
+ FbBits xor);
+
+ extern _X_EXPORT pixman_image_t *
+-image_from_pict (PicturePtr pict,
+- Bool has_clip,
+- int *xoff,
+- int *yoff);
+-
++image_from_pict (PicturePtr pict,
++ Bool has_clip);
+ extern _X_EXPORT void free_pixman_pict (PicturePtr, pixman_image_t *);
+
+ #endif /* _FB_H_ */
+diff --git xorg-server-1.10.99.901/fb/fbpict.c xorg-server-1.10.99.901/fb/fbpict.c
+index d1fd0cb..d2986c8 100644
+--- xorg-server-1.10.99.901/fb/fbpict.c
++++ xorg-server-1.10.99.901/fb/fbpict.c
+@@ -50,24 +50,19 @@ fbComposite (CARD8 op,
+ CARD16 height)
+ {
+ pixman_image_t *src, *mask, *dest;
+- int src_xoff, src_yoff;
+- int msk_xoff, msk_yoff;
+- int dst_xoff, dst_yoff;
+
+ miCompositeSourceValidate (pSrc);
+ if (pMask)
+ miCompositeSourceValidate (pMask);
+
+- src = image_from_pict (pSrc, FALSE, &src_xoff, &src_yoff);
+- mask = image_from_pict (pMask, FALSE, &msk_xoff, &msk_yoff);
+- dest = image_from_pict (pDst, TRUE, &dst_xoff, &dst_yoff);
++ src = image_from_pict (pSrc, TRUE);
++ mask = image_from_pict (pMask, TRUE);
++ dest = image_from_pict (pDst, TRUE);
+
+ if (src && dest && !(pMask && !mask))
+ {
+ pixman_image_composite (op, src, mask, dest,
+- xSrc + src_xoff, ySrc + src_yoff,
+- xMask + msk_xoff, yMask + msk_yoff,
+- xDst + dst_xoff, yDst + dst_yoff,
++ xSrc, ySrc, xMask, yMask, xDst, yDst,
+ width, height);
+ }
+
+@@ -146,22 +141,22 @@ create_conical_gradient_image (PictGradient *gradient)
+
+ static pixman_image_t *
+ create_bits_picture (PicturePtr pict,
+- Bool has_clip,
+- int *xoff,
+- int *yoff)
++ Bool has_clip)
+ {
+- PixmapPtr pixmap;
+ FbBits *bits;
+ FbStride stride;
+- int bpp;
++ int bpp, xoff, yoff;
+ pixman_image_t *image;
+
+- fbGetDrawablePixmap (pict->pDrawable, pixmap, *xoff, *yoff);
+- fbGetPixmapBitsData(pixmap, bits, stride, bpp);
++ fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
++
++ bits = (FbBits*)((CARD8*)bits +
++ (pict->pDrawable->y + yoff) * stride * sizeof(FbBits) +
++ (pict->pDrawable->x + xoff) * (bpp / 8));
+
+ image = pixman_image_create_bits (
+ (pixman_format_code_t)pict->format,
+- pixmap->drawable.width, pixmap->drawable.height,
++ pict->pDrawable->width, pict->pDrawable->height,
+ (uint32_t *)bits, stride * sizeof (FbStride));
+
+
+@@ -187,55 +182,33 @@ create_bits_picture (PicturePtr pict,
+ if (pict->clientClipType != CT_NONE)
+ pixman_image_set_has_client_clip (image, TRUE);
+
+- if (*xoff || *yoff)
+- pixman_region_translate (pict->pCompositeClip, *xoff, *yoff);
++ pixman_region_translate (pict->pCompositeClip, - pict->pDrawable->x, - pict->pDrawable->y);
+
+ pixman_image_set_clip_region (image, pict->pCompositeClip);
+
+- if (*xoff || *yoff)
+- pixman_region_translate (pict->pCompositeClip, -*xoff, -*yoff);
++ pixman_region_translate (pict->pCompositeClip, pict->pDrawable->x, pict->pDrawable->y);
+ }
+
+ /* Indexed table */
+ if (pict->pFormat->index.devPrivate)
+ pixman_image_set_indexed (image, pict->pFormat->index.devPrivate);
+
+- /* Add in drawable origin to position within the image */
+- *xoff += pict->pDrawable->x;
+- *yoff += pict->pDrawable->y;
+-
+ return image;
+ }
+
+ static pixman_image_t *
+-image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map);
++image_from_pict_internal (PicturePtr pict, Bool has_clip, Bool is_alpha_map);
+
+ static void
+-set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map)
++set_image_properties (pixman_image_t *image, PicturePtr pict, Bool is_alpha_map)
+ {
+ pixman_repeat_t repeat;
+ pixman_filter_t filter;
+
+ if (pict->transform)
+ {
+- /* For source images, adjust the transform to account
+- * for the drawable offset within the pixman image,
+- * then set the offset to 0 as it will be used
+- * to compute positions within the transformed image.
+- */
+- if (!has_clip) {
+- struct pixman_transform adjusted;
+-
+- adjusted = *pict->transform;
+- pixman_transform_translate(&adjusted,
+- NULL,
+- pixman_int_to_fixed(*xoff),
+- pixman_int_to_fixed(*yoff));
+- pixman_image_set_transform (image, &adjusted);
+- *xoff = 0;
+- *yoff = 0;
+- } else
+- pixman_image_set_transform (image, pict->transform);
++ pixman_image_set_transform (
++ image, (pixman_transform_t *)pict->transform);
+ }
+
+ switch (pict->repeatType)
+@@ -265,8 +238,7 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
+ */
+ if (pict->alphaMap && !is_alpha_map)
+ {
+- int alpha_xoff, alpha_yoff;
+- pixman_image_t *alpha_map = image_from_pict_internal (pict->alphaMap, FALSE, &alpha_xoff, &alpha_yoff, TRUE);
++ pixman_image_t *alpha_map = image_from_pict_internal (pict->alphaMap, TRUE, TRUE);
+
+ pixman_image_set_alpha_map (
+ image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
+@@ -299,7 +271,8 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
+ }
+
+ static pixman_image_t *
+-image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map)
++image_from_pict_internal (PicturePtr pict,
++ Bool has_clip, Bool is_alpha_map)
+ {
+ pixman_image_t *image = NULL;
+
+@@ -308,7 +281,7 @@ image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
+
+ if (pict->pDrawable)
+ {
+- image = create_bits_picture (pict, has_clip, xoff, yoff);
++ image = create_bits_picture (pict, has_clip);
+ }
+ else if (pict->pSourcePict)
+ {
+@@ -329,19 +302,18 @@ image_from_pict_internal (PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
+ else if (sp->type == SourcePictTypeConical)
+ image = create_conical_gradient_image (gradient);
+ }
+- *xoff = *yoff = 0;
+ }
+
+ if (image)
+- set_image_properties (image, pict, has_clip, xoff, yoff, is_alpha_map);
++ set_image_properties (image, pict, is_alpha_map);
+
+ return image;
+ }
+
+ pixman_image_t *
+-image_from_pict (PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
++image_from_pict (PicturePtr pict, Bool has_clip)
+ {
+- return image_from_pict_internal (pict, has_clip, xoff, yoff, FALSE);
++ return image_from_pict_internal (pict, has_clip, FALSE);
+ }
+
+ void
+diff --git xorg-server-1.10.99.901/fb/fbtrap.c xorg-server-1.10.99.901/fb/fbtrap.c
+index 0b5a638..fbe2647 100644
+--- xorg-server-1.10.99.901/fb/fbtrap.c
++++ xorg-server-1.10.99.901/fb/fbtrap.c
+@@ -39,12 +39,11 @@ fbAddTraps (PicturePtr pPicture,
+ xTrap *traps)
+ {
+ pixman_image_t *image;
+- int dst_xoff, dst_yoff;
+
+- if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
++ if (!(image = image_from_pict (pPicture, FALSE)))
+ return;
+
+- pixman_add_traps (image, x_off + dst_xoff, y_off + dst_yoff,
++ pixman_add_traps (image, x_off, y_off,
+ ntrap, (pixman_trap_t *)traps);
+
+ free_pixman_pict (pPicture, image);
+@@ -57,14 +56,13 @@ fbRasterizeTrapezoid (PicturePtr pPicture,
+ int y_off)
+ {
+ pixman_image_t *image;
+- int dst_xoff, dst_yoff;
+
+- if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
++ if (!(image = image_from_pict (pPicture, FALSE)))
+ return;
+
+ pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap,
+- x_off + dst_xoff,
+- y_off + dst_yoff);
++ x_off,
++ y_off);
+
+ free_pixman_pict (pPicture, image);
+ }
+@@ -77,13 +75,12 @@ fbAddTriangles (PicturePtr pPicture,
+ xTriangle *tris)
+ {
+ pixman_image_t *image;
+- int dst_xoff, dst_yoff;
+
+- if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
++ if (!(image = image_from_pict (pPicture, FALSE)))
+ return;
+
+ pixman_add_triangles (image,
+- dst_xoff + x_off, dst_yoff + y_off,
++ x_off, y_off,
+ ntri, (pixman_triangle_t *)tris);
+
+ free_pixman_pict (pPicture, image);
+@@ -110,13 +107,11 @@ fbShapes (CompositeShapesFunc composite,
+ const uint8_t * shapes)
+ {
+ pixman_image_t *src, *dst;
+- int src_xoff, src_yoff;
+- int dst_xoff, dst_yoff;
+
+ miCompositeSourceValidate (pSrc);
+
+- src = image_from_pict (pSrc, FALSE, &src_xoff, &src_yoff);
+- dst = image_from_pict (pDst, TRUE, &dst_xoff, &dst_yoff);
++ src = image_from_pict (pSrc, FALSE);
++ dst = image_from_pict (pDst, TRUE);
+
+ if (src && dst)
+ {
+@@ -136,10 +131,10 @@ fbShapes (CompositeShapesFunc composite,
+ for (i = 0; i < nshapes; ++i)
+ {
+ composite (op, src, dst, format,
+- xSrc + src_xoff,
+- ySrc + src_yoff,
+- dst_xoff,
+- dst_yoff,
++ xSrc,
++ ySrc,
++ 0,
++ 0,
+ 1, shapes + i * shape_size);
+ }
+ }
+@@ -162,10 +157,10 @@ fbShapes (CompositeShapesFunc composite,
+ }
+
+ composite (op, src, dst, format,
+- xSrc + src_xoff,
+- ySrc + src_yoff,
+- dst_xoff,
+- dst_yoff,
++ xSrc,
++ ySrc,
++ 0,
++ 0,
+ nshapes, shapes);
+ }
+
+--
+1.7.5.2
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110603/3cff52d1/attachment-0001.html>
More information about the macports-changes
mailing list