Panda3D
config_cull.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file config_cull.cxx
10  * @author drose
11  * @date 2006-03-23
12  */
13 
14 #include "config_cull.h"
15 
16 #include "cullBinBackToFront.h"
17 #include "cullBinFixed.h"
18 #include "cullBinFrontToBack.h"
19 #include "cullBinStateSorted.h"
20 #include "cullBinUnsorted.h"
21 
22 #include "cullBinManager.h"
23 #include "dconfig.h"
24 
25 #if !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) && !defined(BUILDING_PANDA_CULL)
26  #error Buildsystem error: BUILDING_PANDA_CULL not defined
27 #endif
28 
29 ConfigureDef(config_cull);
30 NotifyCategoryDef(cull, "");
31 
32 ConfigureFn(config_cull) {
33  init_libcull();
34 }
35 
36 /**
37  * Initializes the library. This must be called at least once before any of
38  * the functions or classes in this library can be used. Normally it will be
39  * called by the static initializers and need not be called explicitly, but
40  * special cases exist.
41  */
42 void
44  static bool initialized = false;
45  if (initialized) {
46  return;
47  }
48  initialized = true;
49 
50  CullBinBackToFront::init_type();
51  CullBinFixed::init_type();
52  CullBinFrontToBack::init_type();
53  CullBinStateSorted::init_type();
54  CullBinUnsorted::init_type();
55 
57  bin_manager->register_bin_type(CullBinManager::BT_unsorted,
59  bin_manager->register_bin_type(CullBinManager::BT_state_sorted,
61  bin_manager->register_bin_type(CullBinManager::BT_back_to_front,
63  bin_manager->register_bin_type(CullBinManager::BT_front_to_back,
65  bin_manager->register_bin_type(CullBinManager::BT_fixed,
67 }
static CullBin * make_bin(const std::string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
Factory constructor for passing to the CullBinManager.
static CullBin * make_bin(const std::string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
Factory constructor for passing to the CullBinManager.
static CullBin * make_bin(const std::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.
static CullBinManager * get_global_ptr()
Returns the pointer to the global CullBinManager object.
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 std::string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
Factory constructor for passing to the CullBinManager.
static CullBin * make_bin(const std::string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
Factory constructor for passing to the CullBinManager.
void init_libcull()
Initializes the library.
Definition: config_cull.cxx:43
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.