- Fix linking and remove BROKEN.

Since the modular xorg update it has been broken because the new libGL doesn't
allow direct linking to glXGetVideoSyncSGI and glXWaitVideoSyncSGI, so they
have to be accessed through glXGetProcAddressARB (at run-time).

This doesn't happen with NVidia's libGL though, so it was harder to track.
This commit is contained in:
Alejandro Pulver 2007-07-13 02:12:56 +00:00
parent 3d0e609dac
commit 9f4ba9690e
5 changed files with 65 additions and 8 deletions

View file

@ -25,8 +25,6 @@ LIB_DEPENDS= expat.6:${PORTSDIR}/textproc/expat2 \
png.5:${PORTSDIR}/graphics/png \
xmms.4:${PORTSDIR}/multimedia/xmms
BROKEN= does not compile
USE_DOS2UNIX= *.[ch] Makefile*
USE_GCC= 3.4+
USE_GMAKE= yes

View file

@ -0,0 +1,12 @@
--- ./gl_local.h.orig Thu Jul 12 20:11:59 2007
+++ ./gl_local.h Thu Jul 12 20:27:57 2007
@@ -299,6 +299,9 @@
extern lpMTexFUNC qglMultiTexCoord2f;
extern lpSelTexFUNC qglActiveTexture;
+extern PFNGLXGETVIDEOSYNCSGIPROC qglXGetVideoSyncSGI;
+extern PFNGLXWAITVIDEOSYNCSGIPROC qglXWaitVideoSyncSGI;
+
extern float gldepthmin, gldepthmax;
extern byte color_white[4], color_black[4];
extern qbool gl_mtexable;

View file

@ -1,6 +1,6 @@
--- ./sys_linux.c.orig Mon Mar 20 10:51:28 2006
+++ ./sys_linux.c Tue Aug 29 20:59:12 2006
@@ -35,7 +35,6 @@
--- ./sys_linux.c.orig Thu Jul 12 20:11:59 2007
+++ ./sys_linux.c Thu Jul 12 20:12:00 2007
@@ -36,7 +36,6 @@
#include <ctype.h>
#include <sys/wait.h>
#include <sys/mman.h>
@ -8,7 +8,7 @@
#include <sys/ioctl.h>
#include <sys/poll.h>
#include <sched.h>
@@ -256,6 +255,7 @@
@@ -257,6 +256,7 @@
if (COM_CheckParm("-nostdout"))
sys_nostdout.value = 1;
@ -16,11 +16,11 @@
/* also check for -rtctimer before Host_Init is called */
if (COM_CheckParm("-rtctimer")) {
int retval;
@@ -292,6 +292,7 @@
@@ -293,6 +293,7 @@
Com_Printf("RTC Timer Enabled.\n");
}
+#endif
#if id386
#ifdef id386
Sys_SetFPCW();

View file

@ -0,0 +1,22 @@
--- ./vid_common_gl.c.orig Thu Jul 12 20:11:59 2007
+++ ./vid_common_gl.c Thu Jul 12 20:29:47 2007
@@ -51,6 +51,9 @@
lpMTexFUNC qglMultiTexCoord2f = NULL;
lpSelTexFUNC qglActiveTexture = NULL;
+PFNGLXGETVIDEOSYNCSGIPROC qglXGetVideoSyncSGI = NULL;
+PFNGLXWAITVIDEOSYNCSGIPROC qglXWaitVideoSyncSGI = NULL;
+
qbool gl_combine = false;
qbool gl_add_ext = false;
@@ -175,6 +178,9 @@
Cvar_Register (&gl_strings);
Cvar_ForceSet (&gl_strings, va("GL_VENDOR: %s\nGL_RENDERER: %s\n"
"GL_VERSION: %s\nGL_EXTENSIONS: %s", gl_vendor, gl_renderer, gl_version, gl_extensions));
+
+ qglXGetVideoSyncSGI = GL_GetProcAddress("glXGetVideoSyncSGI");
+ qglXWaitVideoSyncSGI = GL_GetProcAddress("glXWaitVideoSyncSGI");
#ifndef __APPLE__
glClearColor (1,0,0,0);

View file

@ -0,0 +1,25 @@
--- ./vid_glx.c.orig Thu Jul 12 20:11:59 2007
+++ ./vid_glx.c Thu Jul 12 20:26:42 2007
@@ -138,9 +138,6 @@
const char *glx_extensions=NULL;
-extern int glXGetVideoSyncSGI (unsigned int *);
-extern int glXWaitVideoSyncSGI (int, int, unsigned int *);
-
cvar_t vid_vsync = {"vid_vsync", "0"};
void GL_Init_GLX(void);
@@ -567,10 +564,10 @@
double sanity_time = Sys_DoubleTime() + 0.05;
unsigned int count, latest;
- glXGetVideoSyncSGI(&count);
+ qglXGetVideoSyncSGI(&count);
while(Sys_DoubleTime() < sanity_time) {
- glXGetVideoSyncSGI(&latest);
+ qglXGetVideoSyncSGI(&latest);
if(latest != count) {
break;