Panda3D
pandagles.cxx
1 // Filename: pandagles.cxx
2 // Created by: rdb (8Jun09)
3 //
4 ////////////////////////////////////////////////////////////////////
5 
6 #include "pandagles.h"
7 
8 #define OPENGLES_1
9 #include "config_glesgsg.h"
10 
11 #if defined(ANDROID)
12 #include "config_androiddisplay.h"
13 #include "androidGraphicsPipe.h"
14 #elif defined(HAVE_EGL)
15 #include "config_egldisplay.h"
16 #include "eglGraphicsPipe.h"
17 #endif
18 
19 // By including checkPandaVersion.h, we guarantee that runtime
20 // attempts to load libpandagles.so/.dll will fail if they inadvertently
21 // link with the wrong version of libdtool.so/.dll.
22 
23 #include "checkPandaVersion.h"
24 
25 ////////////////////////////////////////////////////////////////////
26 // Function: init_libpandagles
27 // Description: Initializes the library. This must be called at
28 // least once before any of the functions or classes in
29 // this library can be used. Normally it will be
30 // called by the static initializers and need not be
31 // called explicitly, but special cases exist.
32 ////////////////////////////////////////////////////////////////////
33 void
34 init_libpandagles() {
35  init_libglesgsg();
36 
37 #if defined(ANDROID)
38  init_libandroiddisplay();
39 #elif defined(HAVE_EGL)
40  init_libegldisplay();
41 #endif
42 }
43 
44 ////////////////////////////////////////////////////////////////////
45 // Function: get_pipe_type_pandagles
46 // Description: Returns the TypeHandle index of the recommended
47 // graphics pipe type defined by this module.
48 ////////////////////////////////////////////////////////////////////
49 int
50 get_pipe_type_pandagles() {
51 #if defined(ANDROID)
52  return AndroidGraphicsPipe::get_class_type().get_index();
53 #elif defined(HAVE_EGL)
54  return eglGraphicsPipe::get_class_type().get_index();
55 #endif
56 
57  return 0;
58 }
int get_index() const
Returns the integer index associated with this TypeHandle.
Definition: typeHandle.I:253