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