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 | |
Piotr Podsiadły | 0b8b019 | 2019-01-03 20:39:55 +0100 | [diff] [blame] | 32 | from .stdapi import * |
| 33 | from .glapi import * |
| 34 | from .glapi import glapi |
José Fonseca | 4364860 | 2011-05-15 12:56:59 +0100 | [diff] [blame] | 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), |
Jose Fonseca | 2d5585c | 2015-01-23 19:11:05 +0000 | [diff] [blame] | 83 | ("kCGLPFAAuxBuffers", Int), |
José Fonseca | 4eca2f6 | 2013-10-29 14:28:52 +0000 | [diff] [blame] | 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), |
Jose Fonseca | b186733 | 2016-05-01 22:01:27 +0100 | [diff] [blame] | 96 | (1262, None), # XXX: Undocumented, but looks like a boolean |
Andreas Hartmetz | 700323b | 2013-07-09 22:40:44 +0200 | [diff] [blame] | 97 | ] |
| 98 | |
José Fonseca | 4eca2f6 | 2013-10-29 14:28:52 +0000 | [diff] [blame] | 99 | CGLPixelFormatAttribute = Enum("CGLPixelFormatAttribute", |
Jose Fonseca | b186733 | 2016-05-01 22:01:27 +0100 | [diff] [blame] | 100 | [attrib for attrib, _ in CGLPixelFormatAttributes if isinstance(attrib, str)] |
José Fonseca | 4eca2f6 | 2013-10-29 14:28:52 +0000 | [diff] [blame] | 101 | ) |
Andreas Hartmetz | 700323b | 2013-07-09 22:40:44 +0200 | [diff] [blame] | 102 | |
José Fonseca | 4eca2f6 | 2013-10-29 14:28:52 +0000 | [diff] [blame] | 103 | CGLPixelFormatAttribs = AttribArray( |
| 104 | Const(CGLPixelFormatAttribute), |
| 105 | CGLPixelFormatAttributes |
| 106 | ) |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 107 | |
| 108 | CGLRendererProperty = Enum("CGLRendererProperty", [ |
| 109 | "kCGLRPOffScreen", |
| 110 | "kCGLRPFullScreen", |
| 111 | "kCGLRPRendererID", |
| 112 | "kCGLRPAccelerated", |
| 113 | "kCGLRPRobust", |
| 114 | "kCGLRPBackingStore", |
| 115 | "kCGLRPMPSafe", |
| 116 | "kCGLRPWindow", |
| 117 | "kCGLRPMultiScreen", |
| 118 | "kCGLRPCompliant", |
| 119 | "kCGLRPDisplayMask", |
| 120 | "kCGLRPBufferModes", |
| 121 | "kCGLRPColorModes", |
| 122 | "kCGLRPAccumModes", |
| 123 | "kCGLRPDepthModes", |
| 124 | "kCGLRPStencilModes", |
| 125 | "kCGLRPMaxAuxBuffers", |
| 126 | "kCGLRPMaxSampleBuffers", |
| 127 | "kCGLRPMaxSamples", |
| 128 | "kCGLRPSampleModes", |
| 129 | "kCGLRPSampleAlpha", |
| 130 | "kCGLRPVideoMemory", |
| 131 | "kCGLRPTextureMemory", |
| 132 | "kCGLRPGPUVertProcCapable", |
| 133 | "kCGLRPGPUFragProcCapable", |
| 134 | "kCGLRPRendererCount", |
| 135 | "kCGLRPOnline", |
| 136 | "kCGLRPAcceleratedCompute", |
José Fonseca | 4eca2f6 | 2013-10-29 14:28:52 +0000 | [diff] [blame] | 137 | "kCGLRPVideoMemoryMegabytes", |
| 138 | "kCGLRPTextureMemoryMegabytes", |
| 139 | "kCGLRPMajorGLVersion", |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 140 | ]) |
| 141 | |
| 142 | CGLContextEnable = Enum("CGLContextEnable", [ |
| 143 | "kCGLCESwapRectangle", |
| 144 | "kCGLCESwapLimit", |
| 145 | "kCGLCERasterization", |
| 146 | "kCGLCEStateValidation", |
| 147 | "kCGLCESurfaceBackingSize", |
| 148 | "kCGLCEDisplayListOptimization", |
| 149 | "kCGLCEMPEngine", |
José Fonseca | 4eca2f6 | 2013-10-29 14:28:52 +0000 | [diff] [blame] | 150 | "kCGLCECrashOnRemovedFunctions", |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 151 | ]) |
| 152 | |
| 153 | CGLContextParameter = Enum("CGLContextParameter", [ |
| 154 | "kCGLCPSwapRectangle", |
| 155 | "kCGLCPSwapInterval", |
| 156 | "kCGLCPDispatchTableSize", |
| 157 | "kCGLCPClientStorage", |
| 158 | "kCGLCPSurfaceTexture", |
| 159 | "kCGLCPSurfaceOrder", |
| 160 | "kCGLCPSurfaceOpacity", |
| 161 | "kCGLCPSurfaceBackingSize", |
| 162 | "kCGLCPSurfaceSurfaceVolatile", |
| 163 | "kCGLCPReclaimResources", |
| 164 | "kCGLCPCurrentRendererID", |
| 165 | "kCGLCPGPUVertexProcessing", |
| 166 | "kCGLCPGPUFragmentProcessing", |
| 167 | "kCGLCPHasDrawable", |
| 168 | "kCGLCPMPSwapsInFlight", |
Jose Fonseca | b3ebbef | 2015-04-21 13:18:05 +0100 | [diff] [blame] | 169 | # CGLProfiler.h |
| 170 | "kCGLCPComment", |
| 171 | "kCGLCPDumpState", |
| 172 | "kCGLCPEnableForceFlush", |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 173 | ]) |
| 174 | |
| 175 | CGLGlobalOption = Enum("CGLGlobalOption", [ |
| 176 | "kCGLGOFormatCacheSize", |
| 177 | "kCGLGOClearFormatCache", |
| 178 | "kCGLGORetainRenderers", |
| 179 | "kCGLGOResetLibrary", |
| 180 | "kCGLGOUseErrorHandler", |
| 181 | "kCGLGOUseBuildCache", |
Jose Fonseca | b3ebbef | 2015-04-21 13:18:05 +0100 | [diff] [blame] | 182 | # CGLProfiler.h |
| 183 | "kCGLGOComment", |
| 184 | "kCGLGOEnableFunctionTrace", |
| 185 | "kCGLGOEnableFunctionStatistics", |
| 186 | "kCGLGOResetFunctionTrace", |
| 187 | "kCGLGOPageBreak", |
| 188 | "kCGLGOResetFunctionStatistics", |
| 189 | "kCGLGOEnableDebugAttach", |
| 190 | "kCGLGOHideObjects", |
| 191 | "kCGLGOEnableBreakpoint", |
| 192 | "kCGLGOForceSlowRenderingPath", |
| 193 | "kCGLGODisableImmediateRenderPath", |
| 194 | "kCGLGODisableCVARenderPath", |
| 195 | "kCGLGODisableVARRenderPath", |
| 196 | "kCGLGOForceWireframeRendering", |
| 197 | "kCGLGOSubmitOnImmediateRenderCommand", |
| 198 | "kCGLGOSubmitOnCVARenderCommand", |
| 199 | "kCGLGOSubmitOnVAORenderCommand", |
| 200 | "kCGLGOSubmitOnClearCommand", |
| 201 | "kCGLGOForceSoftwareTransformLighting", |
| 202 | "kCGLGOForceSoftwareTexgen", |
| 203 | "kCGLGOForceSoftwareTRUFORM_ATI", |
| 204 | "kCGLGOForceSoftwareVertexShaders", |
| 205 | "kCGLGODisableFragmentShaders_ATI", |
| 206 | "kCGLGODisableTexturing", |
| 207 | "kCGLGOOutlineTexture", |
| 208 | "kCGLGOOutlineTextureColor", |
| 209 | "kCGLGOForceSlowBitmapPath", |
| 210 | "kCGLGODisableBitmap", |
| 211 | "kCGLGOForceSlowReadPixelsPath", |
| 212 | "kCGLGODisableReadPixels", |
| 213 | "kCGLGOOutlineReadPixelsBuffer", |
| 214 | "kCGLGOOutlineReadPixelsBufferColor", |
| 215 | "kCGLGOForceSlowDrawPixelsPath", |
| 216 | "kCGLGODisableDrawPixels", |
| 217 | "kCGLGOOutlineDrawPixelsBuffer", |
| 218 | "kCGLGOOutlineDrawPixelsBufferColor", |
| 219 | "kCGLGOForceSlowCopyPixelsPath", |
| 220 | "kCGLGODisableCopyPixels", |
| 221 | "kCGLGOOutlineCopyPixelsBuffer", |
| 222 | "kCGLGOOutlineCopyPixelsBufferColor", |
| 223 | "kCGLGOMakeAllGLObjectsRequireUpdate", |
| 224 | "kCGLGOMakeAllGLStateRequireUpdate", |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 225 | ]) |
José Fonseca | 4364860 | 2011-05-15 12:56:59 +0100 | [diff] [blame] | 226 | |
| 227 | CGLError = Enum("CGLError", [ |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 228 | "kCGLNoError", |
| 229 | "kCGLBadAttribute", |
| 230 | "kCGLBadProperty", |
| 231 | "kCGLBadPixelFormat", |
| 232 | "kCGLBadRendererInfo", |
| 233 | "kCGLBadContext", |
| 234 | "kCGLBadDrawable", |
| 235 | "kCGLBadDisplay", |
| 236 | "kCGLBadState", |
| 237 | "kCGLBadValue", |
| 238 | "kCGLBadMatch", |
| 239 | "kCGLBadEnumeration", |
| 240 | "kCGLBadOffScreen", |
| 241 | "kCGLBadFullScreen", |
| 242 | "kCGLBadWindow", |
| 243 | "kCGLBadAddress", |
| 244 | "kCGLBadCodeModule", |
| 245 | "kCGLBadAlloc", |
| 246 | "kCGLBadConnection", |
José Fonseca | 4364860 | 2011-05-15 12:56:59 +0100 | [diff] [blame] | 247 | ]) |
| 248 | |
| 249 | CGLContextObj = Opaque("CGLContextObj") |
| 250 | |
José Fonseca | 8130193 | 2012-11-11 00:10:20 +0000 | [diff] [blame] | 251 | cglapi = Module("CGL") |
José Fonseca | 4364860 | 2011-05-15 12:56:59 +0100 | [diff] [blame] | 252 | |
José Fonseca | 54f304a | 2012-01-14 19:33:08 +0000 | [diff] [blame] | 253 | cglapi.addFunctions([ |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 254 | # CGLCurrent.h, libGL.dylib |
José Fonseca | 4364860 | 2011-05-15 12:56:59 +0100 | [diff] [blame] | 255 | Function(CGLError, "CGLSetCurrentContext", [(CGLContextObj, "ctx")]), |
| 256 | Function(CGLContextObj, "CGLGetCurrentContext", []), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 257 | |
| 258 | # OpenGL.h, OpenGL framework |
Andreas Hartmetz | 700323b | 2013-07-09 22:40:44 +0200 | [diff] [blame] | 259 | 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] | 260 | Function(CGLError, "CGLDestroyPixelFormat", [(CGLPixelFormatObj, "pix")]), |
José Fonseca | d32e52e | 2014-02-27 15:03:59 +0000 | [diff] [blame] | 261 | Function(CGLError, "CGLDescribePixelFormat", [(CGLPixelFormatObj, "pix"), (GLint, "pix_num"), (CGLPixelFormatAttribute, "attrib"), Out(Pointer(GLint), "value")], sideeffects=False), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 262 | Function(Void, "CGLReleasePixelFormat", [(CGLPixelFormatObj, "pix")]), |
| 263 | Function(CGLPixelFormatObj, "CGLRetainPixelFormat", [(CGLPixelFormatObj, "pix")]), |
| 264 | Function(GLuint, "CGLGetPixelFormatRetainCount", [(CGLPixelFormatObj, "pix")]), |
José Fonseca | 17a2f96 | 2011-10-05 20:49:39 +0100 | [diff] [blame] | 265 | 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] | 266 | Function(CGLError, "CGLDestroyRendererInfo", [(CGLRendererInfoObj, "rend")]), |
José Fonseca | d32e52e | 2014-02-27 15:03:59 +0000 | [diff] [blame] | 267 | Function(CGLError, "CGLDescribeRenderer", [(CGLRendererInfoObj, "rend"), (GLint, "rend_num"), (CGLRendererProperty, "prop"), Out(Pointer(GLint), "value")], sideeffects=False), |
José Fonseca | 8bf847a | 2011-09-27 18:46:23 +0100 | [diff] [blame] | 268 | Function(CGLError, "CGLCreateContext", [(CGLPixelFormatObj, "pix"), (CGLContextObj, "share"), Out(Pointer(CGLContextObj), "ctx")]), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 269 | Function(CGLError, "CGLDestroyContext", [(CGLContextObj, "ctx")]), |
| 270 | Function(CGLError, "CGLCopyContext", [(CGLContextObj, "src"), (CGLContextObj, "dst"), (GLbitfield, "mask")]), |
| 271 | Function(CGLContextObj, "CGLRetainContext", [(CGLContextObj, "ctx")]), |
| 272 | Function(Void, "CGLReleaseContext", [(CGLContextObj, "ctx")]), |
| 273 | Function(GLuint, "CGLGetContextRetainCount", [(CGLContextObj, "ctx")]), |
| 274 | Function(CGLPixelFormatObj, "CGLGetPixelFormat", [(CGLContextObj, "ctx")]), |
José Fonseca | 8bf847a | 2011-09-27 18:46:23 +0100 | [diff] [blame] | 275 | 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] | 276 | Function(CGLError, "CGLDestroyPBuffer", [(CGLPBufferObj, "pbuffer")]), |
José Fonseca | 8bf847a | 2011-09-27 18:46:23 +0100 | [diff] [blame] | 277 | 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] | 278 | Function(CGLError, "CGLTexImagePBuffer", [(CGLContextObj, "ctx"), (CGLPBufferObj, "pbuffer"), (GLenum, "source")]), |
| 279 | Function(CGLPBufferObj, "CGLRetainPBuffer", [(CGLPBufferObj, "pbuffer")]), |
| 280 | Function(Void, "CGLReleasePBuffer", [(CGLPBufferObj, "pbuffer")]), |
| 281 | Function(GLuint, "CGLGetPBufferRetainCount", [(CGLPBufferObj, "pbuffer")]), |
| 282 | 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] | 283 | 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] | 284 | Function(CGLError, "CGLSetFullScreen", [(CGLContextObj, "ctx")]), |
| 285 | Function(CGLError, "CGLSetFullScreenOnDisplay", [(CGLContextObj, "ctx"), (GLuint, "display_mask")]), |
| 286 | 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] | 287 | 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] | 288 | Function(CGLError, "CGLClearDrawable", [(CGLContextObj, "ctx")]), |
| 289 | Function(CGLError, "CGLFlushDrawable", [(CGLContextObj, "ctx")]), |
| 290 | Function(CGLError, "CGLEnable", [(CGLContextObj, "ctx"), (CGLContextEnable, "pname")]), |
| 291 | Function(CGLError, "CGLDisable", [(CGLContextObj, "ctx"), (CGLContextEnable, "pname")]), |
José Fonseca | 624b5ec | 2013-01-23 15:16:22 +0000 | [diff] [blame] | 292 | 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] | 293 | Function(CGLError, "CGLSetParameter", [(CGLContextObj, "ctx"), (CGLContextParameter, "pname"), (Array(Const(GLint), 1), "params")]), |
José Fonseca | 624b5ec | 2013-01-23 15:16:22 +0000 | [diff] [blame] | 294 | 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] | 295 | Function(CGLError, "CGLSetVirtualScreen", [(CGLContextObj, "ctx"), (GLint, "screen")]), |
José Fonseca | 624b5ec | 2013-01-23 15:16:22 +0000 | [diff] [blame] | 296 | Function(CGLError, "CGLGetVirtualScreen", [(CGLContextObj, "ctx"), Out(Pointer(GLint), "screen")], sideeffects=False), |
José Fonseca | 903c2ca | 2011-09-23 09:43:05 +0100 | [diff] [blame] | 297 | Function(CGLError, "CGLSetGlobalOption", [(CGLGlobalOption, "pname"), (OpaquePointer(Const(GLint)), "params")]), |
José Fonseca | d32e52e | 2014-02-27 15:03:59 +0000 | [diff] [blame] | 298 | Function(CGLError, "CGLGetGlobalOption", [(CGLGlobalOption, "pname"), Out(OpaquePointer(GLint), "params")], sideeffects=False), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 299 | Function(CGLError, "CGLSetOption", [(CGLGlobalOption, "pname"), (GLint, "param")]), |
José Fonseca | 624b5ec | 2013-01-23 15:16:22 +0000 | [diff] [blame] | 300 | Function(CGLError, "CGLGetOption", [(CGLGlobalOption, "pname"), Out(Pointer(GLint), "param")], sideeffects=False), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 301 | Function(CGLError, "CGLLockContext", [(CGLContextObj, "ctx")]), |
| 302 | Function(CGLError, "CGLUnlockContext", [(CGLContextObj, "ctx")]), |
José Fonseca | 624b5ec | 2013-01-23 15:16:22 +0000 | [diff] [blame] | 303 | Function(Void, "CGLGetVersion", [Out(Pointer(GLint), "majorvers"), Out(Pointer(GLint), "minorvers")], sideeffects=False), |
| 304 | Function(ConstCString, "CGLErrorString", [(CGLError, "error")], sideeffects=False), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 305 | |
| 306 | # CGLIOSurface.h, OpenGL framework |
| 307 | Function(CGLError, "CGLTexImageIOSurface2D", [(CGLContextObj, "ctx"), (GLenum, "target"), (GLenum, "internal_format"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), (IOSurfaceRef, "ioSurface"), (GLuint, "plane")]), |
| 308 | |
| 309 | # CGLDevice.h, OpenGL framework |
| 310 | Function(CGLShareGroupObj, "CGLGetShareGroup", [(CGLContextObj, "ctx")]), |
| 311 | |
| 312 | # Undocumented, OpenGL framework |
| 313 | Function(CGLError, "CGLSetSurface", [(CGLContextObj, "ctx"), (CGSConnectionID, "cid"), (CGSWindowID, "wid"), (CGSSurfaceID, "sid")]), |
José Fonseca | d32e52e | 2014-02-27 15:03:59 +0000 | [diff] [blame] | 314 | Function(CGLError, "CGLGetSurface", [(CGLContextObj, "ctx"), Out(Pointer(CGSConnectionID), "cid"), Out(Pointer(CGSWindowID), "wid"), Out(Pointer(CGSSurfaceID), "sid")]), |
José Fonseca | 3bcb33c | 2011-05-27 20:14:31 +0100 | [diff] [blame] | 315 | Function(CGLError, "CGLUpdateContext", [(CGLContextObj, "ctx")]), |
José Fonseca | e9ba177 | 2013-06-01 11:23:44 +0100 | [diff] [blame] | 316 | # XXX: All the following prototypes are little more than guesses |
| 317 | # TODO: A potentially simpler alternative would be to use the |
José Fonseca | fde03ad | 2013-06-01 18:11:02 +0100 | [diff] [blame] | 318 | # DYLD_INTERPOSE mechanism and only intercept the calls that we |
José Fonseca | e9ba177 | 2013-06-01 11:23:44 +0100 | [diff] [blame] | 319 | # really care about |
| 320 | Function(CGLError, "CGLOpenCLMuxLockDown", [], internal=True), |
| 321 | Function(GLboolean, "CGLAreContextsShared", [(CGLContextObj, "ctx1"), (CGLContextObj, "ctx2")], internal=True), |
| 322 | Function(CGLContextObj, "CGLGetNextContext", [(CGLContextObj, "ctx")], internal=True), |
| 323 | Function(OpaquePointer(Void), "CGLFrontDispatch", [(CGLContextObj, "ctx")], internal=True), |
| 324 | Function(OpaquePointer(Void), "CGLBackDispatch", [(CGLContextObj, "ctx")], internal=True), |
| 325 | Function(Void, "CGLSelectDispatch", [(CGLContextObj, "ctx"), (OpaquePointer(Void), "dispatch")], internal=True), |
| 326 | Function(Void, "CGLSelectDispatchBounded", [(CGLContextObj, "ctx"), (OpaquePointer(Void), "dispatch"), (GLint, "size")], internal=True), |
| 327 | Function(Void, "CGLSelectDispatchFunction", [(CGLContextObj, "ctx"), (OpaquePointer(Void), "functionPtr"), (GLint, "functionId")], internal=True), |
| 328 | Function(Void, "CGLRestoreDispatch", [(CGLContextObj, "ctx")], internal=True), |
| 329 | Function(Void, "CGLRestoreDispatchFunction", [(CGLContextObj, "ctx"), (GLint, "functionId")], internal=True), |
| 330 | Function(CGLError, "CGLSetPBufferVolatileState", [(CGLPBufferObj, "pbuffer"), (OpaquePointer(Void), "state")], internal=True), |
José Fonseca | 4364860 | 2011-05-15 12:56:59 +0100 | [diff] [blame] | 331 | ]) |
| 332 | |