xref: /aosp_15_r20/external/mesa3d/src/glx/apple/apple_cgl.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1*61046927SAndroid Build Coastguard Worker /*
2*61046927SAndroid Build Coastguard Worker  Copyright (c) 2008, 2009 Apple Inc.
3*61046927SAndroid Build Coastguard Worker 
4*61046927SAndroid Build Coastguard Worker  Permission is hereby granted, free of charge, to any person
5*61046927SAndroid Build Coastguard Worker  obtaining a copy of this software and associated documentation files
6*61046927SAndroid Build Coastguard Worker  (the "Software"), to deal in the Software without restriction,
7*61046927SAndroid Build Coastguard Worker  including without limitation the rights to use, copy, modify, merge,
8*61046927SAndroid Build Coastguard Worker  publish, distribute, sublicense, and/or sell copies of the Software,
9*61046927SAndroid Build Coastguard Worker  and to permit persons to whom the Software is furnished to do so,
10*61046927SAndroid Build Coastguard Worker  subject to the following conditions:
11*61046927SAndroid Build Coastguard Worker 
12*61046927SAndroid Build Coastguard Worker  The above copyright notice and this permission notice shall be
13*61046927SAndroid Build Coastguard Worker  included in all copies or substantial portions of the Software.
14*61046927SAndroid Build Coastguard Worker 
15*61046927SAndroid Build Coastguard Worker  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16*61046927SAndroid Build Coastguard Worker  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17*61046927SAndroid Build Coastguard Worker  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18*61046927SAndroid Build Coastguard Worker  NONINFRINGEMENT.  IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
19*61046927SAndroid Build Coastguard Worker  HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20*61046927SAndroid Build Coastguard Worker  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21*61046927SAndroid Build Coastguard Worker  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22*61046927SAndroid Build Coastguard Worker  DEALINGS IN THE SOFTWARE.
23*61046927SAndroid Build Coastguard Worker 
24*61046927SAndroid Build Coastguard Worker  Except as contained in this notice, the name(s) of the above
25*61046927SAndroid Build Coastguard Worker  copyright holders shall not be used in advertising or otherwise to
26*61046927SAndroid Build Coastguard Worker  promote the sale, use or other dealings in this Software without
27*61046927SAndroid Build Coastguard Worker  prior written authorization.
28*61046927SAndroid Build Coastguard Worker */
29*61046927SAndroid Build Coastguard Worker 
30*61046927SAndroid Build Coastguard Worker #ifndef APPLE_CGL_H
31*61046927SAndroid Build Coastguard Worker #define APPLE_CGL_H
32*61046927SAndroid Build Coastguard Worker 
33*61046927SAndroid Build Coastguard Worker #include <stdio.h>
34*61046927SAndroid Build Coastguard Worker #include <OpenGL/CGLCurrent.h>
35*61046927SAndroid Build Coastguard Worker #include <OpenGL/CGLTypes.h>
36*61046927SAndroid Build Coastguard Worker #include <OpenGL/OpenGL.h>
37*61046927SAndroid Build Coastguard Worker 
38*61046927SAndroid Build Coastguard Worker /* For GLint and GLsizei on Tiger */
39*61046927SAndroid Build Coastguard Worker #include <OpenGL/gl.h>
40*61046927SAndroid Build Coastguard Worker 
41*61046927SAndroid Build Coastguard Worker struct apple_cgl_api
42*61046927SAndroid Build Coastguard Worker {
43*61046927SAndroid Build Coastguard Worker      GLint version_major, version_minor;
44*61046927SAndroid Build Coastguard Worker      void (*get_version) (GLint * version_major, GLint * version_minor);
45*61046927SAndroid Build Coastguard Worker 
46*61046927SAndroid Build Coastguard Worker      CGLError(*choose_pixel_format) (const CGLPixelFormatAttribute * attribs,
47*61046927SAndroid Build Coastguard Worker                                      CGLPixelFormatObj * pix, GLint * npix);
48*61046927SAndroid Build Coastguard Worker      CGLError(*destroy_pixel_format) (CGLPixelFormatObj pix);
49*61046927SAndroid Build Coastguard Worker 
50*61046927SAndroid Build Coastguard Worker      CGLError(*clear_drawable) (CGLContextObj ctx);
51*61046927SAndroid Build Coastguard Worker      CGLError(*flush_drawable) (CGLContextObj ctx);
52*61046927SAndroid Build Coastguard Worker 
53*61046927SAndroid Build Coastguard Worker      CGLError(*create_context) (CGLPixelFormatObj pix, CGLContextObj share,
54*61046927SAndroid Build Coastguard Worker                                 CGLContextObj * ctx);
55*61046927SAndroid Build Coastguard Worker      CGLError(*destroy_context) (CGLContextObj pix);
56*61046927SAndroid Build Coastguard Worker 
57*61046927SAndroid Build Coastguard Worker      CGLError(*set_current_context) (CGLContextObj ctx);
58*61046927SAndroid Build Coastguard Worker      CGLContextObj(*get_current_context) (void);
59*61046927SAndroid Build Coastguard Worker    const char *(*error_string) (CGLError error);
60*61046927SAndroid Build Coastguard Worker 
61*61046927SAndroid Build Coastguard Worker      CGLError(*set_off_screen) (CGLContextObj ctx,
62*61046927SAndroid Build Coastguard Worker                                 GLsizei width, GLsizei height, GLint rowbytes,
63*61046927SAndroid Build Coastguard Worker                                 void *baseaddr);
64*61046927SAndroid Build Coastguard Worker 
65*61046927SAndroid Build Coastguard Worker      CGLError(*copy_context) (CGLContextObj src, CGLContextObj dst,
66*61046927SAndroid Build Coastguard Worker                               GLbitfield mask);
67*61046927SAndroid Build Coastguard Worker 
68*61046927SAndroid Build Coastguard Worker      CGLError(*create_pbuffer) (GLsizei width,
69*61046927SAndroid Build Coastguard Worker                                 GLsizei height,
70*61046927SAndroid Build Coastguard Worker                                 GLenum target,
71*61046927SAndroid Build Coastguard Worker                                 GLenum internalFormat,
72*61046927SAndroid Build Coastguard Worker                                 GLint max_level, CGLPBufferObj * pbuffer);
73*61046927SAndroid Build Coastguard Worker 
74*61046927SAndroid Build Coastguard Worker      CGLError(*destroy_pbuffer) (CGLPBufferObj pbuffer);
75*61046927SAndroid Build Coastguard Worker 
76*61046927SAndroid Build Coastguard Worker      CGLError(*set_pbuffer) (CGLContextObj ctx,
77*61046927SAndroid Build Coastguard Worker                              CGLPBufferObj pbuffer,
78*61046927SAndroid Build Coastguard Worker                              GLenum face, GLint level, GLint screen);
79*61046927SAndroid Build Coastguard Worker };
80*61046927SAndroid Build Coastguard Worker 
81*61046927SAndroid Build Coastguard Worker extern struct apple_cgl_api apple_cgl;
82*61046927SAndroid Build Coastguard Worker 
83*61046927SAndroid Build Coastguard Worker extern void apple_cgl_init(void);
84*61046927SAndroid Build Coastguard Worker 
85*61046927SAndroid Build Coastguard Worker extern void *apple_cgl_get_dl_handle(void);
86*61046927SAndroid Build Coastguard Worker 
87*61046927SAndroid Build Coastguard Worker #endif
88