37 virtual void write(std::ostream &out,
int indent_level)
const;
43 E_complete_filename = 0x007,
49 bool is_equivalent_to(
const EggTexture &other,
int eq)
const;
50 bool sorts_less_than(
const EggTexture &other,
int eq)
const;
52 bool has_alpha_channel(
int num_components)
const;
55 TT_unspecified, TT_1d_texture,
56 TT_2d_texture, TT_3d_texture, TT_cube_map
60 F_rgba, F_rgbm, F_rgba12, F_rgba8, F_rgba4, F_rgba5,
61 F_rgb, F_rgb12, F_rgb8, F_rgb5, F_rgb332,
62 F_red, F_green, F_blue, F_alpha, F_luminance,
63 F_luminance_alpha, F_luminance_alphamask,
68 enum CompressionMode {
69 CM_default, CM_off, CM_on,
70 CM_fxt1, CM_dxt1, CM_dxt2, CM_dxt3, CM_dxt4, CM_dxt5,
73 WM_unspecified, WM_clamp, WM_repeat,
74 WM_mirror, WM_mirror_once, WM_border_color
88 FT_nearest_mipmap_nearest,
89 FT_linear_mipmap_nearest,
90 FT_nearest_mipmap_linear,
91 FT_linear_mipmap_linear,
100 ET_blend_color_scale,
122 enum CombineChannel {
136 CS_constant_color_scale,
137 CS_last_saved_result,
139 enum CombineOperand {
142 CO_one_minus_src_color,
144 CO_one_minus_src_alpha,
170 INLINE
void set_texture_type(TextureType texture_type);
171 INLINE TextureType get_texture_type()
const;
173 INLINE
void set_format(Format format);
174 INLINE Format get_format()
const;
176 INLINE
void set_compression_mode(CompressionMode mode);
177 INLINE CompressionMode get_compression_mode()
const;
179 INLINE
void set_wrap_mode(WrapMode mode);
180 INLINE WrapMode get_wrap_mode()
const;
182 INLINE
void set_wrap_u(WrapMode mode);
183 INLINE WrapMode get_wrap_u()
const;
184 INLINE WrapMode determine_wrap_u()
const;
186 INLINE
void set_wrap_v(WrapMode mode);
187 INLINE WrapMode get_wrap_v()
const;
188 INLINE WrapMode determine_wrap_v()
const;
190 INLINE
void set_wrap_w(WrapMode mode);
191 INLINE WrapMode get_wrap_w()
const;
192 INLINE WrapMode determine_wrap_w()
const;
194 INLINE
void set_minfilter(FilterType type);
195 INLINE FilterType get_minfilter()
const;
197 INLINE
void set_magfilter(FilterType type);
198 INLINE FilterType get_magfilter()
const;
200 INLINE
void set_anisotropic_degree(
int anisotropic_degree);
201 INLINE
void clear_anisotropic_degree();
202 INLINE
bool has_anisotropic_degree()
const;
203 INLINE
int get_anisotropic_degree()
const;
205 INLINE
void set_env_type(EnvType type);
206 INLINE EnvType get_env_type()
const;
207 bool affects_polygon_alpha()
const;
209 INLINE
void set_combine_mode(CombineChannel channel, CombineMode cm);
210 INLINE CombineMode get_combine_mode(CombineChannel channel)
const;
211 INLINE
void set_combine_source(CombineChannel channel,
int n, CombineSource cs);
212 INLINE CombineSource get_combine_source(CombineChannel channel,
int n)
const;
213 INLINE
void set_combine_operand(CombineChannel channel,
int n, CombineOperand co);
214 INLINE CombineOperand get_combine_operand(CombineChannel channel,
int n)
const;
216 INLINE
void set_saved_result(
bool saved_result);
217 INLINE
bool get_saved_result()
const;
219 INLINE
void set_tex_gen(TexGen tex_gen);
220 INLINE TexGen get_tex_gen()
const;
222 INLINE
void set_quality_level(QualityLevel quality_level);
223 INLINE QualityLevel get_quality_level()
const;
225 INLINE
void set_stage_name(
const std::string &stage_name);
226 INLINE
void clear_stage_name();
227 INLINE
bool has_stage_name()
const;
228 INLINE
const std::string &get_stage_name()
const;
230 INLINE
void set_priority(
int priority);
231 INLINE
void clear_priority();
232 INLINE
bool has_priority()
const;
233 INLINE
int get_priority()
const;
235 INLINE
void set_color(
const LColor &color);
236 INLINE
void clear_color();
237 INLINE
bool has_color()
const;
238 INLINE
const LColor &get_color()
const;
240 INLINE
void set_border_color(
const LColor &border_color);
241 INLINE
void clear_border_color();
242 INLINE
bool has_border_color()
const;
243 INLINE
const LColor &get_border_color()
const;
245 INLINE
void set_uv_name(
const std::string &uv_name);
246 INLINE
void clear_uv_name();
247 INLINE
bool has_uv_name()
const;
248 INLINE
const std::string &get_uv_name()
const;
250 INLINE
void set_rgb_scale(
int rgb_scale);
251 INLINE
void clear_rgb_scale();
252 INLINE
bool has_rgb_scale()
const;
253 INLINE
int get_rgb_scale()
const;
255 INLINE
void set_alpha_scale(
int alpha_scale);
256 INLINE
void clear_alpha_scale();
257 INLINE
bool has_alpha_scale()
const;
258 INLINE
int get_alpha_scale()
const;
260 INLINE
void set_alpha_filename(
const Filename &filename);
261 INLINE
void clear_alpha_filename();
262 INLINE
bool has_alpha_filename()
const;
263 INLINE
const Filename &get_alpha_filename()
const;
265 INLINE
void set_alpha_fullpath(
const Filename &fullpath);
266 INLINE
const Filename &get_alpha_fullpath()
const;
268 INLINE
void set_alpha_file_channel(
int alpha_file_channel);
269 INLINE
void clear_alpha_file_channel();
270 INLINE
bool has_alpha_file_channel()
const;
271 INLINE
int get_alpha_file_channel()
const;
273 INLINE
void set_multiview(
bool multiview);
274 INLINE
bool get_multiview()
const;
276 INLINE
void set_num_views(
int num_views);
277 INLINE
void clear_num_views();
278 INLINE
bool has_num_views()
const;
279 INLINE
int get_num_views()
const;
281 INLINE
void set_read_mipmaps(
bool read_mipmaps);
282 INLINE
bool get_read_mipmaps()
const;
284 INLINE
void set_min_lod(
double min_lod);
285 INLINE
void clear_min_lod();
286 INLINE
bool has_min_lod()
const;
287 INLINE
double get_min_lod()
const;
289 INLINE
void set_max_lod(
double max_lod);
290 INLINE
void clear_max_lod();
291 INLINE
bool has_max_lod()
const;
292 INLINE
double get_max_lod()
const;
294 INLINE
void set_lod_bias(
double lod_bias);
295 INLINE
void clear_lod_bias();
296 INLINE
bool has_lod_bias()
const;
297 INLINE
double get_lod_bias()
const;
299 void clear_multitexture();
301 INLINE
int get_multitexture_sort()
const;
303 static TextureType string_texture_type(
const std::string &
string);
304 static Format string_format(
const std::string &
string);
305 static CompressionMode string_compression_mode(
const std::string &
string);
306 static WrapMode string_wrap_mode(
const std::string &
string);
307 static FilterType string_filter_type(
const std::string &
string);
308 static EnvType string_env_type(
const std::string &
string);
309 static CombineMode string_combine_mode(
const std::string &
string);
310 static CombineSource string_combine_source(
const std::string &
string);
311 static CombineOperand string_combine_operand(
const std::string &
string);
312 static TexGen string_tex_gen(
const std::string &
string);
313 static QualityLevel string_quality_level(
const std::string &
string);
316 MAKE_PROPERTY(texture_type, get_texture_type, set_texture_type);
317 MAKE_PROPERTY(format, get_format, set_format);
318 MAKE_PROPERTY(compression_mode, get_compression_mode, set_compression_mode);
319 MAKE_PROPERTY(wrap_mode, get_wrap_mode, set_wrap_mode);
320 MAKE_PROPERTY(wrap_u, get_wrap_u, set_wrap_u);
321 MAKE_PROPERTY(wrap_v, get_wrap_v, set_wrap_v);
322 MAKE_PROPERTY(wrap_w, get_wrap_w, set_wrap_w);
323 MAKE_PROPERTY(minfilter, get_minfilter, set_minfilter);
324 MAKE_PROPERTY(magfilter, get_magfilter, set_magfilter);
325 MAKE_PROPERTY2(anisotropic_degree, has_anisotropic_degree, get_anisotropic_degree,
326 set_anisotropic_degree, clear_anisotropic_degree);
327 MAKE_PROPERTY(env_type, get_env_type, set_env_type);
328 MAKE_PROPERTY(saved_result, get_saved_result, set_saved_result);
329 MAKE_PROPERTY(tex_gen, get_tex_gen, set_tex_gen);
330 MAKE_PROPERTY(quality_level, get_quality_level, set_quality_level);
331 MAKE_PROPERTY2(stage_name, has_stage_name, get_stage_name,
332 set_stage_name, clear_stage_name);
333 MAKE_PROPERTY2(priority, has_priority, get_priority,
334 set_priority, clear_priority);
335 MAKE_PROPERTY2(color, has_color, get_color,
336 set_color, clear_color);
337 MAKE_PROPERTY2(border_color, has_border_color, get_border_color,
338 set_border_color, clear_border_color);
339 MAKE_PROPERTY2(uv_name, has_uv_name, get_uv_name,
340 set_uv_name, clear_uv_name);
341 MAKE_PROPERTY2(rgb_scale, has_rgb_scale, get_rgb_scale,
342 set_rgb_scale, clear_rgb_scale);
343 MAKE_PROPERTY2(alpha_scale, has_alpha_scale, get_alpha_scale,
344 set_alpha_scale, clear_alpha_scale);
345 MAKE_PROPERTY2(alpha_filename, has_alpha_filename, get_alpha_filename,
346 set_alpha_filename, clear_alpha_filename);
347 MAKE_PROPERTY(alpha_fullpath, get_alpha_fullpath, set_alpha_fullpath);
348 MAKE_PROPERTY2(alpha_file_channel, has_alpha_file_channel, get_alpha_file_channel,
349 set_alpha_file_channel, clear_alpha_file_channel);
350 MAKE_PROPERTY(multiview, get_multiview, set_multiview);
351 MAKE_PROPERTY2(num_views, has_num_views, get_num_views,
352 set_num_views, clear_num_views);
353 MAKE_PROPERTY(read_mipmaps, get_read_mipmaps, set_read_mipmaps);
354 MAKE_PROPERTY2(min_lod, has_min_lod, get_min_lod,
355 set_min_lod, clear_min_lod);
356 MAKE_PROPERTY2(max_lod, has_max_lod, get_max_lod,
357 set_max_lod, clear_max_lod);
358 MAKE_PROPERTY2(lod_bias, has_lod_bias, get_lod_bias,
359 set_lod_bias, clear_lod_bias);
361 MAKE_PROPERTY(multitexture_sort, get_multitexture_sort);
367 virtual bool egg_start_parse_body();
371 bool r_min_multitexture_sort(
int sort,
MultiTextures &cycle_detector);
374 F_has_alpha_filename = 0x0002,
375 F_has_anisotropic_degree = 0x0004,
376 F_has_alpha_file_channel = 0x0008,
377 F_has_stage_name = 0x0010,
378 F_has_uv_name = 0x0020,
379 F_has_priority = 0x0040,
380 F_has_color = 0x0080,
381 F_has_rgb_scale = 0x0100,
382 F_has_alpha_scale = 0x0200,
383 F_has_border_color = 0x0400,
384 F_has_num_views = 0x0800,
385 F_has_min_lod = 0x1000,
386 F_has_max_lod = 0x2000,
387 F_has_lod_bias = 0x4000,
390 TextureType _texture_type;
392 CompressionMode _compression_mode;
393 WrapMode _wrap_mode, _wrap_u, _wrap_v, _wrap_w;
394 FilterType _minfilter, _magfilter;
395 int _anisotropic_degree;
401 QualityLevel _quality_level;
402 std::string _stage_name;
405 LColor _border_color;
406 std::string _uv_name;
412 int _alpha_file_channel;
414 int _multitexture_sort;
419 class SourceAndOperand {
421 INLINE SourceAndOperand();
422 CombineSource _source;
423 CombineOperand _operand;
430 SourceAndOperand _ops[CI_num_indices];
433 Combiner _combiner[CC_num_channels];
437 MultiTextures _over_textures, _under_textures;
443 static void init_type() {
444 EggFilenameNode::init_type();
445 EggRenderMode::init_type();
447 EggFilenameNode::get_class_type(),
448 EggRenderMode::get_class_type());
451 return get_class_type();
453 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
472 INLINE std::ostream &operator << (std::ostream &out,
const EggTexture &n) {
476 EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::TextureType texture_type);
477 EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::Format format);
478 EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::CompressionMode mode);
479 EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::WrapMode mode);
480 EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::FilterType type);
481 EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::EnvType type);
482 EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::CombineMode cm);
483 EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::CombineChannel cc);
484 EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::CombineSource cs);
485 EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::CombineOperand co);
486 EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::TexGen tex_gen);
487 EXPCL_PANDA_EGG std::ostream &operator << (std::ostream &out, EggTexture::QualityLevel quality_level);