Panda3D
 All Classes Functions Variables Enumerations
config_mesadisplay.cxx
00001 // Filename: config_mesadisplay.cxx
00002 // Created by:  drose (09Feb04)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #include "config_mesadisplay.h"
00016 #include "osMesaGraphicsBuffer.h"
00017 #include "osMesaGraphicsPipe.h"
00018 #include "osMesaGraphicsStateGuardian.h"
00019 #include "graphicsPipeSelection.h"
00020 #include "dconfig.h"
00021 #include "mesagsg.h"
00022 
00023 ConfigureDef(config_mesadisplay);
00024 NotifyCategoryDef(mesadisplay, "display");
00025 
00026 ConfigureFn(config_mesadisplay) {
00027   init_libmesadisplay();
00028 }
00029 
00030 ////////////////////////////////////////////////////////////////////
00031 //     Function: init_libmesadisplay
00032 //  Description: Initializes the library.  This must be called at
00033 //               least once before any of the functions or classes in
00034 //               this library can be used.  Normally it will be
00035 //               called by the static initializers and need not be
00036 //               called explicitly, but special cases exist.
00037 ////////////////////////////////////////////////////////////////////
00038 void
00039 init_libmesadisplay() {
00040   static bool initialized = false;
00041   if (initialized) {
00042     return;
00043   }
00044   initialized = true;
00045 
00046   OsMesaGraphicsBuffer::init_type();
00047   OsMesaGraphicsPipe::init_type();
00048   OSMesaGraphicsStateGuardian::init_type();
00049 
00050   GraphicsPipeSelection *selection = GraphicsPipeSelection::get_global_ptr();
00051   selection->add_pipe_type(OsMesaGraphicsPipe::get_class_type(),
00052                            OsMesaGraphicsPipe::pipe_constructor);
00053 
00054   Mesainit_classes();
00055 }
00056 
00057 ////////////////////////////////////////////////////////////////////
00058 //     Function: get_pipe_type_mesadisplay
00059 //  Description: Returns the TypeHandle index of the recommended
00060 //               graphics pipe type defined by this module.
00061 ////////////////////////////////////////////////////////////////////
00062 int
00063 get_pipe_type_mesadisplay() {
00064   return OsMesaGraphicsPipe::get_class_type().get_index();
00065 }
 All Classes Functions Variables Enumerations