here is a patch to use glew: glew.sf.net 

this resolves all my multitexturing problems and removes the need for
advanced_opengl.c. so imho a very beneficial prospect?

have fun 
dunk
? _ode.c
? _soya.c
? _soya.p
? glew.diff
? opengl.c
? sdlconst.c
? ode-0.5/include/ode/config.h
? tutorial/data/shapes/caterpillar.data
? tutorial/data/shapes/caterpillar_head.data
? tutorial/data/shapes/sword.data
Index: c_opengl.pxd
===================================================================
RCS file: /cvs/soya/soya/c_opengl.pxd,v
retrieving revision 1.4
diff -u -r1.4 c_opengl.pxd
--- c_opengl.pxd        11 Mar 2005 23:59:06 -0000      1.4
+++ c_opengl.pxd        31 Mar 2005 22:26:53 -0000
@@ -17,16 +17,7 @@
 
 ctypedef void (*_GLUfuncptr)()
 
-cdef extern from "GL/gl.h":
-  pass
-
-cdef extern from "GL/glext.h":
-  pass
-
-cdef extern from "advanced_opengl.h":
-  pass
-
-cdef extern from *:
+cdef extern from "GL/glew.h":
   ctypedef unsigned int          GLenum
   ctypedef unsigned char  GLboolean
   ctypedef unsigned int          GLbitfield
@@ -1205,7 +1196,6 @@
   cdef void glMultTransposeMatrixf(GLfloat m[16])
   cdef void glSampleCoverage(GLclampf value, GLboolean invert)
   
-cdef extern from "GL/glu.h":
   int GLU_EXT_object_space_tess
   int GLU_EXT_nurbs_tessellator
   int GLU_FALSE
@@ -1428,7 +1418,7 @@
   cdef void gluTessVertex(GLUtesselator* tess, GLdouble *location, GLvoid* 
data)
   cdef GLint gluUnProject(GLdouble winX, GLdouble winY, GLdouble winZ, 
GLdouble *model, GLdouble *proj, GLint *view, GLdouble* objX, GLdouble* objY, 
GLdouble* objZ)
   cdef GLint gluUnProject4(GLdouble winX, GLdouble winY, GLdouble winZ, 
GLdouble clipW, GLdouble *model, GLdouble *proj, GLint *view, GLdouble nearVal, 
GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW)
+ 
+  cdef void glewInit()
   
-  
-  
-  cdef void init_advanced_opengl()
+  #cdef void init_advanced_opengl()
Index: init.pyx
===================================================================
RCS file: /cvs/soya/soya/init.pyx,v
retrieving revision 1.33
diff -u -r1.33 init.pyx
--- init.pyx    13 Mar 2005 23:58:03 -0000      1.33
+++ init.pyx    31 Mar 2005 22:26:54 -0000
@@ -330,7 +330,8 @@
       init_video(title, width, height, fullscreen, resizeable)
     init_joysticks()
     init_gl()
-    init_advanced_opengl()
+    #init_advanced_opengl()
+    glewInit()
     
     SDL_UNICODE=0
     
Index: matrix.c
===================================================================
RCS file: /cvs/soya/soya/matrix.c,v
retrieving revision 1.6
diff -u -r1.6 matrix.c
--- matrix.c    16 Feb 2005 21:51:17 -0000      1.6
+++ matrix.c    31 Mar 2005 22:26:56 -0000
@@ -27,7 +27,7 @@
 #include <stdarg.h>
 #include <float.h>
 #include <math.h>
-#include <GL/gl.h>
+#include <GL/glew.h>
 
 #include "matrix.h"
 
Index: opengl.pyx
===================================================================
RCS file: /cvs/soya/soya/opengl.pyx,v
retrieving revision 1.6
diff -u -r1.6 opengl.pyx
--- opengl.pyx  14 Mar 2005 13:21:28 -0000      1.6
+++ opengl.pyx  31 Mar 2005 22:26:57 -0000
@@ -19,12 +19,6 @@
 include "c.pxd"
 include "python.pxd"
 
-cdef extern from "GL/gl.h":
-  pass
-
-cdef extern from "GL/glext.h":
-  pass
-
 cimport c_opengl
 
 GL_FALSE = c_opengl.GL_FALSE
Index: setup.py
===================================================================
RCS file: /cvs/soya/soya/setup.py,v
retrieving revision 1.44
diff -u -r1.44 setup.py
--- setup.py    16 Mar 2005 23:05:46 -0000      1.44
+++ setup.py    31 Mar 2005 22:26:58 -0000
@@ -62,12 +62,12 @@
 from config import *
 
 if sys.platform[:3] == "win":
-  LIBS = ["m", "opengl32", "glu32", "SDL", "SDL_mixer", "freetype", "cal3d", 
"stdc++"]
+  LIBS = ["m", "glew32", "opengl32", "glu32", "SDL", "SDL_mixer", "freetype", 
"cal3d", "stdc++"]
 else:
-  LIBS = ["m", "GL", "GLU", "SDL","SDL_mixer", "freetype", "cal3d", "stdc++"]
+  LIBS = ["m", "GLEW", "GL", "GLU", "SDL","SDL_mixer", "freetype", "cal3d", 
"stdc++"]
 
-SOYA_PYREX_SOURCES  = ["_soya.pyx", "matrix.c", "chunk.c", "advanced_opengl.c"]
-SOYA_C_SOURCES      = ["_soya.c"  , "matrix.c", "chunk.c", "advanced_opengl.c"]
+SOYA_PYREX_SOURCES  = ["_soya.pyx", "matrix.c", "chunk.c" ]
+SOYA_C_SOURCES      = ["_soya.c"  , "matrix.c", "chunk.c" ]
 
 # Taken from Twisted ; thanks to Christopher Armstrong :
 #   make sure data files are installed in twisted package

Reply via email to