Panda3D
 All Classes Functions Variables Enumerations
config_cull.cxx
00001 // Filename: config_cull.cxx
00002 // Created by:  drose (23Mar06)
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_cull.h"
00016 
00017 #include "cullBinBackToFront.h"
00018 #include "cullBinFixed.h"
00019 #include "cullBinFrontToBack.h"
00020 #include "cullBinStateSorted.h"
00021 #include "cullBinUnsorted.h"
00022 
00023 #include "cullBinManager.h"
00024 #include "dconfig.h"
00025 
00026 ConfigureDef(config_cull);
00027 NotifyCategoryDef(cull, "");
00028 
00029 ConfigureFn(config_cull) {
00030   init_libcull();
00031 }
00032 
00033 ////////////////////////////////////////////////////////////////////
00034 //     Function: init_libcull
00035 //  Description: Initializes the library.  This must be called at
00036 //               least once before any of the functions or classes in
00037 //               this library can be used.  Normally it will be
00038 //               called by the static initializers and need not be
00039 //               called explicitly, but special cases exist.
00040 ////////////////////////////////////////////////////////////////////
00041 void
00042 init_libcull() {
00043   static bool initialized = false;
00044   if (initialized) {
00045     return;
00046   }
00047   initialized = true;
00048 
00049   CullBinBackToFront::init_type();
00050   CullBinFixed::init_type();
00051   CullBinFrontToBack::init_type();
00052   CullBinStateSorted::init_type();
00053   CullBinUnsorted::init_type();
00054 
00055   CullBinManager *bin_manager = CullBinManager::get_global_ptr();
00056   bin_manager->register_bin_type(CullBinManager::BT_unsorted,
00057                                  CullBinUnsorted::make_bin);
00058   bin_manager->register_bin_type(CullBinManager::BT_state_sorted,
00059                                  CullBinStateSorted::make_bin);
00060   bin_manager->register_bin_type(CullBinManager::BT_back_to_front,
00061                                  CullBinBackToFront::make_bin);
00062   bin_manager->register_bin_type(CullBinManager::BT_front_to_back,
00063                                  CullBinFrontToBack::make_bin);
00064   bin_manager->register_bin_type(CullBinManager::BT_fixed,
00065                                  CullBinFixed::make_bin);
00066 }
 All Classes Functions Variables Enumerations