1
'''OpenGL extension EXT.multi_draw_arrays
3
This module customises the behaviour of the
4
OpenGL.raw.GL.EXT.multi_draw_arrays to provide a more
7
Overview (from the spec)
9
These functions behave identically to the standard OpenGL 1.1 functions
10
glDrawArrays() and glDrawElements() except they handle multiple lists of
11
vertices in one call. Their main purpose is to allow one function call
12
to render more than one primitive such as triangle strip, triangle fan,
15
The official definition of this extension is available here:
16
http://www.opengl.org/registry/specs/EXT/multi_draw_arrays.txt
18
from OpenGL import platform, constants, constant, arrays
19
from OpenGL import extensions, wrapper
20
from OpenGL.GL import glget
22
from OpenGL.raw.GL.EXT.multi_draw_arrays import *
23
### END AUTOGENERATED SECTION
24
from OpenGL.lazywrapper import lazy
25
from OpenGL.GL.pointers import glDrawElements
27
@lazy( glMultiDrawElementsEXT )
28
def glMultiDrawElementsEXT(baseOperation, primtype, counts, typ, indices, primcount=None):
29
"""Currently glMultiDrawElementsEXT is not working in the wrapper
31
We are replacing the code with a sequence of glDrawElements calls
32
as per the spec for the function. Basically we'd spend more effort
33
making an array of array pointers than we would creating a simple
36
if primcount is not None:
37
for i in xrange( primcount ):
38
glDrawElements( primtype, counts[i], typ, indices[i] )
40
for c,i in zip( counts, indices ):
41
glDrawElements( primtype, c, typ, i )
43
#def convertIndices( arg, wrappedOperation, args ):
44
# """Convert indices to an array of arrays"""
46
# arrays.ArrayDatatype.asArray( element, args[2] )
49
#def resolveIndices( value ):
52
# pointers.append( arrays.ArrayDatatype.voidDataPointer( v ) )
53
# typ = ctypes.POINTER(None) * len(value)
54
# return typ( *pointers )
56
#glMultiDrawElementsEXT = wrapper.wrapper( glMultiDrawElementsEXT ).setPyConverter(
57
# 'indices', convertIndices,
59
# 'indices', resolveIndices,
61
# 'count', arrays.AsArrayTyped( 'count', arrays.GLsizeiArray ),
63
# 'count', arrays.ArrayDatatype.voidDataPointer ,
b'\\ No newline at end of file'