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;
98 CPT(
TextureAttrib) filter_to_max(
int max_texture_stages)
const;
101 virtual void output(std::ostream &out)
const;
107 virtual int compare_to_impl(
const RenderAttrib *other)
const;
108 virtual size_t get_hash_impl()
const;
113 INLINE
void check_sorted()
const;
114 void sort_on_stages();
120 unsigned int implicit_sort = 0,
128 unsigned int _implicit_sort;
132 class CompareTextureStagePriorities {
134 INLINE
bool operator () (
const TextureAttrib::StageNode *a,
const TextureAttrib::StageNode *b)
const;
137 class CompareTextureStageSort {
139 INLINE
bool operator () (
const TextureAttrib::StageNode *a,
const TextureAttrib::StageNode *b)
const;
142 class CompareTextureStagePointer {
144 INLINE
bool operator () (
const TextureAttrib::StageNode &a,
const TextureAttrib::StageNode &b)
const;
151 RenderStages _render_stages;
152 RenderStages _render_ff_stages;
153 unsigned int _next_implicit_sort;
156 bool _off_all_stages;
168 static int get_class_slot() {
171 virtual int get_slot()
const {
172 return get_class_slot();
174 MAKE_PROPERTY(class_slot, get_class_slot);
177 static void register_with_read_factory();
189 static void init_type() {
190 RenderAttrib::init_type();
192 RenderAttrib::get_class_type());
196 return get_class_type();
198 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
202 static int _attrib_slot;
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
This is the base class for a number of render attributes (other than transform) that may be set on sc...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
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 ...
Represents a set of settings that indicate how a texture is sampled.
Indicates the set of TextureStages and their associated Textures that should be applied to (or remove...
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...
virtual bool has_cull_callback() const
Should be overridden by derived classes to return true if cull_callback() has been defined.
virtual bool lower_attrib_can_override() const
Intended to be overridden by derived RenderAttrib types to specify how two consecutive RenderAttrib o...
Defines the properties of a named stage of the multitexture pipeline.
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
TypeHandle is the identifier used to differentiate C++ class types.
Base class for objects that can be written to and read from Bam files.
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().
This is a sequence number that increments monotonically.
A specialization of ordered_vector that emulates a standard STL set: one copy of each element is allo...
This is our own Panda specialization on the default STL list.
This is our own Panda specialization on the default STL map.
This is our own Panda specialization on the default STL vector.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
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.