Package: gauche-gl
Version: 0.4.1-3
Severity: normal

I had to do some changes to get it to work on my machine. The problems are
caused by the nvidia libGL.so I am using:
ii  nvidia-glx         1.0.7174-3         NVIDIA binary XFree86 4.x driver

It does not have glXGetProcAddress (only glXGetProcAddressARB)
[EMAIL PROTECTED]:/tmp > objdump -T /usr/lib/libGL.so|grep -i getproc
00029894 g    DF .text  000000b6  Base        glXGetProcAddressARB

After a bit of googling and reading this:
http://lists.freedesktop.org/archives/xorg/2005-November/011291.html

I am not quite sure wether one can expect glXGetProcAddress to be available.

=> I changed the code to use glXGetProcAddressARB.
This required another change:
It seems one has to define GL_GLEXT_PROTOTYPES before including gl.h or glx.h
for extensions in order to get prototypes.
(At least this is stated here:
http://www.ks.uiuc.edu/Research/vmd/doxygen/OpenGLExtensions_8h-source.html)

Patch:
--- gauche-gl-0.4.1.orig/src/gauche-gl.h
+++ gauche-gl-0.4.1/src/gauche-gl.h
@@ -28,6 +28,9 @@
 #endif
 
 #ifdef HAVE_GL_GLX_H
+// it seems we have to define those to get the extension prototypes on linux
+#define GL_GLEXT_PROTOTYPES 1
+#define GLX_GLXEXT_PROTOTYPES 1
 #include <GL/glx.h>
 #endif
 
--- gauche-gl-0.4.1.orig/src/gauche-gl.c
+++ gauche-gl-0.4.1/src/gauche-gl.c
@@ -135,14 +135,14 @@
    supports GLX for the time being. */
 void *Scm_GLGetProcAddress(const char *name)
 {
-#if defined(GLX_VERSION_1_4)
-    if (glXGetProcAddress != NULL) {
-        return glXGetProcAddress(name);
-    }
-#elif defined(GLX_ARB_get_proc_address)
+#if defined(GLX_ARB_get_proc_address)
     if (glXGetProcAddressARB != NULL) {
         return glXGetProcAddressARB((const GLubyte*)name);
     }
+#elif defined(GLX_VERSION_1_4)
+    if (glXGetProcAddress != NULL) {
+        return glXGetProcAddress(name);
+    }
 #elif defined(MacOSX)
     return glutGetProcAddress(name);
 #endif /* !defined(GLX_VERSION_1_4) && !defined(GLX_ARB_get_proc_address) */


Greetings
Jens

PS: Note: I did not carefully read the specs. I only wanted to get it to
work (=> perhaps this patch is not the right thing to do)

PPS: Off-topic: Some notes regarding example 
examples/cg/checkered-sphere-cg.scm:
to get best result one should force the garbage collector to use the incremental
collector and perhaps force your graphics driver to sync to vertical 
retrace/screen
refresh. I use the following:
export GC_ENABLE_INCREMENTAL=1
export GC_PAUSE_TIME_TARGET=5
// for nvidia:
export __GL_SYNC_TO_VBLANK=1


-- System Information:
Debian Release: 3.1
Architecture: i386 (i586)
Kernel: Linux 2.6.8-3-386
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages gauche-gl depends on:
ii  freeglut3          2.2.0-8               OpenGL Utility Toolkit
ii  gauche             0.8.7-4               A Scheme implementation designed f
ii  libc6              2.3.2.ds1-22sarge4    GNU C Library: Shared libraries an
ii  libice6            4.3.0.dfsg.1-14sarge1 Inter-Client Exchange library
ii  libsm6             4.3.0.dfsg.1-14sarge1 X Window System Session Management
ii  libx11-6           4.3.0.dfsg.1-14sarge1 X Window System protocol client li
ii  libxext6           4.3.0.dfsg.1-14sarge1 X Window System miscellaneous exte
ii  libxi6             4.3.0.dfsg.1-14sarge1 X Window System Input extension li
ii  libxmu6            4.3.0.dfsg.1-14sarge1 X Window System miscellaneous util
ii  xlibmesa-gl [libgl 4.3.0.dfsg.1-14sarge1 Mesa 3D graphics library [XFree86]
ii  xlibmesa-glu [libg 4.3.0.dfsg.1-14sarge1 Mesa OpenGL utility library [XFree
ii  xlibs              4.3.0.dfsg.1-14sarge1 X Keyboard Extension (XKB) configu

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to