00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef EGGRENDERMODE_H
00016 #define EGGRENDERMODE_H
00017
00018 #include "pandabase.h"
00019 #include "typedObject.h"
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 class EXPCL_PANDAEGG EggRenderMode {
00037 PUBLISHED:
00038 EggRenderMode();
00039 INLINE EggRenderMode(const EggRenderMode ©);
00040 EggRenderMode &operator = (const EggRenderMode ©);
00041
00042 void write(ostream &out, int indent_level) const;
00043
00044 enum AlphaMode {
00045 AM_unspecified,
00046 AM_off,
00047 AM_on,
00048 AM_blend,
00049 AM_blend_no_occlude,
00050 AM_ms,
00051 AM_ms_mask,
00052 AM_binary,
00053 AM_dual
00054 };
00055
00056 enum DepthWriteMode {
00057 DWM_unspecified, DWM_off, DWM_on
00058 };
00059
00060 enum DepthTestMode {
00061 DTM_unspecified, DTM_off, DTM_on
00062 };
00063
00064 enum VisibilityMode {
00065 VM_unspecified, VM_hidden, VM_normal
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_visibility_mode(VisibilityMode mode);
00078 INLINE VisibilityMode get_visibility_mode() const;
00079
00080 INLINE void set_depth_offset(int bias);
00081 INLINE int get_depth_offset() const;
00082 INLINE bool has_depth_offset() const;
00083 INLINE void clear_depth_offset();
00084
00085 INLINE void set_draw_order(int order);
00086 INLINE int get_draw_order() const;
00087 INLINE bool has_draw_order() const;
00088 INLINE void clear_draw_order();
00089
00090 INLINE void set_bin(const string &bin);
00091 INLINE string get_bin() const;
00092 INLINE bool has_bin() const;
00093 INLINE void clear_bin();
00094
00095
00096 bool operator == (const EggRenderMode &other) const;
00097 INLINE bool operator != (const EggRenderMode &other) const;
00098 bool operator < (const EggRenderMode &other) const;
00099
00100 static AlphaMode string_alpha_mode(const string &string);
00101 static DepthWriteMode string_depth_write_mode(const string &string);
00102 static DepthTestMode string_depth_test_mode(const string &string);
00103 static VisibilityMode string_visibility_mode(const string &string);
00104
00105 private:
00106 AlphaMode _alpha_mode;
00107 DepthWriteMode _depth_write_mode;
00108 DepthTestMode _depth_test_mode;
00109 VisibilityMode _visibility_mode;
00110 int _depth_offset;
00111 bool _has_depth_offset;
00112 int _draw_order;
00113 bool _has_draw_order;
00114 string _bin;
00115
00116
00117 public:
00118 static TypeHandle get_class_type() {
00119 return _type_handle;
00120 }
00121 static void init_type() {
00122 register_type(_type_handle, "EggRenderMode");
00123 }
00124
00125 private:
00126 static TypeHandle _type_handle;
00127 };
00128
00129 EXPCL_PANDAEGG ostream &operator << (ostream &out, EggRenderMode::AlphaMode mode);
00130 EXPCL_PANDAEGG istream &operator >> (istream &in, EggRenderMode::AlphaMode &mode);
00131
00132 EXPCL_PANDAEGG ostream &operator << (ostream &out, EggRenderMode::DepthWriteMode mode);
00133 EXPCL_PANDAEGG ostream &operator << (ostream &out, EggRenderMode::DepthTestMode mode);
00134 EXPCL_PANDAEGG ostream &operator << (ostream &out, EggRenderMode::VisibilityMode mode);
00135
00136 #include "eggRenderMode.I"
00137
00138 #endif
00139