00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef TRANSPARENCYATTRIB_H
00016 #define TRANSPARENCYATTRIB_H
00017
00018 #include "pandabase.h"
00019
00020 #include "renderAttrib.h"
00021
00022 class FactoryParams;
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 class EXPCL_PANDA_PGRAPH TransparencyAttrib : public RenderAttrib {
00037 PUBLISHED:
00038 enum Mode {
00039
00040
00041
00042 M_none = 0,
00043 M_alpha = 1,
00044 M_notused,
00045 M_multisample,
00046 M_multisample_mask,
00047 M_binary,
00048 M_dual,
00049 };
00050
00051 private:
00052 INLINE TransparencyAttrib(Mode mode = M_none);
00053
00054 PUBLISHED:
00055 static CPT(RenderAttrib) make(Mode mode);
00056 static CPT(RenderAttrib) make_default();
00057
00058 INLINE Mode get_mode() const;
00059
00060 public:
00061 virtual void output(ostream &out) const;
00062
00063 protected:
00064 virtual int compare_to_impl(const RenderAttrib *other) const;
00065 virtual size_t get_hash_impl() const;
00066 virtual CPT(RenderAttrib) get_auto_shader_attrib_impl(const RenderState *state) const;
00067
00068 private:
00069 Mode _mode;
00070
00071 PUBLISHED:
00072 static int get_class_slot() {
00073 return _attrib_slot;
00074 }
00075 virtual int get_slot() const {
00076 return get_class_slot();
00077 }
00078
00079 public:
00080 static void register_with_read_factory();
00081 virtual void write_datagram(BamWriter *manager, Datagram &dg);
00082
00083 protected:
00084 static TypedWritable *make_from_bam(const FactoryParams ¶ms);
00085 void fillin(DatagramIterator &scan, BamReader *manager);
00086
00087 public:
00088 static TypeHandle get_class_type() {
00089 return _type_handle;
00090 }
00091 static void init_type() {
00092 RenderAttrib::init_type();
00093 register_type(_type_handle, "TransparencyAttrib",
00094 RenderAttrib::get_class_type());
00095 _attrib_slot = register_slot(_type_handle, 100, make_default);
00096 }
00097 virtual TypeHandle get_type() const {
00098 return get_class_type();
00099 }
00100 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00101
00102 private:
00103 static TypeHandle _type_handle;
00104 static int _attrib_slot;
00105 };
00106
00107 #include "transparencyAttrib.I"
00108
00109 #endif
00110