1 // 2 // Copyright 2020 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 7 // FunctionsCGL.cpp: Exposing the soft-linked CGL interface. 8 9 #include "common/gl/cgl/FunctionsCGL.h" 10 #include "common/platform.h" 11 12 #if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST) 13 14 SOFT_LINK_FRAMEWORK_SOURCE(OpenGL) 15 16 SOFT_LINK_FUNCTION_SOURCE(OpenGL, 17 CGLChoosePixelFormat, 18 CGLError, 19 (const CGLPixelFormatAttribute *attribs, 20 CGLPixelFormatObj *pix, 21 GLint *npix), 22 (attribs, pix, npix)) 23 SOFT_LINK_FUNCTION_SOURCE(OpenGL, 24 CGLCreateContext, 25 CGLError, 26 (CGLPixelFormatObj pix, CGLContextObj share, CGLContextObj *ctx), 27 (pix, share, ctx)) 28 SOFT_LINK_FUNCTION_SOURCE( 29 OpenGL, 30 CGLDescribePixelFormat, 31 CGLError, 32 (CGLPixelFormatObj pix, GLint pix_num, CGLPixelFormatAttribute attrib, GLint *value), 33 (pix, pix_num, attrib, value)) 34 SOFT_LINK_FUNCTION_SOURCE(OpenGL, CGLDestroyContext, CGLError, (CGLContextObj ctx), (ctx)) 35 SOFT_LINK_FUNCTION_SOURCE(OpenGL, CGLDestroyPixelFormat, CGLError, (CGLPixelFormatObj pix), (pix)) 36 SOFT_LINK_FUNCTION_SOURCE(OpenGL, CGLErrorString, const char *, (CGLError error), (error)) 37 SOFT_LINK_FUNCTION_SOURCE(OpenGL, CGLReleaseContext, void, (CGLContextObj ctx), (ctx)) 38 SOFT_LINK_FUNCTION_SOURCE(OpenGL, CGLGetCurrentContext, CGLContextObj, (void), ()) 39 SOFT_LINK_FUNCTION_SOURCE(OpenGL, CGLSetCurrentContext, CGLError, (CGLContextObj ctx), (ctx)) 40 SOFT_LINK_FUNCTION_SOURCE(OpenGL, 41 CGLSetVirtualScreen, 42 CGLError, 43 (CGLContextObj ctx, GLint screen), 44 (ctx, screen)) 45 SOFT_LINK_FUNCTION_SOURCE( 46 OpenGL, 47 CGLTexImageIOSurface2D, 48 CGLError, 49 (CGLContextObj ctx, 50 GLenum target, 51 GLenum internal_format, 52 GLsizei width, 53 GLsizei height, 54 GLenum format, 55 GLenum type, 56 IOSurfaceRef ioSurface, 57 GLuint plane), 58 (ctx, target, internal_format, width, height, format, type, ioSurface, plane)) 59 SOFT_LINK_FUNCTION_SOURCE(OpenGL, CGLUpdateContext, CGLError, (CGLContextObj ctx), (ctx)) 60 61 SOFT_LINK_FUNCTION_SOURCE( 62 OpenGL, 63 CGLDescribeRenderer, 64 CGLError, 65 (CGLRendererInfoObj rend, GLint rend_num, CGLRendererProperty prop, GLint *value), 66 (rend, rend_num, prop, value)) 67 SOFT_LINK_FUNCTION_SOURCE(OpenGL, 68 CGLDestroyRendererInfo, 69 CGLError, 70 (CGLRendererInfoObj rend), 71 (rend)) 72 SOFT_LINK_FUNCTION_SOURCE(OpenGL, 73 CGLQueryRendererInfo, 74 CGLError, 75 (GLuint display_mask, CGLRendererInfoObj *rend, GLint *nrend), 76 (display_mask, rend, nrend)) 77 78 #endif // defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST) 79