]> git.cworth.org Git - apitrace/blobdiff - specs/cglapi.py
Use skiplist-based FastCallSet within trace::CallSet
[apitrace] / specs / cglapi.py
index 1aac1b2e0a3f8419cb39f55b3c71e5918e3f635d..89e89172c3ded08e1ab59904d5880ffb017e625a 100644 (file)
 #
 ##########################################################################/
 
-"""CGL API description."""
+"""CGL API description.
+
+http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CGL_OpenGL/Reference/reference.html
+"""
 
 
 from stdapi import *
@@ -37,7 +40,7 @@ CGLRendererInfoObj = Opaque("CGLRendererInfoObj")
 CGLPBufferObj = Opaque("CGLPBufferObj")
 CGLShareGroup = Opaque("CGLShareGroup")
 CGLShareGroupObj = Opaque("CGLShareGroupObj")
-CGSConnectionID = Alias("CGSConnectionID", Int)
+CGSConnectionID = Opaque("CGSConnectionID")
 CGSWindowID = Alias("CGSWindowID", Int)
 CGSSurfaceID = Alias("CGSSurfaceID", Int)
 
@@ -75,10 +78,14 @@ CGLPixelFormatAttribute = Enum("CGLPixelFormatAttribute", [
     "kCGLPFARemotePBuffer",
     "kCGLPFAAllowOfflineRenderers",
     "kCGLPFAAcceleratedCompute",
+    "kCGLPFAOpenGLProfile",
     "kCGLPFAVirtualScreenCount",
     "kCGLPFARobust",
     "kCGLPFAMPSafe",
     "kCGLPFAMultiScreen",
+
+    "kCGLOGLPVersion_Legacy",
+    "kCGLOGLPVersion_3_2_Core",
 ])
 
 CGLRendererProperty = Enum("CGLRendererProperty", [
@@ -173,60 +180,60 @@ CGLError = Enum("CGLError", [
 
 CGLContextObj = Opaque("CGLContextObj")
 
-cglapi = API("CGL")
+cglapi = Module("CGL")
 
-cglapi.add_functions([
+cglapi.addFunctions([
     # CGLCurrent.h, libGL.dylib
     Function(CGLError, "CGLSetCurrentContext", [(CGLContextObj, "ctx")]),
     Function(CGLContextObj, "CGLGetCurrentContext", []),
 
     # OpenGL.h, OpenGL framework
-    Function(CGLError, "CGLChoosePixelFormat", [(OpaquePointer(Const(CGLPixelFormatAttribute)), "attribs"), (OpaquePointer(CGLPixelFormatObj), "pix"), (OpaquePointer(GLint), "npix")]),
+    Function(CGLError, "CGLChoosePixelFormat", [(Array(Const(CGLPixelFormatAttribute), "_AttribList_size(attribs)"), "attribs"), Out(Pointer(CGLPixelFormatObj), "pix"), Out(Pointer(GLint), "npix")]),
     Function(CGLError, "CGLDestroyPixelFormat", [(CGLPixelFormatObj, "pix")]),
-    Function(CGLError, "CGLDescribePixelFormat", [(CGLPixelFormatObj, "pix"), (GLint, "pix_num"), (CGLPixelFormatAttribute, "attrib"), (OpaquePointer(GLint), "value")]),
+    Function(CGLError, "CGLDescribePixelFormat", [(CGLPixelFormatObj, "pix"), (GLint, "pix_num"), (CGLPixelFormatAttribute, "attrib"), Out(Pointer(GLint), "value")]),
     Function(Void, "CGLReleasePixelFormat", [(CGLPixelFormatObj, "pix")]),
     Function(CGLPixelFormatObj, "CGLRetainPixelFormat", [(CGLPixelFormatObj, "pix")]),
     Function(GLuint, "CGLGetPixelFormatRetainCount", [(CGLPixelFormatObj, "pix")]),
-    Function(CGLError, "CGLQueryRendererInfo", [(GLuint, "display_mask"), (OpaquePointer(CGLRendererInfoObj), "rend"), (OpaquePointer(GLint), "nrend")]),
+    Function(CGLError, "CGLQueryRendererInfo", [(GLuint, "display_mask"), Out(Pointer(CGLRendererInfoObj), "rend"), Out(Pointer(GLint), "nrend")]),
     Function(CGLError, "CGLDestroyRendererInfo", [(CGLRendererInfoObj, "rend")]),
     Function(CGLError, "CGLDescribeRenderer", [(CGLRendererInfoObj, "rend"), (GLint, "rend_num"), (CGLRendererProperty, "prop"), (OpaquePointer(GLint), "value")]),
-    Function(CGLError, "CGLCreateContext", [(CGLPixelFormatObj, "pix"), (CGLContextObj, "share"), (OpaquePointer(CGLContextObj), "ctx")]),
+    Function(CGLError, "CGLCreateContext", [(CGLPixelFormatObj, "pix"), (CGLContextObj, "share"), Out(Pointer(CGLContextObj), "ctx")]),
     Function(CGLError, "CGLDestroyContext", [(CGLContextObj, "ctx")]),
     Function(CGLError, "CGLCopyContext", [(CGLContextObj, "src"), (CGLContextObj, "dst"), (GLbitfield, "mask")]),
     Function(CGLContextObj, "CGLRetainContext", [(CGLContextObj, "ctx")]),
     Function(Void, "CGLReleaseContext", [(CGLContextObj, "ctx")]),
     Function(GLuint, "CGLGetContextRetainCount", [(CGLContextObj, "ctx")]),
     Function(CGLPixelFormatObj, "CGLGetPixelFormat", [(CGLContextObj, "ctx")]),
-    Function(CGLError, "CGLCreatePBuffer", [(GLsizei, "width"), (GLsizei, "height"), (GLenum, "target"), (GLenum, "internalFormat"), (GLint, "max_level"), (OpaquePointer(CGLPBufferObj), "pbuffer")]),
+    Function(CGLError, "CGLCreatePBuffer", [(GLsizei, "width"), (GLsizei, "height"), (GLenum, "target"), (GLenum, "internalFormat"), (GLint, "max_level"), Out(Pointer(CGLPBufferObj), "pbuffer")]),
     Function(CGLError, "CGLDestroyPBuffer", [(CGLPBufferObj, "pbuffer")]),
-    Function(CGLError, "CGLDescribePBuffer", [(CGLPBufferObj, "obj"), (OpaquePointer(GLsizei), "width"), (OpaquePointer(GLsizei), "height"), (OpaquePointer(GLenum), "target"), (OpaquePointer(GLenum), "internalFormat"), (OpaquePointer(GLint), "mipmap")]),
+    Function(CGLError, "CGLDescribePBuffer", [(CGLPBufferObj, "obj"), Out(Pointer(GLsizei), "width"), Out(Pointer(GLsizei), "height"), Out(Pointer(GLenum), "target"), Out(Pointer(GLenum), "internalFormat"), Out(Pointer(GLint), "mipmap")]),
     Function(CGLError, "CGLTexImagePBuffer", [(CGLContextObj, "ctx"), (CGLPBufferObj, "pbuffer"), (GLenum, "source")]),
     Function(CGLPBufferObj, "CGLRetainPBuffer", [(CGLPBufferObj, "pbuffer")]),
     Function(Void, "CGLReleasePBuffer", [(CGLPBufferObj, "pbuffer")]),
     Function(GLuint, "CGLGetPBufferRetainCount", [(CGLPBufferObj, "pbuffer")]),
     Function(CGLError, "CGLSetOffScreen", [(CGLContextObj, "ctx"), (GLsizei, "width"), (GLsizei, "height"), (GLint, "rowbytes"), (OpaquePointer(Void), "baseaddr")]),
-    Function(CGLError, "CGLGetOffScreen", [(CGLContextObj, "ctx"), (OpaquePointer(GLsizei), "width"), (OpaquePointer(GLsizei), "height"), (OpaquePointer(GLint), "rowbytes"), (OpaquePointer(OpaquePointer(Void)), "baseaddr")]),
+    Function(CGLError, "CGLGetOffScreen", [(CGLContextObj, "ctx"), Out(Pointer(GLsizei), "width"), Out(Pointer(GLsizei), "height"), Out(Pointer(GLint), "rowbytes"), Out(Pointer(OpaquePointer(Void)), "baseaddr")]),
     Function(CGLError, "CGLSetFullScreen", [(CGLContextObj, "ctx")]),
     Function(CGLError, "CGLSetFullScreenOnDisplay", [(CGLContextObj, "ctx"), (GLuint, "display_mask")]),
     Function(CGLError, "CGLSetPBuffer", [(CGLContextObj, "ctx"), (CGLPBufferObj, "pbuffer"), (GLenum, "face"), (GLint, "level"), (GLint, "screen")]),
-    Function(CGLError, "CGLGetPBuffer", [(CGLContextObj, "ctx"), (OpaquePointer(CGLPBufferObj), "pbuffer"), (OpaquePointer(GLenum), "face"), (OpaquePointer(GLint), "level"), (OpaquePointer(GLint), "screen")]),
+    Function(CGLError, "CGLGetPBuffer", [(CGLContextObj, "ctx"), Out(Pointer(CGLPBufferObj), "pbuffer"), Out(Pointer(GLenum), "face"), Out(Pointer(GLint), "level"), Out(Pointer(GLint), "screen")]),
     Function(CGLError, "CGLClearDrawable", [(CGLContextObj, "ctx")]),
     Function(CGLError, "CGLFlushDrawable", [(CGLContextObj, "ctx")]),
     Function(CGLError, "CGLEnable", [(CGLContextObj, "ctx"), (CGLContextEnable, "pname")]),
     Function(CGLError, "CGLDisable", [(CGLContextObj, "ctx"), (CGLContextEnable, "pname")]),
-    Function(CGLError, "CGLIsEnabled", [(CGLContextObj, "ctx"), (CGLContextEnable, "pname"), (OpaquePointer(GLint), "enable")]),
-    Function(CGLError, "CGLSetParameter", [(CGLContextObj, "ctx"), (CGLContextParameter, "pname"), (OpaquePointer(Const(GLint)), "params")]),
-    Function(CGLError, "CGLGetParameter", [(CGLContextObj, "ctx"), (CGLContextParameter, "pname"), (OpaquePointer(GLint), "params")]),
+    Function(CGLError, "CGLIsEnabled", [(CGLContextObj, "ctx"), (CGLContextEnable, "pname"), Out(Pointer(GLint), "enable")], sideeffects=False),
+    Function(CGLError, "CGLSetParameter", [(CGLContextObj, "ctx"), (CGLContextParameter, "pname"), (Array(Const(GLint), 1), "params")]),
+    Function(CGLError, "CGLGetParameter", [(CGLContextObj, "ctx"), (CGLContextParameter, "pname"), Out(Array(GLint, 1), "params")], sideeffects=False),
     Function(CGLError, "CGLSetVirtualScreen", [(CGLContextObj, "ctx"), (GLint, "screen")]),
-    Function(CGLError, "CGLGetVirtualScreen", [(CGLContextObj, "ctx"), (OpaquePointer(GLint), "screen")]),
+    Function(CGLError, "CGLGetVirtualScreen", [(CGLContextObj, "ctx"), Out(Pointer(GLint), "screen")], sideeffects=False),
     Function(CGLError, "CGLSetGlobalOption", [(CGLGlobalOption, "pname"), (OpaquePointer(Const(GLint)), "params")]),
-    Function(CGLError, "CGLGetGlobalOption", [(CGLGlobalOption, "pname"), (OpaquePointer(GLint), "params")]),
+    Function(CGLError, "CGLGetGlobalOption", [(CGLGlobalOption, "pname"), Out(OpaquePointer(GLint), "params")]),
     Function(CGLError, "CGLSetOption", [(CGLGlobalOption, "pname"), (GLint, "param")]),
-    Function(CGLError, "CGLGetOption", [(CGLGlobalOption, "pname"), (OpaquePointer(GLint), "param")]),
+    Function(CGLError, "CGLGetOption", [(CGLGlobalOption, "pname"), Out(Pointer(GLint), "param")], sideeffects=False),
     Function(CGLError, "CGLLockContext", [(CGLContextObj, "ctx")]),
     Function(CGLError, "CGLUnlockContext", [(CGLContextObj, "ctx")]),
-    Function(Void, "CGLGetVersion", [(OpaquePointer(GLint), "majorvers"), (OpaquePointer(GLint), "minorvers")]),
-    Function(Const(CString), "CGLErrorString", [(CGLError, "error")]),
+    Function(Void, "CGLGetVersion", [Out(Pointer(GLint), "majorvers"), Out(Pointer(GLint), "minorvers")], sideeffects=False),
+    Function(ConstCString, "CGLErrorString", [(CGLError, "error")], sideeffects=False),
 
     # CGLIOSurface.h, OpenGL framework
     Function(CGLError, "CGLTexImageIOSurface2D", [(CGLContextObj, "ctx"), (GLenum, "target"), (GLenum, "internal_format"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), (IOSurfaceRef, "ioSurface"), (GLuint, "plane")]),
@@ -236,7 +243,7 @@ cglapi.add_functions([
 
     # Undocumented, OpenGL framework
     Function(CGLError, "CGLSetSurface", [(CGLContextObj, "ctx"), (CGSConnectionID, "cid"), (CGSWindowID, "wid"), (CGSSurfaceID, "sid")]),
-    Function(CGLError, "CGLGetSurface", [(CGLContextObj, "ctx"), (OpaquePointer(CGSConnectionID), "cid"), (OpaquePointer(CGSWindowID), "wid"), (OpaquePointer(CGSSurfaceID), "sid")]),
+    Function(CGLError, "CGLGetSurface", [(CGLContextObj, "ctx"), (Pointer(CGSConnectionID), "cid"), (Pointer(CGSWindowID), "wid"), (Pointer(CGSSurfaceID), "sid")]),
     Function(CGLError, "CGLUpdateContext", [(CGLContextObj, "ctx")]),
     # XXX: Confirm CGLOpenCLMuxLockDown
     Function(CGLError, "CGLOpenCLMuxLockDown", []),