00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef EGGRENDERMODE_H
00020 #define EGGRENDERMODE_H
00021
00022 #include "pandabase.h"
00023 #include "typedObject.h"
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 class EXPCL_PANDAEGG EggRenderMode {
00041 public:
00042 INLINE EggRenderMode();
00043 INLINE EggRenderMode(const EggRenderMode ©);
00044 INLINE EggRenderMode &operator = (const EggRenderMode ©);
00045
00046 void write(ostream &out, int indent_level) const;
00047
00048 enum AlphaMode {
00049 AM_unspecified,
00050 AM_off,
00051 AM_on,
00052 AM_blend,
00053 AM_blend_no_occlude,
00054 AM_ms,
00055 AM_ms_mask,
00056 AM_binary,
00057 AM_dual
00058 };
00059
00060 enum DepthWriteMode {
00061 DWM_unspecified, DWM_off, DWM_on
00062 };
00063
00064 enum DepthTestMode {
00065 DTM_unspecified, DTM_off, DTM_on
00066 };
00067
00068 INLINE void set_alpha_mode(AlphaMode mode);
00069 INLINE AlphaMode get_alpha_mode() const;
00070
00071 INLINE void set_depth_write_mode(DepthWriteMode mode);
00072 INLINE DepthWriteMode get_depth_write_mode() const;
00073
00074 INLINE void set_depth_test_mode(DepthTestMode mode);
00075 INLINE DepthTestMode get_depth_test_mode() const;
00076
00077 INLINE void set_draw_order(int order);
00078 INLINE int get_draw_order() const;
00079 INLINE bool has_draw_order() const;
00080 INLINE void clear_draw_order();
00081
00082 INLINE void set_bin(const string &bin);
00083 INLINE string get_bin() const;
00084 INLINE bool has_bin() const;
00085 INLINE void clear_bin();
00086
00087
00088 bool operator == (const EggRenderMode &other) const;
00089 INLINE bool operator != (const EggRenderMode &other) const;
00090 bool operator < (const EggRenderMode &other) const;
00091
00092 static AlphaMode string_alpha_mode(const string &string);
00093 static DepthWriteMode string_depth_write_mode(const string &string);
00094 static DepthTestMode string_depth_test_mode(const string &string);
00095
00096 private:
00097 AlphaMode _alpha_mode;
00098 DepthWriteMode _depth_write_mode;
00099 DepthTestMode _depth_test_mode;
00100 int _draw_order;
00101 bool _has_draw_order;
00102 string _bin;
00103
00104
00105 public:
00106 static TypeHandle get_class_type() {
00107 return _type_handle;
00108 }
00109 static void init_type() {
00110 register_type(_type_handle, "EggRenderMode");
00111 }
00112
00113 private:
00114 static TypeHandle _type_handle;
00115 };
00116
00117 ostream &operator << (ostream &out, EggRenderMode::AlphaMode mode);
00118 ostream &operator << (ostream &out, EggRenderMode::DepthWriteMode mode);
00119 ostream &operator << (ostream &out, EggRenderMode::DepthTestMode mode);
00120
00121 #include "eggRenderMode.I"
00122
00123 #endif
00124