From 17a2f968584010a79bc2258e6054ebcb4f186ec4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Wed, 5 Oct 2011 20:49:39 +0100 Subject: [PATCH] Trace GL 3.2's related CGL state. --- glimports.hpp | 6 ++++++ specs/cglapi.py | 19 +++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/glimports.hpp b/glimports.hpp index caa3a4e..7235d62 100644 --- a/glimports.hpp +++ b/glimports.hpp @@ -107,6 +107,12 @@ typedef struct _WGLSWAP #include #include +#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 diff --git a/specs/cglapi.py b/specs/cglapi.py index 9f92a3e..d307286 100644 --- a/specs/cglapi.py +++ b/specs/cglapi.py @@ -23,7 +23,10 @@ # ##########################################################################/ -"""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")]), -- 2.43.0