egldefs.h revision 1cadb25da1ed875bdd078270e642966724a0c39a
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 20#include "hooks.h" 21 22// ---------------------------------------------------------------------------- 23namespace android { 24// ---------------------------------------------------------------------------- 25 26#define VERSION_MAJOR 1 27#define VERSION_MINOR 4 28 29// EGLDisplay are global, not attached to a given thread 30const unsigned int NUM_DISPLAYS = 1; 31 32enum { 33 IMPL_HARDWARE = 0, 34 IMPL_SOFTWARE, 35 IMPL_NUM_IMPLEMENTATIONS 36}; 37 38enum { 39 GLESv1_INDEX = 0, 40 GLESv2_INDEX = 1, 41}; 42 43// ---------------------------------------------------------------------------- 44 45struct egl_connection_t 46{ 47 inline egl_connection_t() : dso(0) { } 48 void * dso; 49 gl_hooks_t * hooks[2]; 50 EGLint major; 51 EGLint minor; 52 egl_t egl; 53}; 54 55// ---------------------------------------------------------------------------- 56 57extern gl_hooks_t gHooks[2][IMPL_NUM_IMPLEMENTATIONS]; 58extern gl_hooks_t gHooksNoContext; 59extern pthread_key_t gGLWrapperKey; 60extern "C" void gl_unimplemented(); 61 62extern char const * const gl_names[]; 63extern char const * const egl_names[]; 64 65extern egl_connection_t gEGLImpl[IMPL_NUM_IMPLEMENTATIONS]; 66 67// ---------------------------------------------------------------------------- 68}; // namespace android 69// ---------------------------------------------------------------------------- 70 71#endif /* ANDROID_EGLDEFS_H */ 72