Panda3D
 All Classes Functions Variables Enumerations
config_cull.cxx
1 // Filename: config_cull.cxx
2 // Created by: drose (23Mar06)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "config_cull.h"
16 
17 #include "cullBinBackToFront.h"
18 #include "cullBinFixed.h"
19 #include "cullBinFrontToBack.h"
20 #include "cullBinStateSorted.h"
21 #include "cullBinUnsorted.h"
22 
23 #include "cullBinManager.h"
24 #include "dconfig.h"
25 
26 ConfigureDef(config_cull);
27 NotifyCategoryDef(cull, "");
28 
29 ConfigureFn(config_cull) {
30  init_libcull();
31 }
32 
33 ////////////////////////////////////////////////////////////////////
34 // Function: init_libcull
35 // Description: Initializes the library. This must be called at
36 // least once before any of the functions or classes in
37 // this library can be used. Normally it will be
38 // called by the static initializers and need not be
39 // called explicitly, but special cases exist.
40 ////////////////////////////////////////////////////////////////////
41 void
42 init_libcull() {
43  static bool initialized = false;
44  if (initialized) {
45  return;
46  }
47  initialized = true;
48 
49  CullBinBackToFront::init_type();
50  CullBinFixed::init_type();
51  CullBinFrontToBack::init_type();
52  CullBinStateSorted::init_type();
53  CullBinUnsorted::init_type();
54 
56  bin_manager->register_bin_type(CullBinManager::BT_unsorted,
58  bin_manager->register_bin_type(CullBinManager::BT_state_sorted,
60  bin_manager->register_bin_type(CullBinManager::BT_back_to_front,
62  bin_manager->register_bin_type(CullBinManager::BT_front_to_back,
64  bin_manager->register_bin_type(CullBinManager::BT_fixed,
66 }
static CullBin * make_bin(const string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
Factory constructor for passing to the CullBinManager.
static CullBin * make_bin(const string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
Factory constructor for passing to the CullBinManager.
static CullBinManager * get_global_ptr()
Returns the pointer to the global CullBinManager object.
static CullBin * make_bin(const string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
Factory constructor for passing to the CullBinManager.
void register_bin_type(BinType type, BinConstructor *constructor)
Intended to be called at startup type by each CullBin type, to register the constructor for each type...
static CullBin * make_bin(const string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
Factory constructor for passing to the CullBinManager.
static CullBin * make_bin(const string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
Factory constructor for passing to the CullBinManager.
This is a global object that maintains the collection of named CullBins in the world.