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