]> git.cworth.org Git - apitrace/commitdiff
Trace GL 3.2's related CGL state.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 5 Oct 2011 19:49:39 +0000 (20:49 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 5 Oct 2011 19:51:38 +0000 (20:51 +0100)
glimports.hpp
specs/cglapi.py

index caa3a4e9c20ac2c6d1362b219ac0de8d39c4497e..7235d6241a698609175a937dc4564e8f100967f0 100644 (file)
@@ -107,6 +107,12 @@ typedef struct _WGLSWAP
 #include <OpenGL/CGLIOSurface.h>
 #include <OpenGL/CGLDevice.h>
 
+#ifndef CGL_VERSION_1_3
+#define kCGLPFAOpenGLProfile 99
+#define kCGLOGLPVersion_Legacy 0x1000
+#define kCGLOGLPVersion_3_2_Core 0x3200
+#endif
+
 extern "C" {
 
 // From http://www.opensource.apple.com/source/gdb/gdb-954/libcheckpoint/cpcg.c
index 9f92a3ecbfbec59a8132cb6ded549e571155ed0d..d307286ac1b1fb2bcd133857451fadb677771a76 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 *
@@ -75,10 +78,14 @@ CGLPixelFormatAttribute = Enum("CGLPixelFormatAttribute", [
     "kCGLPFARemotePBuffer",
     "kCGLPFAAllowOfflineRenderers",
     "kCGLPFAAcceleratedCompute",
+    "kCGLPFAOpenGLProfile",
     "kCGLPFAVirtualScreenCount",
     "kCGLPFARobust",
     "kCGLPFAMPSafe",
     "kCGLPFAMultiScreen",
+
+    "kCGLOGLPVersion_Legacy",
+    "kCGLOGLPVersion_3_2_Core",
 ])
 
 CGLRendererProperty = Enum("CGLRendererProperty", [
@@ -181,13 +188,13 @@ cglapi.add_functions([
     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"), Out(Pointer(CGLContextObj), "ctx")]),
@@ -215,8 +222,8 @@ cglapi.add_functions([
     Function(CGLError, "CGLEnable", [(CGLContextObj, "ctx"), (CGLContextEnable, "pname")]),
     Function(CGLError, "CGLDisable", [(CGLContextObj, "ctx"), (CGLContextEnable, "pname")]),
     Function(CGLError, "CGLIsEnabled", [(CGLContextObj, "ctx"), (CGLContextEnable, "pname"), Out(Pointer(GLint), "enable")]),
-    Function(CGLError, "CGLSetParameter", [(CGLContextObj, "ctx"), (CGLContextParameter, "pname"), (OpaquePointer(Const(GLint)), "params")]),
-    Function(CGLError, "CGLGetParameter", [(CGLContextObj, "ctx"), (CGLContextParameter, "pname"), Out(OpaquePointer(GLint), "params")]),
+    Function(CGLError, "CGLSetParameter", [(CGLContextObj, "ctx"), (CGLContextParameter, "pname"), (Array(Const(GLint), "1"), "params")]),
+    Function(CGLError, "CGLGetParameter", [(CGLContextObj, "ctx"), (CGLContextParameter, "pname"), Out(Array(GLint, "1"), "params")]),
     Function(CGLError, "CGLSetVirtualScreen", [(CGLContextObj, "ctx"), (GLint, "screen")]),
     Function(CGLError, "CGLGetVirtualScreen", [(CGLContextObj, "ctx"), Out(Pointer(GLint), "screen")]),
     Function(CGLError, "CGLSetGlobalOption", [(CGLGlobalOption, "pname"), (OpaquePointer(Const(GLint)), "params")]),