José Fonseca | 4364860 | 2011-05-15 12:56:59 +0100 | [diff] [blame] | 1 | ########################################################################## |
| 2 | # |
| 3 | # Copyright 2008-2009 VMware, Inc. |
| 4 | # All Rights Reserved. |
| 5 | # |
| 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | # of this software and associated documentation files (the "Software"), to deal |
| 8 | # in the Software without restriction, including without limitation the rights |
| 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | # copies of the Software, and to permit persons to whom the Software is |
| 11 | # furnished to do so, subject to the following conditions: |
| 12 | # |
| 13 | # The above copyright notice and this permission notice shall be included in |
| 14 | # all copies or substantial portions of the Software. |
| 15 | # |
| 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 22 | # THE SOFTWARE. |
| 23 | # |
| 24 | ##########################################################################/ |
| 25 | |
José Fonseca | 17a2f96 | 2011-10-05 20:49:39 +0100 | [diff] [blame] | 26 | """CGL API description. |
| 27 | |
| 28 | http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CGL_OpenGL/Reference/reference.html |
| 29 | """ |
José Fonseca | 4364860 | 2011-05-15 12:56:59 +0100 | [diff] [blame] | 30 | |
| 31 | |
| 32 | from stdapi import * |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 33 | from glapi import * |
José Fonseca | 4364860 | 2011-05-15 12:56:59 +0100 | [diff] [blame] | 34 | from glapi import glapi |
| 35 | |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 36 | IOSurfaceRef = Opaque("IOSurfaceRef") |
| 37 | CGLContextObj = Opaque("CGLContextObj") |
| 38 | CGLPixelFormatObj = Opaque("CGLPixelFormatObj") |
| 39 | CGLRendererInfoObj = Opaque("CGLRendererInfoObj") |
| 40 | CGLPBufferObj = Opaque("CGLPBufferObj") |
| 41 | CGLShareGroup = Opaque("CGLShareGroup") |
| 42 | CGLShareGroupObj = Opaque("CGLShareGroupObj") |
José Fonseca | 289dc2f | 2011-09-27 14:43:09 +0100 | [diff] [blame] | 43 | CGSConnectionID = Opaque("CGSConnectionID") |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 44 | CGSWindowID = Alias("CGSWindowID", Int) |
| 45 | CGSSurfaceID = Alias("CGSSurfaceID", Int) |
| 46 | |
José Fonseca | 4eca2f6 | 2013-10-29 14:28:52 +0000 | [diff] [blame^] | 47 | CGLOpenGLProfile = Enum("CGLOpenGLProfile", [ |
| 48 | 'kCGLOGLPVersion_Legacy', |
| 49 | 'kCGLOGLPVersion_3_2_Core', |
| 50 | #'kCGLOGLPVersion_GL3_Core', # Same as kCGLOGLPVersion_3_2_Core |
| 51 | 'kCGLOGLPVersion_GL4_Core', |
| 52 | ]) |
| 53 | |
| 54 | CGLPixelFormatAttributes = [ |
| 55 | ("kCGLPFAAllRenderers", None), |
| 56 | ("kCGLPFATripleBuffer", None), |
| 57 | ("kCGLPFADoubleBuffer", None), |
| 58 | ("kCGLPFAStereo", None), |
| 59 | ("kCGLPFAColorSize", Int), |
| 60 | ("kCGLPFAAlphaSize", Int), |
| 61 | ("kCGLPFADepthSize", Int), |
| 62 | ("kCGLPFAStencilSize", Int), |
| 63 | ("kCGLPFAMinimumPolicy", None), |
| 64 | ("kCGLPFAMaximumPolicy", None), |
| 65 | ("kCGLPFASampleBuffers", Int), |
| 66 | ("kCGLPFASamples", Int), |
| 67 | ("kCGLPFAColorFloat", None), |
| 68 | ("kCGLPFAMultisample", None), |
| 69 | ("kCGLPFASupersample", None), |
| 70 | ("kCGLPFASampleAlpha", None), |
| 71 | ("kCGLPFARendererID", Int), |
| 72 | ("kCGLPFANoRecovery", None), |
| 73 | ("kCGLPFAAccelerated", None), |
| 74 | ("kCGLPFAClosestPolicy", None), |
| 75 | ("kCGLPFABackingStore", None), |
| 76 | ("kCGLPFABackingVolatile", None), |
| 77 | ("kCGLPFADisplayMask", Int), |
| 78 | ("kCGLPFAAllowOfflineRenderers", None), |
| 79 | ("kCGLPFAAcceleratedCompute", None), |
| 80 | ("kCGLPFAOpenGLProfile", CGLOpenGLProfile), |
| 81 | ("kCGLPFASupportsAutomaticGraphicsSwitching", None), |
| 82 | ("kCGLPFAVirtualScreenCount", Int), |
| 83 | ("kCGLPFAAuxBuffers", None), |
| 84 | ("kCGLPFAAccumSize", Int), |
| 85 | ("kCGLPFAAuxDepthStencil", None), |
| 86 | ("kCGLPFAOffScreen", None), |
| 87 | ("kCGLPFAWindow", None), |
| 88 | ("kCGLPFACompliant", None), |
| 89 | ("kCGLPFAPBuffer", None), |
| 90 | ("kCGLPFARemotePBuffer", None), |
| 91 | ("kCGLPFASingleRenderer", None), |
| 92 | ("kCGLPFARobust", None), |
| 93 | ("kCGLPFAMPSafe", None), |
| 94 | ("kCGLPFAMultiScreen", None), |
| 95 | ("kCGLPFAFullScreen", None), |
Andreas Hartmetz | 700323b | 2013-07-09 22:40:44 +0200 | [diff] [blame] | 96 | ] |
| 97 | |
José Fonseca | 4eca2f6 | 2013-10-29 14:28:52 +0000 | [diff] [blame^] | 98 | CGLPixelFormatAttribute = Enum("CGLPixelFormatAttribute", |
| 99 | [attrib for attrib, _ in CGLPixelFormatAttributes] |
| 100 | ) |
Andreas Hartmetz | 700323b | 2013-07-09 22:40:44 +0200 | [diff] [blame] | 101 | |
José Fonseca | 4eca2f6 | 2013-10-29 14:28:52 +0000 | [diff] [blame^] | 102 | CGLPixelFormatAttribs = AttribArray( |
| 103 | Const(CGLPixelFormatAttribute), |
| 104 | CGLPixelFormatAttributes |
| 105 | ) |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 106 | |
| 107 | CGLRendererProperty = Enum("CGLRendererProperty", [ |
| 108 | "kCGLRPOffScreen", |
| 109 | "kCGLRPFullScreen", |
| 110 | "kCGLRPRendererID", |
| 111 | "kCGLRPAccelerated", |
| 112 | "kCGLRPRobust", |
| 113 | "kCGLRPBackingStore", |
| 114 | "kCGLRPMPSafe", |
| 115 | "kCGLRPWindow", |
| 116 | "kCGLRPMultiScreen", |
| 117 | "kCGLRPCompliant", |
| 118 | "kCGLRPDisplayMask", |
| 119 | "kCGLRPBufferModes", |
| 120 | "kCGLRPColorModes", |
| 121 | "kCGLRPAccumModes", |
| 122 | "kCGLRPDepthModes", |
| 123 | "kCGLRPStencilModes", |
| 124 | "kCGLRPMaxAuxBuffers", |
| 125 | "kCGLRPMaxSampleBuffers", |
| 126 | "kCGLRPMaxSamples", |
| 127 | "kCGLRPSampleModes", |
| 128 | "kCGLRPSampleAlpha", |
| 129 | "kCGLRPVideoMemory", |
| 130 | "kCGLRPTextureMemory", |
| 131 | "kCGLRPGPUVertProcCapable", |
| 132 | "kCGLRPGPUFragProcCapable", |
| 133 | "kCGLRPRendererCount", |
| 134 | "kCGLRPOnline", |
| 135 | "kCGLRPAcceleratedCompute", |
José Fonseca | 4eca2f6 | 2013-10-29 14:28:52 +0000 | [diff] [blame^] | 136 | "kCGLRPVideoMemoryMegabytes", |
| 137 | "kCGLRPTextureMemoryMegabytes", |
| 138 | "kCGLRPMajorGLVersion", |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 139 | ]) |
| 140 | |
| 141 | CGLContextEnable = Enum("CGLContextEnable", [ |
| 142 | "kCGLCESwapRectangle", |
| 143 | "kCGLCESwapLimit", |
| 144 | "kCGLCERasterization", |
| 145 | "kCGLCEStateValidation", |
| 146 | "kCGLCESurfaceBackingSize", |
| 147 | "kCGLCEDisplayListOptimization", |
| 148 | "kCGLCEMPEngine", |
José Fonseca | 4eca2f6 | 2013-10-29 14:28:52 +0000 | [diff] [blame^] | 149 | "kCGLCECrashOnRemovedFunctions", |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 150 | ]) |
| 151 | |
| 152 | CGLContextParameter = Enum("CGLContextParameter", [ |
| 153 | "kCGLCPSwapRectangle", |
| 154 | "kCGLCPSwapInterval", |
| 155 | "kCGLCPDispatchTableSize", |
| 156 | "kCGLCPClientStorage", |
| 157 | "kCGLCPSurfaceTexture", |
| 158 | "kCGLCPSurfaceOrder", |
| 159 | "kCGLCPSurfaceOpacity", |
| 160 | "kCGLCPSurfaceBackingSize", |
| 161 | "kCGLCPSurfaceSurfaceVolatile", |
| 162 | "kCGLCPReclaimResources", |
| 163 | "kCGLCPCurrentRendererID", |
| 164 | "kCGLCPGPUVertexProcessing", |
| 165 | "kCGLCPGPUFragmentProcessing", |
| 166 | "kCGLCPHasDrawable", |
| 167 | "kCGLCPMPSwapsInFlight", |
| 168 | ]) |
| 169 | |
| 170 | CGLGlobalOption = Enum("CGLGlobalOption", [ |
| 171 | "kCGLGOFormatCacheSize", |
| 172 | "kCGLGOClearFormatCache", |
| 173 | "kCGLGORetainRenderers", |
| 174 | "kCGLGOResetLibrary", |
| 175 | "kCGLGOUseErrorHandler", |
| 176 | "kCGLGOUseBuildCache", |
| 177 | ]) |
José Fonseca | 4364860 | 2011-05-15 12:56:59 +0100 | [diff] [blame] | 178 | |
| 179 | CGLError = Enum("CGLError", [ |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 180 | "kCGLNoError", |
| 181 | "kCGLBadAttribute", |
| 182 | "kCGLBadProperty", |
| 183 | "kCGLBadPixelFormat", |
| 184 | "kCGLBadRendererInfo", |
| 185 | "kCGLBadContext", |
| 186 | "kCGLBadDrawable", |
| 187 | "kCGLBadDisplay", |
| 188 | "kCGLBadState", |
| 189 | "kCGLBadValue", |
| 190 | "kCGLBadMatch", |
| 191 | "kCGLBadEnumeration", |
| 192 | "kCGLBadOffScreen", |
| 193 | "kCGLBadFullScreen", |
| 194 | "kCGLBadWindow", |
| 195 | "kCGLBadAddress", |
| 196 | "kCGLBadCodeModule", |
| 197 | "kCGLBadAlloc", |
| 198 | "kCGLBadConnection", |
José Fonseca | 4364860 | 2011-05-15 12:56:59 +0100 | [diff] [blame] | 199 | ]) |
| 200 | |
| 201 | CGLContextObj = Opaque("CGLContextObj") |
| 202 | |
José Fonseca | 8130193 | 2012-11-11 00:10:20 +0000 | [diff] [blame] | 203 | cglapi = Module("CGL") |
José Fonseca | 4364860 | 2011-05-15 12:56:59 +0100 | [diff] [blame] | 204 | |
José Fonseca | 54f304a | 2012-01-14 19:33:08 +0000 | [diff] [blame] | 205 | cglapi.addFunctions([ |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 206 | # CGLCurrent.h, libGL.dylib |
José Fonseca | 4364860 | 2011-05-15 12:56:59 +0100 | [diff] [blame] | 207 | Function(CGLError, "CGLSetCurrentContext", [(CGLContextObj, "ctx")]), |
| 208 | Function(CGLContextObj, "CGLGetCurrentContext", []), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 209 | |
| 210 | # OpenGL.h, OpenGL framework |
Andreas Hartmetz | 700323b | 2013-07-09 22:40:44 +0200 | [diff] [blame] | 211 | Function(CGLError, "CGLChoosePixelFormat", [(CGLPixelFormatAttribs, "attribs"), Out(Pointer(CGLPixelFormatObj), "pix"), Out(Pointer(GLint), "npix")]), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 212 | Function(CGLError, "CGLDestroyPixelFormat", [(CGLPixelFormatObj, "pix")]), |
José Fonseca | 17a2f96 | 2011-10-05 20:49:39 +0100 | [diff] [blame] | 213 | Function(CGLError, "CGLDescribePixelFormat", [(CGLPixelFormatObj, "pix"), (GLint, "pix_num"), (CGLPixelFormatAttribute, "attrib"), Out(Pointer(GLint), "value")]), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 214 | Function(Void, "CGLReleasePixelFormat", [(CGLPixelFormatObj, "pix")]), |
| 215 | Function(CGLPixelFormatObj, "CGLRetainPixelFormat", [(CGLPixelFormatObj, "pix")]), |
| 216 | Function(GLuint, "CGLGetPixelFormatRetainCount", [(CGLPixelFormatObj, "pix")]), |
José Fonseca | 17a2f96 | 2011-10-05 20:49:39 +0100 | [diff] [blame] | 217 | Function(CGLError, "CGLQueryRendererInfo", [(GLuint, "display_mask"), Out(Pointer(CGLRendererInfoObj), "rend"), Out(Pointer(GLint), "nrend")]), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 218 | Function(CGLError, "CGLDestroyRendererInfo", [(CGLRendererInfoObj, "rend")]), |
| 219 | Function(CGLError, "CGLDescribeRenderer", [(CGLRendererInfoObj, "rend"), (GLint, "rend_num"), (CGLRendererProperty, "prop"), (OpaquePointer(GLint), "value")]), |
José Fonseca | 8bf847a | 2011-09-27 18:46:23 +0100 | [diff] [blame] | 220 | Function(CGLError, "CGLCreateContext", [(CGLPixelFormatObj, "pix"), (CGLContextObj, "share"), Out(Pointer(CGLContextObj), "ctx")]), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 221 | Function(CGLError, "CGLDestroyContext", [(CGLContextObj, "ctx")]), |
| 222 | Function(CGLError, "CGLCopyContext", [(CGLContextObj, "src"), (CGLContextObj, "dst"), (GLbitfield, "mask")]), |
| 223 | Function(CGLContextObj, "CGLRetainContext", [(CGLContextObj, "ctx")]), |
| 224 | Function(Void, "CGLReleaseContext", [(CGLContextObj, "ctx")]), |
| 225 | Function(GLuint, "CGLGetContextRetainCount", [(CGLContextObj, "ctx")]), |
| 226 | Function(CGLPixelFormatObj, "CGLGetPixelFormat", [(CGLContextObj, "ctx")]), |
José Fonseca | 8bf847a | 2011-09-27 18:46:23 +0100 | [diff] [blame] | 227 | Function(CGLError, "CGLCreatePBuffer", [(GLsizei, "width"), (GLsizei, "height"), (GLenum, "target"), (GLenum, "internalFormat"), (GLint, "max_level"), Out(Pointer(CGLPBufferObj), "pbuffer")]), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 228 | Function(CGLError, "CGLDestroyPBuffer", [(CGLPBufferObj, "pbuffer")]), |
José Fonseca | 8bf847a | 2011-09-27 18:46:23 +0100 | [diff] [blame] | 229 | 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")]), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 230 | Function(CGLError, "CGLTexImagePBuffer", [(CGLContextObj, "ctx"), (CGLPBufferObj, "pbuffer"), (GLenum, "source")]), |
| 231 | Function(CGLPBufferObj, "CGLRetainPBuffer", [(CGLPBufferObj, "pbuffer")]), |
| 232 | Function(Void, "CGLReleasePBuffer", [(CGLPBufferObj, "pbuffer")]), |
| 233 | Function(GLuint, "CGLGetPBufferRetainCount", [(CGLPBufferObj, "pbuffer")]), |
| 234 | Function(CGLError, "CGLSetOffScreen", [(CGLContextObj, "ctx"), (GLsizei, "width"), (GLsizei, "height"), (GLint, "rowbytes"), (OpaquePointer(Void), "baseaddr")]), |
José Fonseca | 8bf847a | 2011-09-27 18:46:23 +0100 | [diff] [blame] | 235 | Function(CGLError, "CGLGetOffScreen", [(CGLContextObj, "ctx"), Out(Pointer(GLsizei), "width"), Out(Pointer(GLsizei), "height"), Out(Pointer(GLint), "rowbytes"), Out(Pointer(OpaquePointer(Void)), "baseaddr")]), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 236 | Function(CGLError, "CGLSetFullScreen", [(CGLContextObj, "ctx")]), |
| 237 | Function(CGLError, "CGLSetFullScreenOnDisplay", [(CGLContextObj, "ctx"), (GLuint, "display_mask")]), |
| 238 | Function(CGLError, "CGLSetPBuffer", [(CGLContextObj, "ctx"), (CGLPBufferObj, "pbuffer"), (GLenum, "face"), (GLint, "level"), (GLint, "screen")]), |
José Fonseca | 8bf847a | 2011-09-27 18:46:23 +0100 | [diff] [blame] | 239 | Function(CGLError, "CGLGetPBuffer", [(CGLContextObj, "ctx"), Out(Pointer(CGLPBufferObj), "pbuffer"), Out(Pointer(GLenum), "face"), Out(Pointer(GLint), "level"), Out(Pointer(GLint), "screen")]), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 240 | Function(CGLError, "CGLClearDrawable", [(CGLContextObj, "ctx")]), |
| 241 | Function(CGLError, "CGLFlushDrawable", [(CGLContextObj, "ctx")]), |
| 242 | Function(CGLError, "CGLEnable", [(CGLContextObj, "ctx"), (CGLContextEnable, "pname")]), |
| 243 | Function(CGLError, "CGLDisable", [(CGLContextObj, "ctx"), (CGLContextEnable, "pname")]), |
José Fonseca | 624b5ec | 2013-01-23 15:16:22 +0000 | [diff] [blame] | 244 | Function(CGLError, "CGLIsEnabled", [(CGLContextObj, "ctx"), (CGLContextEnable, "pname"), Out(Pointer(GLint), "enable")], sideeffects=False), |
José Fonseca | 4475665 | 2011-10-15 10:26:30 +0100 | [diff] [blame] | 245 | Function(CGLError, "CGLSetParameter", [(CGLContextObj, "ctx"), (CGLContextParameter, "pname"), (Array(Const(GLint), 1), "params")]), |
José Fonseca | 624b5ec | 2013-01-23 15:16:22 +0000 | [diff] [blame] | 246 | Function(CGLError, "CGLGetParameter", [(CGLContextObj, "ctx"), (CGLContextParameter, "pname"), Out(Array(GLint, 1), "params")], sideeffects=False), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 247 | Function(CGLError, "CGLSetVirtualScreen", [(CGLContextObj, "ctx"), (GLint, "screen")]), |
José Fonseca | 624b5ec | 2013-01-23 15:16:22 +0000 | [diff] [blame] | 248 | Function(CGLError, "CGLGetVirtualScreen", [(CGLContextObj, "ctx"), Out(Pointer(GLint), "screen")], sideeffects=False), |
José Fonseca | 903c2ca | 2011-09-23 09:43:05 +0100 | [diff] [blame] | 249 | Function(CGLError, "CGLSetGlobalOption", [(CGLGlobalOption, "pname"), (OpaquePointer(Const(GLint)), "params")]), |
José Fonseca | 8bf847a | 2011-09-27 18:46:23 +0100 | [diff] [blame] | 250 | Function(CGLError, "CGLGetGlobalOption", [(CGLGlobalOption, "pname"), Out(OpaquePointer(GLint), "params")]), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 251 | Function(CGLError, "CGLSetOption", [(CGLGlobalOption, "pname"), (GLint, "param")]), |
José Fonseca | 624b5ec | 2013-01-23 15:16:22 +0000 | [diff] [blame] | 252 | Function(CGLError, "CGLGetOption", [(CGLGlobalOption, "pname"), Out(Pointer(GLint), "param")], sideeffects=False), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 253 | Function(CGLError, "CGLLockContext", [(CGLContextObj, "ctx")]), |
| 254 | Function(CGLError, "CGLUnlockContext", [(CGLContextObj, "ctx")]), |
José Fonseca | 624b5ec | 2013-01-23 15:16:22 +0000 | [diff] [blame] | 255 | Function(Void, "CGLGetVersion", [Out(Pointer(GLint), "majorvers"), Out(Pointer(GLint), "minorvers")], sideeffects=False), |
| 256 | Function(ConstCString, "CGLErrorString", [(CGLError, "error")], sideeffects=False), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 257 | |
| 258 | # CGLIOSurface.h, OpenGL framework |
| 259 | Function(CGLError, "CGLTexImageIOSurface2D", [(CGLContextObj, "ctx"), (GLenum, "target"), (GLenum, "internal_format"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), (IOSurfaceRef, "ioSurface"), (GLuint, "plane")]), |
| 260 | |
| 261 | # CGLDevice.h, OpenGL framework |
| 262 | Function(CGLShareGroupObj, "CGLGetShareGroup", [(CGLContextObj, "ctx")]), |
| 263 | |
| 264 | # Undocumented, OpenGL framework |
| 265 | Function(CGLError, "CGLSetSurface", [(CGLContextObj, "ctx"), (CGSConnectionID, "cid"), (CGSWindowID, "wid"), (CGSSurfaceID, "sid")]), |
José Fonseca | 8bf847a | 2011-09-27 18:46:23 +0100 | [diff] [blame] | 266 | Function(CGLError, "CGLGetSurface", [(CGLContextObj, "ctx"), (Pointer(CGSConnectionID), "cid"), (Pointer(CGSWindowID), "wid"), (Pointer(CGSSurfaceID), "sid")]), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 267 | Function(CGLError, "CGLUpdateContext", [(CGLContextObj, "ctx")]), |
José Fonseca | e9ba177 | 2013-06-01 11:23:44 +0100 | [diff] [blame] | 268 | # XXX: All the following prototypes are little more than guesses |
| 269 | # TODO: A potentially simpler alternative would be to use the |
José Fonseca | fde03ad | 2013-06-01 18:11:02 +0100 | [diff] [blame] | 270 | # DYLD_INTERPOSE mechanism and only intercept the calls that we |
José Fonseca | e9ba177 | 2013-06-01 11:23:44 +0100 | [diff] [blame] | 271 | # really care about |
| 272 | Function(CGLError, "CGLOpenCLMuxLockDown", [], internal=True), |
| 273 | Function(GLboolean, "CGLAreContextsShared", [(CGLContextObj, "ctx1"), (CGLContextObj, "ctx2")], internal=True), |
| 274 | Function(CGLContextObj, "CGLGetNextContext", [(CGLContextObj, "ctx")], internal=True), |
| 275 | Function(OpaquePointer(Void), "CGLFrontDispatch", [(CGLContextObj, "ctx")], internal=True), |
| 276 | Function(OpaquePointer(Void), "CGLBackDispatch", [(CGLContextObj, "ctx")], internal=True), |
| 277 | Function(Void, "CGLSelectDispatch", [(CGLContextObj, "ctx"), (OpaquePointer(Void), "dispatch")], internal=True), |
| 278 | Function(Void, "CGLSelectDispatchBounded", [(CGLContextObj, "ctx"), (OpaquePointer(Void), "dispatch"), (GLint, "size")], internal=True), |
| 279 | Function(Void, "CGLSelectDispatchFunction", [(CGLContextObj, "ctx"), (OpaquePointer(Void), "functionPtr"), (GLint, "functionId")], internal=True), |
| 280 | Function(Void, "CGLRestoreDispatch", [(CGLContextObj, "ctx")], internal=True), |
| 281 | Function(Void, "CGLRestoreDispatchFunction", [(CGLContextObj, "ctx"), (GLint, "functionId")], internal=True), |
| 282 | Function(CGLError, "CGLSetPBufferVolatileState", [(CGLPBufferObj, "pbuffer"), (OpaquePointer(Void), "state")], internal=True), |
José Fonseca | 4364860 | 2011-05-15 12:56:59 +0100 | [diff] [blame] | 283 | ]) |
| 284 | |