Panda3D
 All Classes Functions Variables Enumerations
stateMunger.h
1 // Filename: stateMunger.h
2 // Created by: drose (04May05)
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 #ifndef STATEMUNGER_H
16 #define STATEMUNGER_H
17 
18 #include "pandabase.h"
19 #include "geomMunger.h"
20 #include "renderState.h"
21 #include "weakPointerTo.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : StateMunger
25 // Description : This is just a simple derivative of GeomMunger that
26 // adds the ability to munge states. That functionality
27 // can't be declared in the base class, since it doesn't
28 // really know about RenderState.
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_PANDA_PGRAPH StateMunger : public GeomMunger {
31 public:
33  virtual ~StateMunger();
34  CPT(RenderState) munge_state(const RenderState *state);
35 
36 protected:
37  virtual CPT(RenderState) munge_state_impl(const RenderState *state);
38 
40  StateMap _state_map;
41 
42 public:
43  static TypeHandle get_class_type() {
44  return _type_handle;
45  }
46  static void init_type() {
47  GeomMunger::init_type();
48  register_type(_type_handle, "StateMunger",
49  GeomMunger::get_class_type());
50  }
51  virtual TypeHandle get_type() const {
52  return get_class_type();
53  }
54  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
55 
56 private:
57  static TypeHandle _type_handle;
58 };
59 
60 #include "stateMunger.I"
61 
62 #endif
63 
This is just a simple derivative of GeomMunger that adds the ability to munge states.
Definition: stateMunger.h:30
Objects of this class are used to convert vertex data from a Geom into a format suitable for passing ...
Definition: geomMunger.h:57
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Definition: renderState.h:53
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:85