15 #ifndef TEXTURESTAGE_H
16 #define TEXTURESTAGE_H
18 #include "pandabase.h"
20 #include "internalName.h"
21 #include "pointerTo.h"
22 #include "typedWritableReferenceCount.h"
23 #include "updateSeq.h"
42 void operator = (
const TextureStage ©);
44 virtual ~TextureStage();
92 CS_constant_color_scale,
99 CO_one_minus_src_color,
101 CO_one_minus_src_alpha,
104 INLINE
void set_name(
const string &name);
105 INLINE
const string &get_name()
const;
107 INLINE
void set_sort(
int sort);
108 INLINE
int get_sort()
const;
110 INLINE
void set_priority(
int priority);
111 INLINE
int get_priority()
const;
113 INLINE
void set_texcoord_name(InternalName *name);
114 INLINE
void set_texcoord_name(
const string &texcoord_name);
115 INLINE InternalName *get_texcoord_name()
const;
116 INLINE InternalName *get_tangent_name()
const;
117 INLINE InternalName *get_binormal_name()
const;
119 INLINE
void set_mode(Mode mode);
120 INLINE Mode get_mode()
const;
122 INLINE
bool is_fixed_function()
const;
125 INLINE
LColor get_color()
const;
127 INLINE
void set_rgb_scale(
int rgb_scale);
128 INLINE
int get_rgb_scale()
const;
130 INLINE
void set_alpha_scale(
int alpha_scale);
131 INLINE
int get_alpha_scale()
const;
133 INLINE
void set_saved_result(
bool saved_result);
134 INLINE
bool get_saved_result()
const;
136 INLINE
void set_tex_view_offset(
int tex_view_offset);
137 INLINE
int get_tex_view_offset()
const;
139 INLINE
void set_combine_rgb(CombineMode mode,
140 CombineSource source0, CombineOperand operand0);
141 INLINE
void set_combine_rgb(CombineMode mode,
142 CombineSource source0, CombineOperand operand0,
143 CombineSource source1, CombineOperand operand1);
144 INLINE
void set_combine_rgb(CombineMode mode,
145 CombineSource source0, CombineOperand operand0,
146 CombineSource source1, CombineOperand operand1,
147 CombineSource source2, CombineOperand operand2);
148 INLINE CombineMode get_combine_rgb_mode()
const;
149 INLINE
int get_num_combine_rgb_operands()
const;
150 INLINE CombineSource get_combine_rgb_source0()
const;
151 INLINE CombineOperand get_combine_rgb_operand0()
const;
152 INLINE CombineSource get_combine_rgb_source1()
const;
153 INLINE CombineOperand get_combine_rgb_operand1()
const;
154 INLINE CombineSource get_combine_rgb_source2()
const;
155 INLINE CombineOperand get_combine_rgb_operand2()
const;
157 INLINE
void set_combine_alpha(CombineMode mode,
158 CombineSource source0, CombineOperand operand0);
159 INLINE
void set_combine_alpha(CombineMode mode,
160 CombineSource source0, CombineOperand operand0,
161 CombineSource source1, CombineOperand operand1);
162 INLINE
void set_combine_alpha(CombineMode mode,
163 CombineSource source0, CombineOperand operand0,
164 CombineSource source1, CombineOperand operand1,
165 CombineSource source2, CombineOperand operand2);
166 INLINE CombineMode get_combine_alpha_mode()
const;
167 INLINE
int get_num_combine_alpha_operands()
const;
168 INLINE CombineSource get_combine_alpha_source0()
const;
169 INLINE CombineOperand get_combine_alpha_operand0()
const;
170 INLINE CombineSource get_combine_alpha_source1()
const;
171 INLINE CombineOperand get_combine_alpha_operand1()
const;
172 INLINE CombineSource get_combine_alpha_source2()
const;
173 INLINE CombineOperand get_combine_alpha_operand2()
const;
175 INLINE
bool involves_color_scale()
const;
176 INLINE
bool uses_color()
const;
177 INLINE
bool uses_primary_color()
const;
178 INLINE
bool uses_last_saved_result()
const;
180 INLINE
bool operator == (
const TextureStage &other)
const;
181 INLINE
bool operator != (
const TextureStage &other)
const;
182 INLINE
bool operator < (
const TextureStage &other)
const;
184 int compare_to(
const TextureStage &other)
const;
186 void write(ostream &out)
const;
187 void output(ostream &out)
const;
189 INLINE
static TextureStage *get_default();
195 INLINE
void update_color_flags();
197 static int get_expected_num_combine_operands(CombineMode cm);
198 static bool operand_valid_for_rgb(CombineOperand co);
199 static bool operand_valid_for_alpha(CombineOperand co);
204 PT(InternalName) _texcoord_name;
210 int _tex_view_offset;
211 bool _involves_color_scale;
213 bool _uses_primary_color;
214 bool _uses_last_saved_result;
216 CombineMode _combine_rgb_mode;
217 int _num_combine_rgb_operands;
218 CombineSource _combine_rgb_source0;
219 CombineOperand _combine_rgb_operand0;
220 CombineSource _combine_rgb_source1;
221 CombineOperand _combine_rgb_operand1;
222 CombineSource _combine_rgb_source2;
223 CombineOperand _combine_rgb_operand2;
225 CombineMode _combine_alpha_mode;
226 int _num_combine_alpha_operands;
227 CombineSource _combine_alpha_source0;
228 CombineOperand _combine_alpha_operand0;
229 CombineSource _combine_alpha_source1;
230 CombineOperand _combine_alpha_operand1;
231 CombineSource _combine_alpha_source2;
232 CombineOperand _combine_alpha_operand2;
234 static PT(TextureStage) _default_stage;
239 static void register_with_read_factory();
252 static void init_type() {
253 TypedWritableReferenceCount::init_type();
254 register_type(_type_handle,
"TextureStage",
255 TypedWritableReferenceCount::get_class_type());
258 return get_class_type();
260 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
266 INLINE ostream &operator << (ostream &out,
const TextureStage &ts);
268 EXPCL_PANDA_GOBJ ostream &operator << (ostream &out, TextureStage::Mode mode);
269 EXPCL_PANDA_GOBJ ostream &operator << (ostream &out, TextureStage::CombineMode cm);
270 EXPCL_PANDA_GOBJ ostream &operator << (ostream &out, TextureStage::CombineSource cs);
271 EXPCL_PANDA_GOBJ ostream &operator << (ostream &out, TextureStage::CombineOperand co);
274 #include "textureStage.I"
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Base class for objects that can be written to and read from Bam files.
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.
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is intended to be called by each class's make_from_bam() method to read in all...
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()...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
A base class for things which need to inherit from both TypedWritable and from ReferenceCount.
This is the base class for all three-component vectors and points.
An STL function object class, this is intended to be used on any ordered collection of class objects ...
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 ...