egldefs.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. #ifndef ANDROID_EGLDEFS_H
  17. #define ANDROID_EGLDEFS_H
  18. #include "../hooks.h"
  19. #define VERSION_MAJOR 1
  20. #define VERSION_MINOR 4
  21. // ----------------------------------------------------------------------------
  22. namespace android {
  23. // ----------------------------------------------------------------------------
  24. // EGLDisplay are global, not attached to a given thread
  25. const unsigned int NUM_DISPLAYS = 1;
  26. // ----------------------------------------------------------------------------
  27. struct egl_connection_t {
  28. enum {
  29. GLESv1_INDEX = 0,
  30. GLESv2_INDEX = 1
  31. };
  32. inline egl_connection_t() : dso(0) { }
  33. void * dso;
  34. gl_hooks_t * hooks[2];
  35. EGLint major;
  36. EGLint minor;
  37. egl_t egl;
  38. void* libEgl;
  39. void* libGles1;
  40. void* libGles2;
  41. };
  42. // ----------------------------------------------------------------------------
  43. extern gl_hooks_t gHooks[2];
  44. extern gl_hooks_t gHooksNoContext;
  45. extern pthread_key_t gGLWrapperKey;
  46. extern "C" void gl_unimplemented();
  47. extern "C" void gl_noop();
  48. extern char const * const gl_names[];
  49. extern char const * const egl_names[];
  50. extern egl_connection_t gEGLImpl;
  51. // ----------------------------------------------------------------------------
  52. }; // namespace android
  53. // ----------------------------------------------------------------------------
  54. #endif /* ANDROID_EGLDEFS_H */