14 #ifndef TEXTUREATTRIB_H 15 #define TEXTUREATTRIB_H 43 INLINE
bool is_off()
const;
44 INLINE
Texture *get_texture()
const;
53 INLINE
int get_num_on_stages()
const;
55 MAKE_SEQ(get_on_stages, get_num_on_stages, get_on_stage);
56 INLINE
int get_num_on_ff_stages()
const;
58 MAKE_SEQ(get_on_ff_stages, get_num_on_ff_stages, get_on_ff_stage);
59 INLINE
int get_ff_tc_index(
int n)
const;
63 INLINE
int get_on_stage_override(
TextureStage *stage)
const;
67 MAKE_SEQ_PROPERTY(on_stages, get_num_on_stages, get_on_stage);
69 MAKE_MAP_PROPERTY(textures, has_on_stage, get_on_texture);
70 MAKE_MAP_KEYS_SEQ(textures, get_num_on_stages, get_on_stage);
72 MAKE_MAP_PROPERTY(samplers, has_on_stage, get_on_sampler);
73 MAKE_MAP_KEYS_SEQ(samplers, get_num_on_stages, get_on_stage);
75 INLINE
int get_num_off_stages()
const;
77 MAKE_SEQ(get_off_stages, get_num_off_stages, get_off_stage);
79 INLINE
bool has_all_off()
const;
81 MAKE_SEQ_PROPERTY(off_stages, get_num_off_stages, get_off_stage);
83 INLINE
bool is_identity()
const;
94 CPT(
TextureAttrib) filter_to_max(
int max_texture_stages)
const;
97 virtual void output(std::ostream &out)
const;
103 virtual int compare_to_impl(
const RenderAttrib *other)
const;
104 virtual size_t get_hash_impl()
const;
109 INLINE
void check_sorted()
const;
110 void sort_on_stages();
116 unsigned int implicit_sort = 0,
124 unsigned int _implicit_sort;
128 class CompareTextureStagePriorities {
130 INLINE
bool operator () (
const TextureAttrib::StageNode *a,
const TextureAttrib::StageNode *b)
const;
133 class CompareTextureStageSort {
135 INLINE
bool operator () (
const TextureAttrib::StageNode *a,
const TextureAttrib::StageNode *b)
const;
138 class CompareTextureStagePointer {
140 INLINE
bool operator () (
const TextureAttrib::StageNode &a,
const TextureAttrib::StageNode &b)
const;
147 RenderStages _render_stages;
148 RenderStages _render_ff_stages;
149 unsigned int _next_implicit_sort;
152 bool _off_all_stages;
164 static int get_class_slot() {
167 virtual int get_slot()
const {
168 return get_class_slot();
170 MAKE_PROPERTY(class_slot, get_class_slot);
173 static void register_with_read_factory();
185 static void init_type() {
186 RenderAttrib::init_type();
188 RenderAttrib::get_class_type());
192 return get_class_type();
194 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
198 static int _attrib_slot;
This is our own Panda specialization on the default STL map.
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.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
static int register_slot(TypeHandle type_handle, int sort, RenderAttrib *default_attrib)
Adds the indicated TypeHandle to the registry, if it is not there already, and returns a unique slot ...
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...
Represents a set of settings that indicate how a texture is sampled.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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,...