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