Panda3D
stateMunger.h
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 stateMunger.h
10  * @author drose
11  * @date 2005-05-04
12  */
13 
14 #ifndef STATEMUNGER_H
15 #define STATEMUNGER_H
16 
17 #include "pandabase.h"
18 #include "geomMunger.h"
19 #include "renderState.h"
20 
21 /**
22  * This is just a simple derivative of GeomMunger that adds the ability to
23  * munge states. That functionality can't be declared in the base class,
24  * since it doesn't really know about RenderState.
25  */
26 class EXPCL_PANDA_PGRAPH StateMunger : public GeomMunger {
27 public:
29  virtual ~StateMunger();
30  CPT(RenderState) munge_state(const RenderState *state);
31 
32  INLINE bool should_munge_state() const;
33 
34 protected:
35  virtual CPT(RenderState) munge_state_impl(const RenderState *state);
36 
37  bool _should_munge_state;
38 
39 public:
40  static TypeHandle get_class_type() {
41  return _type_handle;
42  }
43  static void init_type() {
44  GeomMunger::init_type();
45  register_type(_type_handle, "StateMunger",
46  GeomMunger::get_class_type());
47  }
48  virtual TypeHandle get_type() const {
49  return get_class_type();
50  }
51  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
52 
53 private:
54  static TypeHandle _type_handle;
55 };
56 
57 #include "stateMunger.I"
58 
59 #endif
This is just a simple derivative of GeomMunger that adds the ability to munge states.
Definition: stateMunger.h:26
Objects of this class are used to convert vertex data from a Geom into a format suitable for passing ...
Definition: geomMunger.h:50
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
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.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Definition: renderState.h:47
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81