cvs -z9 diff -wb complex_typemaps.inc GL\GL__init__.i simple_typemaps.inc util.inc (in directory S:\autobuild\PyOpenGL-2.0.2-maint\interface\) Index: complex_typemaps.inc =================================================================== RCS file: /cvsroot/pyopengl/PyOpenGL2/interface/complex_typemaps.inc,v retrieving revision 1.20.4.3 diff -w -b -r1.20.4.3 complex_typemaps.inc 349a350,393 > /* bleair: When a VBO is bound, the 'pointer' argument to these functions > is overriden to mean an offset into the buffer > glColorPointer > glEdgeFlagPointer > glIndexPointer > glInterleavedArrays > glNormalPointer > glTexCoordPointer > glVertexPointer > See http://oss.sgi.com/projects/ogl-sample/registry/ARB/vertex_buffer_object.txt > " > RESOLVED: When the default buffer object (object zero) is > bound, all pointers behave as real pointers. When any other > object is bound, all pointers are treated as offsets. > Conceptually, one can imagine that buffer object zero is a buffer > object sitting at base NULL and with an extent large enough that > it covers all of the system's virtual address space. > " > */ > %typemap(python, in) (GLvoid * pointer_or_offset, _GL_Argument_Type arg_type) > { > if (PyInt_Check($input) || PyLong_Check($input)) > { > $1 = (void *)(PyInt_AsLong( $input )); > $2 = _GL_Argument_Type_Offset; > if (!glVBOIsBound ()) > { > // No VBO is current bound for the vertex array so an integer > // argument is invalid. > PyErr_SetString(PyExc_Exception, "Expected object argument, recieved integer."); > return NULL; > } > } > else > { > $1 = _PyObject_AsPointer($input); > $2 = _GL_Argument_Type_Pointer; > if (glVBOIsBound ()) > { > PyErr_SetString(PyExc_Exception, "Expected integer argument, but recieved object."); > return NULL; > } > } > } Index: simple_typemaps.inc =================================================================== RCS file: /cvsroot/pyopengl/PyOpenGL2/interface/simple_typemaps.inc,v retrieving revision 1.8.4.4 diff -w -b -r1.8.4.4 simple_typemaps.inc 9a10,15 > typedef enum > { > _GL_Argument_Type_Offset, > _GL_Argument_Type_Pointer > } _GL_Argument_Type; > Index: util.inc =================================================================== RCS file: /cvsroot/pyopengl/PyOpenGL2/interface/util.inc,v retrieving revision 1.61.4.1 diff -w -b -r1.61.4.1 util.inc 16a17,18 > int glVBOIsBound (); > 582a585,616 > static char *vbo_proc_names[] = > { > NULL > }; > > #define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 > > int glVBOIsBound () > { > int buffer; > static int extension_inited = 0; > static int have_vbo_extension = 0; > > if (extension_inited == 0) > { > if (InitExtension("GL_ARB_vertex_buffer_object", vbo_proc_names)) > { > have_vbo_extension = 1; > } > extension_inited = 1; > } > if (have_vbo_extension) > { > glGetIntegerv (GL_ARRAY_BUFFER_BINDING_ARB, &buffer); > return (buffer != 0); > } > return 0; > } > > > > Index: GL/GL__init__.i =================================================================== RCS file: /cvsroot/pyopengl/PyOpenGL2/interface/GL/GL__init__.i,v retrieving revision 1.3.2.3 diff -w -b -r1.3.2.3 GL__init__.i 1233c1233 < void _glColorPointer(GLint size, GLenum type, GLsizei stride, GLvoid *pointer) --- > void _glColorPointer(GLint size, GLenum type, GLsizei stride, GLvoid * pointer_or_offset, _GL_Argument_Type arg_type) 1236,1237c1236,1238 < acquire(pointer); < glColorPointer(size, type, stride, pointer); --- > if (arg_type == _GL_Argument_Type_Pointer) > acquire(pointer_or_offset); > glColorPointer(size, type, stride, pointer_or_offset); 1241c1242 < %name(glColorPointer) void _glColorPointer(GLint size, GLenum type, GLsizei stride, void *pointer); --- > %name(glColorPointer) void _glColorPointer(GLint size, GLenum type, GLsizei stride, GLvoid * pointer_or_offset, _GL_Argument_Type arg_type); 1244c1245 < %name(glColorPointerub) void _glColorPointer(GLint d_3_1, GLenum type_UNSIGNED_BYTE, GLsizei stride_0, GLubyte* pointer); --- > %name(glColorPointerub) void _glColorPointer(GLint d_3_1, GLenum type_UNSIGNED_BYTE, GLsizei stride_0, GLubyte* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 1247c1248 < %name(glColorPointerb) void _glColorPointer(GLint d_3_1, GLenum type_BYTE, GLsizei stride_0, GLbyte* pointer); --- > %name(glColorPointerb) void _glColorPointer(GLint d_3_1, GLenum type_BYTE, GLsizei stride_0, GLbyte* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 1250c1251 < %name(glColorPointerus) void _glColorPointer(GLint d_3_1, GLenum type_UNSIGNED_SHORT, GLsizei stride_0, GLushort* pointer); --- > %name(glColorPointerus) void _glColorPointer(GLint d_3_1, GLenum type_UNSIGNED_SHORT, GLsizei stride_0, GLushort* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 1253c1254 < %name(glColorPointers) void _glColorPointer(GLint d_3_1, GLenum type_SHORT, GLsizei stride_0, GLshort* pointer); --- > %name(glColorPointers) void _glColorPointer(GLint d_3_1, GLenum type_SHORT, GLsizei stride_0, GLshort* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 1256c1257 < %name(glColorPointerui) void _glColorPointer(GLint d_3_1, GLenum type_UNSIGNED_INT, GLsizei stride_0, GLuint* pointer); --- > %name(glColorPointerui) void _glColorPointer(GLint d_3_1, GLenum type_UNSIGNED_INT, GLsizei stride_0, GLuint* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 1259c1260 < %name(glColorPointeri) void _glColorPointer(GLint d_3_1, GLenum type_INT, GLsizei stride_0, GLint* pointer); --- > %name(glColorPointeri) void _glColorPointer(GLint d_3_1, GLenum type_INT, GLsizei stride_0, GLint* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 1262c1263 < %name(glColorPointerf) void _glColorPointer(GLint d_3_1, GLenum type_FLOAT, GLsizei stride_0, GLfloat *pointer); --- > %name(glColorPointerf) void _glColorPointer(GLint d_3_1, GLenum type_FLOAT, GLsizei stride_0, GLfloat *pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 1265c1266 < %name(glColorPointerd) void _glColorPointer(GLint d_3_1, GLenum type_DOUBLE, GLsizei stride_0, GLdouble *pointer); --- > %name(glColorPointerd) void _glColorPointer(GLint d_3_1, GLenum type_DOUBLE, GLsizei stride_0, GLdouble *pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 1481c1482 < void _glEdgeFlagPointer(GLsizei stride, GLvoid *pointer) --- > void _glEdgeFlagPointer(GLsizei stride, GLvoid * pointer_or_offset, _GL_Argument_Type arg_type) 1484,1485c1485,1487 < acquire(pointer); < glEdgeFlagPointer(stride, pointer); --- > if (arg_type == _GL_Argument_Type_Pointer) > acquire(pointer_or_offset); > glEdgeFlagPointer(stride, pointer_or_offset); 1489,1490c1491,1492 < %name(glEdgeFlagPointer) void _glEdgeFlagPointer(GLsizei stride, void *pointer); < DOC(glEdgeFlagPointer, "glEdgeFlagPointer(stride, pointer) -> None") --- > %name(glEdgeFlagPointer) void _glEdgeFlagPointer(GLsizei stride, GLvoid * pointer_or_offset, _GL_Argument_Type arg_type); > DOC(glEdgeFlagPointer, "glEdgeFlagPointer(stride, pointer_or_offset) -> None") 1492c1494 < %name(glEdgeFlagPointerb) void _glEdgeFlagPointer(GLsizei stride_0, GLbyte* pointer); --- > %name(glEdgeFlagPointerb) void _glEdgeFlagPointer(GLsizei stride_0, GLbyte* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 2233c2235 < void _glIndexPointer(GLenum type, GLsizei stride, GLvoid *pointer) --- > void _glIndexPointer(GLenum type, GLsizei stride, GLvoid * pointer_or_offset, _GL_Argument_Type arg_type) 2236,2237c2238,2240 < acquire(pointer); < glIndexPointer(type, stride, pointer); --- > if (arg_type == _GL_Argument_Type_Pointer) > acquire(pointer_or_offset); > glIndexPointer(type, stride, pointer_or_offset); 2241,2242c2244,2245 < %name(glIndexPointer) void _glIndexPointer(GLenum type, GLsizei stride, void *pointer); < DOC(glIndexPointer, "glIndexPointer(type, stride, pointer) -> None") --- > %name(glIndexPointer) void _glIndexPointer(GLenum type, GLsizei stride, GLvoid * pointer_or_offset, _GL_Argument_Type arg_type); > DOC(glIndexPointer, "glIndexPointer(type, stride, pointer_or_offset) -> None") 2244c2247 < %name(glIndexPointerub) void _glIndexPointer(GLenum type_UNSIGNED_BYTE, GLsizei stride_0, GLubyte* pointer); --- > %name(glIndexPointerub) void _glIndexPointer(GLenum type_UNSIGNED_BYTE, GLsizei stride_0, GLubyte* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 2247c2250 < %name(glIndexPointerb) void _glIndexPointer(GLenum type_BYTE, GLsizei stride_0, GLbyte* pointer); --- > %name(glIndexPointerb) void _glIndexPointer(GLenum type_BYTE, GLsizei stride_0, GLbyte* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 2250c2253 < %name(glIndexPointers) void _glIndexPointer(GLenum type_SHORT, GLsizei stride_0, GLshort* pointer); --- > %name(glIndexPointers) void _glIndexPointer(GLenum type_SHORT, GLsizei stride_0, GLshort* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 2253c2256 < %name(glIndexPointeri) void _glIndexPointer(GLenum type_INT, GLsizei stride_0, GLint* pointer); --- > %name(glIndexPointeri) void _glIndexPointer(GLenum type_INT, GLsizei stride_0, GLint* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 2256c2259 < %name(glIndexPointerf) void _glIndexPointer(GLenum type_FLOAT, GLsizei stride_0, GLfloat* pointer); --- > %name(glIndexPointerf) void _glIndexPointer(GLenum type_FLOAT, GLsizei stride_0, GLfloat* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 2259c2262 < %name(glIndexPointerd) void _glIndexPointer(GLenum type_DOUBLE, GLsizei stride_0, GLdouble* pointer); --- > %name(glIndexPointerd) void _glIndexPointer(GLenum type_DOUBLE, GLsizei stride_0, GLdouble* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 2660c2663 < void _glNormalPointer(GLenum type, GLsizei stride, GLvoid *pointer) --- > void _glNormalPointer(GLenum type, GLsizei stride, GLvoid *pointer_or_offset, _GL_Argument_Type arg_type) 2663,2664c2666,2668 < acquire(pointer); < glNormalPointer(type, stride, pointer); --- > if (arg_type == _GL_Argument_Type_Pointer) > acquire(pointer_or_offset); > glNormalPointer(type, stride, pointer_or_offset); 2668,2669c2672,2673 < %name(glNormalPointer) void _glNormalPointer(GLenum type, GLsizei stride, void *pointer); < DOC(glNormalPointer, "glNormalPointer(size, type, stride, pointer) -> None") --- > %name(glNormalPointer) void _glNormalPointer(GLenum type, GLsizei stride, GLvoid * pointer_or_offset, _GL_Argument_Type arg_type); > DOC(glNormalPointer, "glNormalPointer(size, type, stride, pointer_or_offset) -> None") 2671c2675 < %name(glNormalPointerb) void _glNormalPointer(GLenum type_BYTE, GLsizei stride_0, GLbyte* pointer); --- > %name(glNormalPointerb) void _glNormalPointer(GLenum type_BYTE, GLsizei stride_0, GLbyte* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 2674c2678 < %name(glNormalPointers) void _glNormalPointer(GLenum type_SHORT, GLsizei stride_0, GLshort* pointer); --- > %name(glNormalPointers) void _glNormalPointer(GLenum type_SHORT, GLsizei stride_0, GLshort* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 2677c2681 < %name(glNormalPointeri) void _glNormalPointer(GLenum type_INT, GLsizei stride_0, GLint* pointer); --- > %name(glNormalPointeri) void _glNormalPointer(GLenum type_INT, GLsizei stride_0, GLint* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 2680c2684 < %name(glNormalPointerf) void _glNormalPointer(GLenum type_FLOAT, GLsizei stride_0, GLfloat* pointer); --- > %name(glNormalPointerf) void _glNormalPointer(GLenum type_FLOAT, GLsizei stride_0, GLfloat* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 2683c2687 < %name(glNormalPointerd) void _glNormalPointer(GLenum type_DOUBLE, GLsizei stride_0, GLdouble* pointer); --- > %name(glNormalPointerd) void _glNormalPointer(GLenum type_DOUBLE, GLsizei stride_0, GLdouble* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 3750c3754 < void _glTexCoordPointer(GLint size, GLenum type, GLsizei stride, GLvoid *pointer) --- > void _glTexCoordPointer(GLint size, GLenum type, GLsizei stride, GLvoid * pointer_or_offset, _GL_Argument_Type arg_type) 3753,3754c3757,3759 < acquire(pointer); < glTexCoordPointer(size, type, stride, pointer); --- > if (arg_type == _GL_Argument_Type_Pointer) > acquire(pointer_or_offset); > glTexCoordPointer(size, type, stride, pointer_or_offset); 3758,3759c3763,3764 < %name(glTexCoordPointer) void _glTexCoordPointer(GLint size, GLenum type, GLsizei stride, void *pointer); < DOC(glTexCoordPointer, "glTexCoordPointer(size, type, stride, pointer) -> None") --- > %name(glTexCoordPointer) void _glTexCoordPointer(GLint size, GLenum type, GLsizei stride, GLvoid * pointer_or_offset, _GL_Argument_Type arg_type); > DOC(glTexCoordPointer, "glTexCoordPointer(size, type, stride, pointer_or_offset) -> None") 3761c3766 < %name(glTexCoordPointerb) void _glTexCoordPointer(GLint d_3_1, GLenum type_BYTE, GLsizei stride_0, GLbyte* pointer); --- > %name(glTexCoordPointerb) void _glTexCoordPointer(GLint d_3_1, GLenum type_BYTE, GLsizei stride_0, GLbyte* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 3764c3769 < %name(glTexCoordPointers) void _glTexCoordPointer(GLint d_3_1, GLenum type_SHORT, GLsizei stride_0, GLshort* pointer); --- > %name(glTexCoordPointers) void _glTexCoordPointer(GLint d_3_1, GLenum type_SHORT, GLsizei stride_0, GLshort* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 3767c3772 < %name(glTexCoordPointeri) void _glTexCoordPointer(GLint d_3_1, GLenum type_INT, GLsizei stride_0, GLint* pointer); --- > %name(glTexCoordPointeri) void _glTexCoordPointer(GLint d_3_1, GLenum type_INT, GLsizei stride_0, GLint* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 3770c3775 < %name(glTexCoordPointerf) void _glTexCoordPointer(GLint d_3_1, GLenum type_FLOAT, GLsizei stride_0, GLfloat* pointer); --- > %name(glTexCoordPointerf) void _glTexCoordPointer(GLint d_3_1, GLenum type_FLOAT, GLsizei stride_0, GLfloat* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 3773c3778 < %name(glTexCoordPointerd) void _glTexCoordPointer(GLint d_3_1, GLenum type_DOUBLE, GLsizei stride_0, GLdouble* pointer); --- > %name(glTexCoordPointerd) void _glTexCoordPointer(GLint d_3_1, GLenum type_DOUBLE, GLsizei stride_0, GLdouble* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 4042c4047 < void _glVertexPointer(GLint size, GLenum type, GLsizei stride, GLvoid *pointer) --- > void _glVertexPointer(GLint size, GLenum type, GLsizei stride, GLvoid * pointer_or_offset, _GL_Argument_Type arg_type) 4045,4046c4050,4052 < acquire(pointer); < glVertexPointer(size, type, stride, pointer); --- > if (arg_type == _GL_Argument_Type_Pointer) > acquire(pointer_or_offset); > glVertexPointer(size, type, stride, pointer_or_offset); 4050c4056 < %name(glVertexPointer) void _glVertexPointer(GLint size, GLenum type, GLsizei stride, void *pointer); --- > %name(glVertexPointer) void _glVertexPointer(GLint size, GLenum type, GLsizei stride, GLvoid * pointer_or_offset, _GL_Argument_Type arg_type); 4053c4059 < %name(glVertexPointerb) void _glVertexPointer(GLint d_3_1, GLenum type_BYTE, GLsizei stride_0, GLbyte* pointer); --- > %name(glVertexPointerb) void _glVertexPointer(GLint d_3_1, GLenum type_BYTE, GLsizei stride_0, GLbyte* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 4056c4062 < %name(glVertexPointers) void _glVertexPointer(GLint d_3_1, GLenum type_SHORT, GLsizei stride_0, GLshort* pointer); --- > %name(glVertexPointers) void _glVertexPointer(GLint d_3_1, GLenum type_SHORT, GLsizei stride_0, GLshort* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 4059c4065 < %name(glVertexPointeri) void _glVertexPointer(GLint d_3_1, GLenum type_INT, GLsizei stride_0, GLint* pointer); --- > %name(glVertexPointeri) void _glVertexPointer(GLint d_3_1, GLenum type_INT, GLsizei stride_0, GLint* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 4062c4068 < %name(glVertexPointerf) void _glVertexPointer(GLint d_3_1, GLenum type_FLOAT, GLsizei stride_0, GLfloat* pointer); --- > %name(glVertexPointerf) void _glVertexPointer(GLint d_3_1, GLenum type_FLOAT, GLsizei stride_0, GLfloat* pointer, _GL_Argument_Type type_POINTER_AS_POINTER); 4065c4071 < %name(glVertexPointerd) void _glVertexPointer(GLint d_3_1, GLenum type_DOUBLE, GLsizei stride_0, GLdouble* pointer); --- > %name(glVertexPointerd) void _glVertexPointer(GLint d_3_1, GLenum type_DOUBLE, GLsizei stride_0, GLdouble* pointer, _GL_Argument_Type type_POINTER_AS_POINTER);