blob: d8606d3e87e9fd2291377f29a93b58b72769cf14 [file] [log] [blame]
Mathias Agopian1cadb252011-05-23 17:26:14 -07001/*
2 ** Copyright 2011, The Android Open Source Project
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16
17#ifndef ANDROID_EGLDEFS_H
18#define ANDROID_EGLDEFS_H
19
Mathias Agopian39c24a22013-04-04 23:17:56 -070020#include "../hooks.h"
Mathias Agopian1cadb252011-05-23 17:26:14 -070021
Mathias Agopian7773c432012-02-13 20:06:08 -080022#define VERSION_MAJOR 1
23#define VERSION_MINOR 4
24
Mathias Agopian1cadb252011-05-23 17:26:14 -070025// ----------------------------------------------------------------------------
26namespace android {
27// ----------------------------------------------------------------------------
28
Mathias Agopian1cadb252011-05-23 17:26:14 -070029// EGLDisplay are global, not attached to a given thread
30const unsigned int NUM_DISPLAYS = 1;
31
Mathias Agopian1cadb252011-05-23 17:26:14 -070032// ----------------------------------------------------------------------------
33
Mathias Agopian7773c432012-02-13 20:06:08 -080034struct egl_connection_t {
35 enum {
36 GLESv1_INDEX = 0,
37 GLESv2_INDEX = 1
38 };
39
Yi Kong48a6cd22018-07-18 10:07:09 -070040 inline egl_connection_t() : dso(nullptr) { }
Cody Northrop68d10352018-10-15 07:22:09 -060041
Mathias Agopian1cadb252011-05-23 17:26:14 -070042 void * dso;
43 gl_hooks_t * hooks[2];
44 EGLint major;
45 EGLint minor;
46 egl_t egl;
Jesse Hallc07b5202013-07-04 12:08:16 -070047
Cody Northrop68d10352018-10-15 07:22:09 -060048 // Functions implemented or redirected by platform libraries
49 platform_impl_t platform;
50
Michael Chockc0ec5e22014-01-27 08:14:33 -080051 void* libEgl;
Jesse Hallc07b5202013-07-04 12:08:16 -070052 void* libGles1;
53 void* libGles2;
Cody Northrop1f00e172018-04-02 11:23:31 -060054
55 bool useAngle;
Courtney Goeltzenleuchter555f1df2018-09-25 14:34:29 -060056 EGLint angleBackend;
Cody Northrop1f00e172018-04-02 11:23:31 -060057 void* vendorEGL;
Mathias Agopian1cadb252011-05-23 17:26:14 -070058};
59
60// ----------------------------------------------------------------------------
61
Mathias Agopianada798b2012-02-13 17:09:30 -080062extern gl_hooks_t gHooks[2];
Mathias Agopian1cadb252011-05-23 17:26:14 -070063extern gl_hooks_t gHooksNoContext;
64extern pthread_key_t gGLWrapperKey;
65extern "C" void gl_unimplemented();
Mathias Agopian48d438d2012-01-28 21:44:00 -080066extern "C" void gl_noop();
Mathias Agopian1cadb252011-05-23 17:26:14 -070067
68extern char const * const gl_names[];
Yiwei Zhang7cc58922018-10-10 11:37:43 -070069extern char const * const gl_names_1[];
Mathias Agopian1cadb252011-05-23 17:26:14 -070070extern char const * const egl_names[];
Cody Northrop68d10352018-10-15 07:22:09 -060071extern char const * const platform_names[];
Mathias Agopian1cadb252011-05-23 17:26:14 -070072
Mathias Agopianada798b2012-02-13 17:09:30 -080073extern egl_connection_t gEGLImpl;
Mathias Agopian1cadb252011-05-23 17:26:14 -070074
75// ----------------------------------------------------------------------------
76}; // namespace android
77// ----------------------------------------------------------------------------
78
79#endif /* ANDROID_EGLDEFS_H */