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
43 init_libcull() {
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
56 CullBinManager *bin_manager = CullBinManager::get_global_ptr();
57 bin_manager->register_bin_type(CullBinManager::BT_unsorted,
58 CullBinUnsorted::make_bin);
59 bin_manager->register_bin_type(CullBinManager::BT_state_sorted,
60 CullBinStateSorted::make_bin);
61 bin_manager->register_bin_type(CullBinManager::BT_back_to_front,
62 CullBinBackToFront::make_bin);
63 bin_manager->register_bin_type(CullBinManager::BT_front_to_back,
64 CullBinFrontToBack::make_bin);
65 bin_manager->register_bin_type(CullBinManager::BT_fixed,
66 CullBinFixed::make_bin);
67 }
CullBinBackToFront::make_bin
static CullBin * make_bin(const std::string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
Factory constructor for passing to the CullBinManager.
Definition: cullBinBackToFront.cxx:42
CullBinFixed::make_bin
static CullBin * make_bin(const std::string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
Factory constructor for passing to the CullBinManager.
Definition: cullBinFixed.cxx:42
CullBinFrontToBack::make_bin
static CullBin * make_bin(const std::string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
Factory constructor for passing to the CullBinManager.
Definition: cullBinFrontToBack.cxx:42
CullBinManager
This is a global object that maintains the collection of named CullBins in the world.
Definition: cullBinManager.h:34
CullBinManager::get_global_ptr
static CullBinManager * get_global_ptr()
Returns the pointer to the global CullBinManager object.
Definition: cullBinManager.I:281
CullBinManager::register_bin_type
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...
Definition: cullBinManager.cxx:211
CullBinStateSorted::make_bin
static CullBin * make_bin(const std::string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
Factory constructor for passing to the CullBinManager.
Definition: cullBinStateSorted.cxx:41
CullBinUnsorted::make_bin
static CullBin * make_bin(const std::string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
Factory constructor for passing to the CullBinManager.
Definition: cullBinUnsorted.cxx:38
init_libcull
void init_libcull()
Initializes the library.
Definition: config_cull.cxx:43
config_cull.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
cullBinBackToFront.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
cullBinFixed.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
cullBinFrontToBack.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
cullBinManager.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
cullBinStateSorted.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
cullBinUnsorted.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
dconfig.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.