Panda3D
 All Classes Functions Variables Enumerations
pandagl.cxx
00001 // Filename: pandagl.cxx
00002 // Created by:  drose (15May00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 
00006 #include "pandagl.h"
00007 
00008 #include "config_glgsg.h"
00009 
00010 #ifdef HAVE_WGL
00011 #include "config_wgldisplay.h"
00012 #include "wglGraphicsPipe.h"
00013 #endif
00014 
00015 #ifdef IS_OSX
00016 #include "config_osxdisplay.h"
00017 #include "osxGraphicsPipe.h"
00018 #endif
00019 
00020 #ifdef HAVE_GLX
00021 #include "config_glxdisplay.h"
00022 #include "glxGraphicsPipe.h"
00023 #endif
00024 
00025 #if !defined(HAVE_WGL) && !defined(IS_OSX) && !defined(HAVE_GLX)
00026 #error One of HAVE_WGL, IS_OSX or HAVE_GLX must be defined when compiling pandagl!
00027 #endif
00028 
00029 // By including checkPandaVersion.h, we guarantee that runtime
00030 // attempts to load libpandagl.so/.dll will fail if they inadvertently
00031 // link with the wrong version of libdtool.so/.dll.
00032 
00033 #include "checkPandaVersion.h"
00034 
00035 ////////////////////////////////////////////////////////////////////
00036 //     Function: init_libpandagl
00037 //  Description: Initializes the library.  This must be called at
00038 //               least once before any of the functions or classes in
00039 //               this library can be used.  Normally it will be
00040 //               called by the static initializers and need not be
00041 //               called explicitly, but special cases exist.
00042 ////////////////////////////////////////////////////////////////////
00043 void
00044 init_libpandagl() {
00045   init_libglgsg();
00046 
00047 #ifdef HAVE_WGL
00048   init_libwgldisplay();
00049 #endif  // HAVE_GL
00050 
00051 #ifdef IS_OSX
00052   init_libosxdisplay();
00053 #endif
00054 
00055 #ifdef IS_LINUX
00056   init_libglxdisplay();
00057 #endif
00058 }
00059 
00060 ////////////////////////////////////////////////////////////////////
00061 //     Function: get_pipe_type_pandagl
00062 //  Description: Returns the TypeHandle index of the recommended
00063 //               graphics pipe type defined by this module.
00064 ////////////////////////////////////////////////////////////////////
00065 int
00066 get_pipe_type_pandagl() {
00067 #ifdef HAVE_WGL
00068   return wglGraphicsPipe::get_class_type().get_index();
00069 #endif
00070 
00071 #ifdef IS_OSX
00072   return osxGraphicsPipe::get_class_type().get_index();
00073 #endif
00074 
00075 #ifdef HAVE_GLX
00076   return glxGraphicsPipe::get_class_type().get_index();
00077 #endif
00078 
00079   return 0;
00080 }
 All Classes Functions Variables Enumerations