xref: /aosp_15_r20/external/angle/src/common/gl/cgl/FunctionsCGL.cpp (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
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 SOFT_LINK_FRAMEWORK_SOURCE(OpenGL)
13 
14 SOFT_LINK_FUNCTION_SOURCE(OpenGL,
15                           CGLChoosePixelFormat,
16                           CGLError,
17                           (const CGLPixelFormatAttribute *attribs,
18                            CGLPixelFormatObj *pix,
19                            GLint *npix),
20                           (attribs, pix, npix))
21 SOFT_LINK_FUNCTION_SOURCE(OpenGL,
22                           CGLCreateContext,
23                           CGLError,
24                           (CGLPixelFormatObj pix, CGLContextObj share, CGLContextObj *ctx),
25                           (pix, share, ctx))
26 SOFT_LINK_FUNCTION_SOURCE(
27     OpenGL,
28     CGLDescribePixelFormat,
29     CGLError,
30     (CGLPixelFormatObj pix, GLint pix_num, CGLPixelFormatAttribute attrib, GLint *value),
31     (pix, pix_num, attrib, value))
32 SOFT_LINK_FUNCTION_SOURCE(OpenGL, CGLDestroyContext, CGLError, (CGLContextObj ctx), (ctx))
33 SOFT_LINK_FUNCTION_SOURCE(OpenGL, CGLDestroyPixelFormat, CGLError, (CGLPixelFormatObj pix), (pix))
34 SOFT_LINK_FUNCTION_SOURCE(OpenGL, CGLErrorString, const char *, (CGLError error), (error))
35 SOFT_LINK_FUNCTION_SOURCE(OpenGL, CGLReleaseContext, void, (CGLContextObj ctx), (ctx))
36 SOFT_LINK_FUNCTION_SOURCE(OpenGL, CGLGetCurrentContext, CGLContextObj, (void), ())
37 SOFT_LINK_FUNCTION_SOURCE(OpenGL, CGLSetCurrentContext, CGLError, (CGLContextObj ctx), (ctx))
38 SOFT_LINK_FUNCTION_SOURCE(OpenGL,
39                           CGLSetVirtualScreen,
40                           CGLError,
41                           (CGLContextObj ctx, GLint screen),
42                           (ctx, screen))
43 SOFT_LINK_FUNCTION_SOURCE(
44     OpenGL,
45     CGLTexImageIOSurface2D,
46     CGLError,
47     (CGLContextObj ctx,
48      GLenum target,
49      GLenum internal_format,
50      GLsizei width,
51      GLsizei height,
52      GLenum format,
53      GLenum type,
54      IOSurfaceRef ioSurface,
55      GLuint plane),
56     (ctx, target, internal_format, width, height, format, type, ioSurface, plane))
57 SOFT_LINK_FUNCTION_SOURCE(OpenGL, CGLUpdateContext, CGLError, (CGLContextObj ctx), (ctx))
58 
59 SOFT_LINK_FUNCTION_SOURCE(
60     OpenGL,
61     CGLDescribeRenderer,
62     CGLError,
63     (CGLRendererInfoObj rend, GLint rend_num, CGLRendererProperty prop, GLint *value),
64     (rend, rend_num, prop, value))
65 SOFT_LINK_FUNCTION_SOURCE(OpenGL,
66                           CGLDestroyRendererInfo,
67                           CGLError,
68                           (CGLRendererInfoObj rend),
69                           (rend))
70 SOFT_LINK_FUNCTION_SOURCE(OpenGL,
71                           CGLQueryRendererInfo,
72                           CGLError,
73                           (GLuint display_mask, CGLRendererInfoObj *rend, GLint *nrend),
74                           (display_mask, rend, nrend))
75