From cb9d2e002ba98b743851db4016dc68ba3ddbd845 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 19 Oct 2012 14:51:48 +0100 Subject: [PATCH 1/1] Fix array swizzling. --- specs/glapi.py | 8 ++++---- specs/gltypes.py | 5 ++++- specs/stdapi.py | 2 ++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/specs/glapi.py b/specs/glapi.py index c2b13e2..3db0739 100644 --- a/specs/glapi.py +++ b/specs/glapi.py @@ -2143,10 +2143,10 @@ glapi.addFunctions([ GlFunction(Void, "glFinishObjectAPPLE", [(GLenum, "object"), (GLint, "name")]), # XXX: name needs swizzling # GL_APPLE_vertex_array_object - GlFunction(Void, "glBindVertexArrayAPPLE", [(GLarray, "array")]), - GlFunction(Void, "glDeleteVertexArraysAPPLE", [(GLsizei, "n"), (Array(Const(GLarray), "n"), "arrays")]), - GlFunction(Void, "glGenVertexArraysAPPLE", [(GLsizei, "n"), Out(Array(GLarray, "n"), "arrays")]), - GlFunction(GLboolean, "glIsVertexArrayAPPLE", [(GLarray, "array")], sideeffects=False), + GlFunction(Void, "glBindVertexArrayAPPLE", [(GLarrayAPPLE, "array")]), + GlFunction(Void, "glDeleteVertexArraysAPPLE", [(GLsizei, "n"), (Array(Const(GLarrayAPPLE), "n"), "arrays")]), + GlFunction(Void, "glGenVertexArraysAPPLE", [(GLsizei, "n"), Out(Array(GLarrayAPPLE, "n"), "arrays")]), + GlFunction(GLboolean, "glIsVertexArrayAPPLE", [(GLarrayAPPLE, "array")], sideeffects=False), # GL_APPLE_vertex_array_range GlFunction(Void, "glVertexArrayRangeAPPLE", [(GLsizei, "length"), (GLpointer, "pointer")]), diff --git a/specs/gltypes.py b/specs/gltypes.py index 5256e59..4324ac7 100644 --- a/specs/gltypes.py +++ b/specs/gltypes.py @@ -100,11 +100,14 @@ GLshader = Handle("shader", GLuint) GLlocation = Handle("location", GLint, key=('program', GLhandleARB)) GLlocationARB = Handle("location", GLint, key=('programObj', GLhandleARB)) +contextKey = ('reinterpret_cast(glretrace::currentContext)', UIntPtr) + GLprogramARB = Handle("programARB", GLuint) GLframebuffer = Handle("framebuffer", GLuint) GLrenderbuffer = Handle("renderbuffer", GLuint) GLfragmentShaderATI = Handle("fragmentShaderATI", GLuint) -GLarray = Handle("array", GLuint) +GLarray = Handle("array", GLuint, key=contextKey) # per-context +GLarrayAPPLE = Handle("arrayAPPLE", GLuint) # shared GLregion = Handle("region", GLuint) GLpipeline = Handle("pipeline", GLuint) GLsampler = Handle("sampler", GLuint) diff --git a/specs/stdapi.py b/specs/stdapi.py index cde94cb..8a5a5a7 100644 --- a/specs/stdapi.py +++ b/specs/stdapi.py @@ -129,6 +129,8 @@ UInt32 = Literal("uint32_t", "UInt") Int64 = Literal("int64_t", "SInt") UInt64 = Literal("uint64_t", "UInt") +IntPtr = Literal("intptr_t", "SInt") +UIntPtr = Literal("uintptr_t", "UInt") class Const(Type): -- 2.43.0