X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=specs%2Fgltypes.py;h=a04990d9ec33ec72550e39aa3a5a3834e1b20187;hb=HEAD;hp=23af3279e54f2e51a33e8ebba9ad6166131a7d36;hpb=1f94577d8c4b1c1a2a1a8f3dceb0daac02dd72b7;p=apitrace diff --git a/specs/gltypes.py b/specs/gltypes.py index 23af327..a04990d 100644 --- a/specs/gltypes.py +++ b/specs/gltypes.py @@ -237,3 +237,16 @@ GLbitfield_barrier = Flags(GLbitfield, [ size_bgra = FakeEnum(GLint, [ "GL_BGRA", ]) + + +def GLindexBuffer(countExpr, typeExpr): + # Indices arguments are polymorphic: + # - offsets when element array buffer is bound + # - or a blob otherwise. + sizeExpr = '%s*_gl_type_size(%s)' % (countExpr, typeExpr) + return Polymorphic('_element_array_buffer_binding()', [ + ('0', Blob(Const(GLvoid), sizeExpr)), + ], + IntPointer("const GLvoid *"), + contextLess=False, + )