X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=specs%2Fgltypes.py;h=a04990d9ec33ec72550e39aa3a5a3834e1b20187;hb=c8695f74ce1ee6a93dee4b3f7da5a70a64706c82;hp=4324ac7e389ad75a6fb9abfadc5127a685a3a10f;hpb=cb9d2e002ba98b743851db4016dc68ba3ddbd845;p=apitrace diff --git a/specs/gltypes.py b/specs/gltypes.py index 4324ac7..a04990d 100644 --- a/specs/gltypes.py +++ b/specs/gltypes.py @@ -100,7 +100,7 @@ GLshader = Handle("shader", GLuint) GLlocation = Handle("location", GLint, key=('program', GLhandleARB)) GLlocationARB = Handle("location", GLint, key=('programObj', GLhandleARB)) -contextKey = ('reinterpret_cast(glretrace::currentContext)', UIntPtr) +contextKey = ('reinterpret_cast(glretrace::getCurrentContext())', UIntPtr) GLprogramARB = Handle("programARB", GLuint) GLframebuffer = Handle("framebuffer", GLuint) @@ -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, + )