15 #ifndef TEXTUREATTRIB_H 16 #define TEXTUREATTRIB_H 18 #include "pandabase.h" 20 #include "renderAttrib.h" 22 #include "textureStage.h" 23 #include "updateSeq.h" 24 #include "ordered_vector.h" 25 #include "vector_int.h" 37 INLINE TextureAttrib(
const TextureAttrib ©);
46 INLINE
bool is_off()
const;
47 INLINE
Texture *get_texture()
const;
56 INLINE
int get_num_on_stages()
const;
58 MAKE_SEQ(get_on_stages, get_num_on_stages, get_on_stage);
59 INLINE
int get_num_on_ff_stages()
const;
61 MAKE_SEQ(get_on_ff_stages, get_num_on_ff_stages, get_on_ff_stage);
62 INLINE
int get_ff_tc_index(
int n)
const;
66 INLINE
int get_on_stage_override(
TextureStage *stage)
const;
70 INLINE
int get_num_off_stages()
const;
72 MAKE_SEQ(get_off_stages, get_num_off_stages, get_off_stage);
74 INLINE
bool has_all_off()
const;
76 INLINE
bool is_identity()
const;
87 CPT(TextureAttrib) filter_to_max(
int max_texture_stages)
const;
90 virtual void output(ostream &out)
const;
96 virtual int compare_to_impl(
const RenderAttrib *other)
const;
97 virtual size_t get_hash_impl()
const;
103 INLINE
void check_sorted()
const;
104 void sort_on_stages();
110 unsigned int implicit_sort = 0,
118 unsigned int _implicit_sort;
122 class CompareTextureStagePriorities {
124 INLINE
bool operator () (
const TextureAttrib::StageNode *a,
const TextureAttrib::StageNode *b)
const;
127 class CompareTextureStageSort {
129 INLINE
bool operator () (
const TextureAttrib::StageNode *a,
const TextureAttrib::StageNode *b)
const;
132 class CompareTextureStagePointer {
134 INLINE
bool operator () (
const TextureAttrib::StageNode &a,
const TextureAttrib::StageNode &b)
const;
141 RenderStages _render_stages;
142 RenderStages _render_ff_stages;
143 unsigned int _next_implicit_sort;
146 bool _off_all_stages;
158 static int get_class_slot() {
161 virtual int get_slot()
const {
162 return get_class_slot();
166 static void register_with_read_factory();
178 static void init_type() {
179 RenderAttrib::init_type();
180 register_type(_type_handle,
"TextureAttrib",
181 RenderAttrib::get_class_type());
182 _attrib_slot = register_slot(_type_handle, 30, make_default);
185 return get_class_type();
187 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
191 static int _attrib_slot;
194 #include "textureAttrib.I"
This is the base class for a number of render attributes (other than transform) that may be set on sc...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
virtual bool has_cull_callback() const
Should be overridden by derived classes to return true if cull_callback() has been defined...
Base class for objects that can be written to and read from Bam files.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This is our own Panda specialization on the default STL list.
A specialization of ordered_vector that emulates a standard STL set: one copy of each element is allo...
Indicates the set of TextureStages and their associated Textures that should be applied to (or remove...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual bool cull_callback(CullTraverser *trav, const CullTraverserData &data) const
If has_cull_callback() returns true, this function will be called during the cull traversal to perfor...
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Represents a set of settings that indicate how a texture is sampled.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
This is a sequence number that increments monotonically.
Defines the properties of a named stage of the multitexture pipeline.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
virtual bool lower_attrib_can_override() const
Intended to be overridden by derived RenderAttrib types to specify how two consecutive RenderAttrib o...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling...