Panda3D
eggRenderState.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 eggRenderState.h
10  * @author drose
11  * @date 2005-03-12
12  */
13 
14 #ifndef EGGRENDERSTATE_H
15 #define EGGRENDERSTATE_H
16 
17 #include "pandabase.h"
18 
19 #include "eggUserData.h"
20 #include "eggLoader.h"
21 #include "renderState.h"
22 #include "renderAttrib.h"
23 #include "internalName.h"
24 #include "geomPrimitive.h"
25 #include "luse.h"
26 #include "pointerTo.h"
27 #include "pvector.h"
28 #include "pmap.h"
29 
30 class EggPrimitive;
31 class EggTexture;
32 class EggMaterial;
33 
34 /**
35  * This class is used within this package only to record the render state that
36  * should be assigned to each primitive. It is assigned to EggPrimitive
37  * objects via the EggBinner.
38  */
39 class EXPCL_PANDA_EGG2PG EggRenderState : public EggUserData {
40 public:
41  INLINE EggRenderState(EggLoader &loader);
42  INLINE void add_attrib(const RenderAttrib *attrib);
43 
44  void fill_state(EggPrimitive *egg_prim);
45 
46  int compare_to(const EggRenderState &other) const;
47 
48 private:
49  CPT(RenderAttrib) get_material_attrib(const EggMaterial *egg_mat,
50  bool bface);
51  static TexGenAttrib::Mode get_tex_gen(const EggTexture *egg_tex);
52 
53  CPT(RenderAttrib)
54  apply_tex_mat(CPT(RenderAttrib) tex_mat_attrib,
55  TextureStage *stage, const EggTexture *egg_tex);
56 
57 public:
58  CPT(RenderState) _state;
59  bool _hidden;
60  bool _flat_shaded;
61  Geom::PrimitiveType _primitive_type;
62 
64  typedef EggLoader::TextureDef TextureDef;
66 
67  BakeInUVs _bake_in_uvs;
68 
69 private:
70  EggLoader &_loader;
71 
75 };
76 
77 #include "eggRenderState.I"
78 
79 #endif
A base class for any of a number of kinds of geometry primitives: polygons, point lights,...
Definition: eggPrimitive.h:47
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the base class for a number of render attributes (other than transform) that may be set on sc...
Definition: renderAttrib.h:51
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Defines a texture map that may be applied to geometry.
Definition: eggTexture.h:30
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 is our own Panda specialization on the default STL vector.
Definition: pvector.h:42
This class is used within this package only to record the render state that should be assigned to eac...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Encodes a string name in a hash table, mapping it to a pointer.
Definition: internalName.h:38
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Definition: renderState.h:47
An STL function object class, this is intended to be used on any ordered collection of class objects ...
Definition: stl_compares.h:73
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Defines the properties of a named stage of the multitexture pipeline.
Definition: textureStage.h:35
This is a base class for a user-defined data type to extend egg structures in processing code.
Definition: eggUserData.h:29
Converts an egg data structure, possibly read from an egg file but not necessarily,...
Definition: eggLoader.h:67