pandagles2.cxx 998 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /**
  2. * @file pandagles2.cxx
  3. * @author rdb
  4. * @date 2009-06-08
  5. */
  6. #include "pandagles2.h"
  7. #define OPENGLES_2
  8. #include "config_gles2gsg.h"
  9. #if defined(ANDROID)
  10. #include "config_androiddisplay.h"
  11. #include "androidGraphicsPipe.h"
  12. #else
  13. #include "config_egldisplay.h"
  14. #include "eglGraphicsPipe.h"
  15. #endif
  16. /**
  17. * Initializes the library. This must be called at least once before any of
  18. * the functions or classes in this library can be used. Normally it will be
  19. * called by the static initializers and need not be called explicitly, but
  20. * special cases exist.
  21. */
  22. void
  23. init_libpandagles2() {
  24. init_libgles2gsg();
  25. #if defined(ANDROID)
  26. init_libandroiddisplay();
  27. #else
  28. init_libegldisplay();
  29. #endif
  30. }
  31. /**
  32. * Returns the TypeHandle index of the recommended graphics pipe type defined
  33. * by this module.
  34. */
  35. int
  36. get_pipe_type_pandagles2() {
  37. #if defined(ANDROID)
  38. return AndroidGraphicsPipe::get_class_type().get_index();
  39. #else
  40. return eglGraphicsPipe::get_class_type().get_index();
  41. #endif
  42. }