• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "common/platform.h"
13 
14 #if defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
15 
16 #    include <OpenGL/OpenGL.h>
17 
18 #    include "common/apple/SoftLinking.h"
19 
20 SOFT_LINK_FRAMEWORK_HEADER(OpenGL)
21 
22 SOFT_LINK_FUNCTION_HEADER(OpenGL,
23                           CGLChoosePixelFormat,
24                           CGLError,
25                           (const CGLPixelFormatAttribute *attribs,
26                            CGLPixelFormatObj *pix,
27                            GLint *npix),
28                           (attribs, pix, npix))
29 SOFT_LINK_FUNCTION_HEADER(OpenGL,
30                           CGLCreateContext,
31                           CGLError,
32                           (CGLPixelFormatObj pix, CGLContextObj share, CGLContextObj *ctx),
33                           (pix, share, ctx))
34 SOFT_LINK_FUNCTION_HEADER(
35     OpenGL,
36     CGLDescribePixelFormat,
37     CGLError,
38     (CGLPixelFormatObj pix, GLint pix_num, CGLPixelFormatAttribute attrib, GLint *value),
39     (pix, pix_num, attrib, value))
40 SOFT_LINK_FUNCTION_HEADER(
41     OpenGL,
42     CGLDescribeRenderer,
43     CGLError,
44     (CGLRendererInfoObj rend, GLint rend_num, CGLRendererProperty prop, GLint *value),
45     (rend, rend_num, prop, value))
46 SOFT_LINK_FUNCTION_HEADER(OpenGL, CGLDestroyContext, CGLError, (CGLContextObj ctx), (ctx))
47 SOFT_LINK_FUNCTION_HEADER(OpenGL, CGLDestroyPixelFormat, CGLError, (CGLPixelFormatObj pix), (pix))
48 SOFT_LINK_FUNCTION_HEADER(OpenGL,
49                           CGLDestroyRendererInfo,
50                           CGLError,
51                           (CGLRendererInfoObj rend),
52                           (rend))
53 SOFT_LINK_FUNCTION_HEADER(OpenGL, CGLErrorString, const char *, (CGLError error), (error))
54 SOFT_LINK_FUNCTION_HEADER(OpenGL,
55                           CGLQueryRendererInfo,
56                           CGLError,
57                           (GLuint display_mask, CGLRendererInfoObj *rend, GLint *nrend),
58                           (display_mask, rend, nrend))
59 SOFT_LINK_FUNCTION_HEADER(OpenGL, CGLReleaseContext, void, (CGLContextObj ctx), (ctx))
60 SOFT_LINK_FUNCTION_HEADER(OpenGL, CGLGetCurrentContext, CGLContextObj, (void), ())
61 SOFT_LINK_FUNCTION_HEADER(OpenGL, CGLSetCurrentContext, CGLError, (CGLContextObj ctx), (ctx))
62 SOFT_LINK_FUNCTION_HEADER(OpenGL,
63                           CGLSetVirtualScreen,
64                           CGLError,
65                           (CGLContextObj ctx, GLint screen),
66                           (ctx, screen))
67 SOFT_LINK_FUNCTION_HEADER(
68     OpenGL,
69     CGLTexImageIOSurface2D,
70     CGLError,
71     (CGLContextObj ctx,
72      GLenum target,
73      GLenum internal_format,
74      GLsizei width,
75      GLsizei height,
76      GLenum format,
77      GLenum type,
78      IOSurfaceRef ioSurface,
79      GLuint plane),
80     (ctx, target, internal_format, width, height, format, type, ioSurface, plane))
81 SOFT_LINK_FUNCTION_HEADER(OpenGL, CGLUpdateContext, CGLError, (CGLContextObj ctx), (ctx))
82 
83 #endif  // defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)
84 
85 #endif  // CGL_FUNCTIONS_H_
86