Mathias Agopian | 1cadb25 | 2011-05-23 17:26:14 -0700 | [diff] [blame] | 1 | /* |
| 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 Agopian | 39c24a2 | 2013-04-04 23:17:56 -0700 | [diff] [blame] | 20 | #include "../hooks.h" |
Mathias Agopian | 1cadb25 | 2011-05-23 17:26:14 -0700 | [diff] [blame] | 21 | |
Mathias Agopian | 7773c43 | 2012-02-13 20:06:08 -0800 | [diff] [blame] | 22 | #define VERSION_MAJOR 1 |
| 23 | #define VERSION_MINOR 4 |
| 24 | |
Mathias Agopian | 1cadb25 | 2011-05-23 17:26:14 -0700 | [diff] [blame] | 25 | // ---------------------------------------------------------------------------- |
| 26 | namespace android { |
| 27 | // ---------------------------------------------------------------------------- |
| 28 | |
Mathias Agopian | 1cadb25 | 2011-05-23 17:26:14 -0700 | [diff] [blame] | 29 | // EGLDisplay are global, not attached to a given thread |
| 30 | const unsigned int NUM_DISPLAYS = 1; |
| 31 | |
Mathias Agopian | 1cadb25 | 2011-05-23 17:26:14 -0700 | [diff] [blame] | 32 | // ---------------------------------------------------------------------------- |
| 33 | |
Mathias Agopian | 7773c43 | 2012-02-13 20:06:08 -0800 | [diff] [blame] | 34 | struct egl_connection_t { |
| 35 | enum { |
| 36 | GLESv1_INDEX = 0, |
| 37 | GLESv2_INDEX = 1 |
| 38 | }; |
| 39 | |
Mathias Agopian | 1cadb25 | 2011-05-23 17:26:14 -0700 | [diff] [blame] | 40 | inline egl_connection_t() : dso(0) { } |
| 41 | void * dso; |
| 42 | gl_hooks_t * hooks[2]; |
| 43 | EGLint major; |
| 44 | EGLint minor; |
| 45 | egl_t egl; |
Jesse Hall | c07b520 | 2013-07-04 12:08:16 -0700 | [diff] [blame] | 46 | |
Michael Chock | c0ec5e2 | 2014-01-27 08:14:33 -0800 | [diff] [blame] | 47 | void* libEgl; |
Jesse Hall | c07b520 | 2013-07-04 12:08:16 -0700 | [diff] [blame] | 48 | void* libGles1; |
| 49 | void* libGles2; |
Mathias Agopian | 1cadb25 | 2011-05-23 17:26:14 -0700 | [diff] [blame] | 50 | }; |
| 51 | |
| 52 | // ---------------------------------------------------------------------------- |
| 53 | |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 54 | extern gl_hooks_t gHooks[2]; |
Mathias Agopian | 1cadb25 | 2011-05-23 17:26:14 -0700 | [diff] [blame] | 55 | extern gl_hooks_t gHooksNoContext; |
| 56 | extern pthread_key_t gGLWrapperKey; |
| 57 | extern "C" void gl_unimplemented(); |
Mathias Agopian | 48d438d | 2012-01-28 21:44:00 -0800 | [diff] [blame] | 58 | extern "C" void gl_noop(); |
Mathias Agopian | 1cadb25 | 2011-05-23 17:26:14 -0700 | [diff] [blame] | 59 | |
| 60 | extern char const * const gl_names[]; |
| 61 | extern char const * const egl_names[]; |
| 62 | |
Mathias Agopian | ada798b | 2012-02-13 17:09:30 -0800 | [diff] [blame] | 63 | extern egl_connection_t gEGLImpl; |
Mathias Agopian | 1cadb25 | 2011-05-23 17:26:14 -0700 | [diff] [blame] | 64 | |
| 65 | // ---------------------------------------------------------------------------- |
| 66 | }; // namespace android |
| 67 | // ---------------------------------------------------------------------------- |
| 68 | |
| 69 | #endif /* ANDROID_EGLDEFS_H */ |