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