|
@@ -1,40 +1,44 @@
|
|
|
-// Filename: eggAlphaMode.I
|
|
|
|
|
|
|
+// Filename: eggRenderMode.I
|
|
|
// Created by: drose (20Jan99)
|
|
// Created by: drose (20Jan99)
|
|
|
//
|
|
//
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: EggAlphaMode::Constructor
|
|
|
|
|
|
|
+// Function: EggRenderMode::Constructor
|
|
|
// Access: Public
|
|
// Access: Public
|
|
|
// Description:
|
|
// Description:
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE EggAlphaMode::
|
|
|
|
|
-EggAlphaMode() {
|
|
|
|
|
|
|
+INLINE EggRenderMode::
|
|
|
|
|
+EggRenderMode() {
|
|
|
_alpha_mode = AM_unspecified;
|
|
_alpha_mode = AM_unspecified;
|
|
|
|
|
+ _depth_write_mode = DWM_unspecified;
|
|
|
|
|
+ _depth_test_mode = DTM_unspecified;
|
|
|
_draw_order = 0;
|
|
_draw_order = 0;
|
|
|
_has_draw_order = false;
|
|
_has_draw_order = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: EggAlphaMode::Copy Constructor
|
|
|
|
|
|
|
+// Function: EggRenderMode::Copy Constructor
|
|
|
// Access: Public
|
|
// Access: Public
|
|
|
// Description:
|
|
// Description:
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE EggAlphaMode::
|
|
|
|
|
-EggAlphaMode(const EggAlphaMode ©) {
|
|
|
|
|
|
|
+INLINE EggRenderMode::
|
|
|
|
|
+EggRenderMode(const EggRenderMode ©) {
|
|
|
(*this) = copy;
|
|
(*this) = copy;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: EggAlphaMode::Copy assignment operator
|
|
|
|
|
|
|
+// Function: EggRenderMode::Copy assignment operator
|
|
|
// Access: Public
|
|
// Access: Public
|
|
|
// Description:
|
|
// Description:
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE EggAlphaMode &EggAlphaMode::
|
|
|
|
|
-operator = (const EggAlphaMode ©) {
|
|
|
|
|
|
|
+INLINE EggRenderMode &EggRenderMode::
|
|
|
|
|
+operator = (const EggRenderMode ©) {
|
|
|
_alpha_mode = copy._alpha_mode;
|
|
_alpha_mode = copy._alpha_mode;
|
|
|
|
|
+ _depth_write_mode = copy._depth_write_mode;
|
|
|
|
|
+ _depth_test_mode = copy._depth_test_mode;
|
|
|
_draw_order = copy._draw_order;
|
|
_draw_order = copy._draw_order;
|
|
|
_has_draw_order = copy._has_draw_order;
|
|
_has_draw_order = copy._has_draw_order;
|
|
|
return *this;
|
|
return *this;
|
|
@@ -42,29 +46,89 @@ operator = (const EggAlphaMode ©) {
|
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: EggAlphaMode::set_alpha_mode
|
|
|
|
|
|
|
+// Function: EggRenderMode::set_depth_write_mode
|
|
|
// Access: Public
|
|
// Access: Public
|
|
|
-// Description:
|
|
|
|
|
|
|
+// Description: Specifies whether writes should be made to the depth
|
|
|
|
|
+// buffer (assuming the rendering backend provides a
|
|
|
|
|
+// depth buffer) when rendering this geometry.
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+INLINE void EggRenderMode::
|
|
|
|
|
+set_depth_write_mode(DepthWriteMode mode) {
|
|
|
|
|
+ _depth_write_mode = mode;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: EggRenderMode::get_depth_write_mode
|
|
|
|
|
+// Access: Public
|
|
|
|
|
+// Description: Returns the depth_write mode that was set, or
|
|
|
|
|
+// DWM_unspecified if nothing was set. See
|
|
|
|
|
+// set_depth_write_mode().
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE void EggAlphaMode::
|
|
|
|
|
|
|
+INLINE EggRenderMode::DepthWriteMode EggRenderMode::
|
|
|
|
|
+get_depth_write_mode() const {
|
|
|
|
|
+ return _depth_write_mode;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: EggRenderMode::set_depth_test_mode
|
|
|
|
|
+// Access: Public
|
|
|
|
|
+// Description: Specifies whether this geometry should be tested
|
|
|
|
|
+// against the depth buffer when it is drawn (assuming
|
|
|
|
|
+// the rendering backend provides a depth buffer). Note
|
|
|
|
|
+// that this is different, and independent from, the
|
|
|
|
|
+// depth_write mode.
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+INLINE void EggRenderMode::
|
|
|
|
|
+set_depth_test_mode(DepthTestMode mode) {
|
|
|
|
|
+ _depth_test_mode = mode;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: EggRenderMode::get_depth_test_mode
|
|
|
|
|
+// Access: Public
|
|
|
|
|
+// Description: Returns the depth_test mode that was set, or
|
|
|
|
|
+// DTM_unspecified if nothing was set. See
|
|
|
|
|
+// set_depth_test_mode().
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+INLINE EggRenderMode::DepthTestMode EggRenderMode::
|
|
|
|
|
+get_depth_test_mode() const {
|
|
|
|
|
+ return _depth_test_mode;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: EggRenderMode::set_alpha_mode
|
|
|
|
|
+// Access: Public
|
|
|
|
|
+// Description: Specifies precisely how the transparency for this
|
|
|
|
|
+// geometry should be achieved, or if it should be used.
|
|
|
|
|
+// The default, AM_unspecified, is to use transparency
|
|
|
|
|
+// if the geometry has a color whose alpha value is
|
|
|
|
|
+// non-1, or if it has a four-channel texture applied;
|
|
|
|
|
+// otherwise, AM_on forces transparency on, and AM_off
|
|
|
|
|
+// forces it off. The other flavors of transparency are
|
|
|
|
|
+// specific ways to turn on transparency, which may or
|
|
|
|
|
+// may not be supported by a particular rendering
|
|
|
|
|
+// backend.
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+INLINE void EggRenderMode::
|
|
|
set_alpha_mode(AlphaMode mode) {
|
|
set_alpha_mode(AlphaMode mode) {
|
|
|
_alpha_mode = mode;
|
|
_alpha_mode = mode;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: EggAlphaMode::get_alpha_mode
|
|
|
|
|
|
|
+// Function: EggRenderMode::get_alpha_mode
|
|
|
// Access: Public
|
|
// Access: Public
|
|
|
-// Description:
|
|
|
|
|
|
|
+// Description: Returns the alpha mode that was set, or
|
|
|
|
|
+// AM_unspecified if nothing was set. See
|
|
|
|
|
+// set_alpha_mode().
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE EggAlphaMode::AlphaMode EggAlphaMode::
|
|
|
|
|
|
|
+INLINE EggRenderMode::AlphaMode EggRenderMode::
|
|
|
get_alpha_mode() const {
|
|
get_alpha_mode() const {
|
|
|
return _alpha_mode;
|
|
return _alpha_mode;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: EggAlphaMode::set_draw_order
|
|
|
|
|
|
|
+// Function: EggRenderMode::set_draw_order
|
|
|
// Access: Public
|
|
// Access: Public
|
|
|
// Description: Sets the "draw-order" flag associated with this
|
|
// Description: Sets the "draw-order" flag associated with this
|
|
|
// object. This specifies a particular order in which
|
|
// object. This specifies a particular order in which
|
|
@@ -72,47 +136,47 @@ get_alpha_mode() const {
|
|
|
// specified bin. If a bin is not explicitly specified,
|
|
// specified bin. If a bin is not explicitly specified,
|
|
|
// "fixed" is used. See also set_bin().
|
|
// "fixed" is used. See also set_bin().
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE void EggAlphaMode::
|
|
|
|
|
|
|
+INLINE void EggRenderMode::
|
|
|
set_draw_order(int order) {
|
|
set_draw_order(int order) {
|
|
|
_draw_order = order;
|
|
_draw_order = order;
|
|
|
_has_draw_order = true;
|
|
_has_draw_order = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: EggAlphaMode::get_draw_order
|
|
|
|
|
|
|
+// Function: EggRenderMode::get_draw_order
|
|
|
// Access: Public
|
|
// Access: Public
|
|
|
// Description: Returns the "draw-order" flag as set for this
|
|
// Description: Returns the "draw-order" flag as set for this
|
|
|
// particular object. See set_draw_order().
|
|
// particular object. See set_draw_order().
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE int EggAlphaMode::
|
|
|
|
|
|
|
+INLINE int EggRenderMode::
|
|
|
get_draw_order() const {
|
|
get_draw_order() const {
|
|
|
return _draw_order;
|
|
return _draw_order;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: EggAlphaMode::has_draw_order
|
|
|
|
|
|
|
+// Function: EggRenderMode::has_draw_order
|
|
|
// Access: Public
|
|
// Access: Public
|
|
|
// Description: Returns true if the draw-order flag has been set for
|
|
// Description: Returns true if the draw-order flag has been set for
|
|
|
// this particular object. See set_draw_order().
|
|
// this particular object. See set_draw_order().
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE bool EggAlphaMode::
|
|
|
|
|
|
|
+INLINE bool EggRenderMode::
|
|
|
has_draw_order() const {
|
|
has_draw_order() const {
|
|
|
return _has_draw_order;
|
|
return _has_draw_order;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: EggAlphaMode::clear_draw_order
|
|
|
|
|
|
|
+// Function: EggRenderMode::clear_draw_order
|
|
|
// Access: Public
|
|
// Access: Public
|
|
|
// Description: Removes the draw-order flag from this particular
|
|
// Description: Removes the draw-order flag from this particular
|
|
|
// object. See set_draw_order().
|
|
// object. See set_draw_order().
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE void EggAlphaMode::
|
|
|
|
|
|
|
+INLINE void EggRenderMode::
|
|
|
clear_draw_order() {
|
|
clear_draw_order() {
|
|
|
_has_draw_order = false;
|
|
_has_draw_order = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: EggAlphaMode::set_bin
|
|
|
|
|
|
|
+// Function: EggRenderMode::set_bin
|
|
|
// Access: Public
|
|
// Access: Public
|
|
|
// Description: Sets the "bin" string for this particular object.
|
|
// Description: Sets the "bin" string for this particular object.
|
|
|
// This names a particular bin in which the object
|
|
// This names a particular bin in which the object
|
|
@@ -123,50 +187,50 @@ clear_draw_order() {
|
|
|
// CullTraverser) in use for this to work. See also
|
|
// CullTraverser) in use for this to work. See also
|
|
|
// set_draw_order().
|
|
// set_draw_order().
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE void EggAlphaMode::
|
|
|
|
|
|
|
+INLINE void EggRenderMode::
|
|
|
set_bin(const string &bin) {
|
|
set_bin(const string &bin) {
|
|
|
_bin = bin;
|
|
_bin = bin;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: EggAlphaMode::get_bin
|
|
|
|
|
|
|
+// Function: EggRenderMode::get_bin
|
|
|
// Access: Public
|
|
// Access: Public
|
|
|
// Description: Returns the bin name that has been set for this
|
|
// Description: Returns the bin name that has been set for this
|
|
|
// particular object, if any. See set_bin().
|
|
// particular object, if any. See set_bin().
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE string EggAlphaMode::
|
|
|
|
|
|
|
+INLINE string EggRenderMode::
|
|
|
get_bin() const {
|
|
get_bin() const {
|
|
|
return _bin;
|
|
return _bin;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: EggAlphaMode::has_bin
|
|
|
|
|
|
|
+// Function: EggRenderMode::has_bin
|
|
|
// Access: Public
|
|
// Access: Public
|
|
|
// Description: Returns true if a bin name has been set for this
|
|
// Description: Returns true if a bin name has been set for this
|
|
|
// particular object. See set_bin().
|
|
// particular object. See set_bin().
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE bool EggAlphaMode::
|
|
|
|
|
|
|
+INLINE bool EggRenderMode::
|
|
|
has_bin() const {
|
|
has_bin() const {
|
|
|
return !_bin.empty();
|
|
return !_bin.empty();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: EggAlphaMode::clear_bin
|
|
|
|
|
|
|
+// Function: EggRenderMode::clear_bin
|
|
|
// Access: Public
|
|
// Access: Public
|
|
|
// Description: Removes the bin name that was set for this particular
|
|
// Description: Removes the bin name that was set for this particular
|
|
|
// object. See set_bin().
|
|
// object. See set_bin().
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE void EggAlphaMode::
|
|
|
|
|
|
|
+INLINE void EggRenderMode::
|
|
|
clear_bin() {
|
|
clear_bin() {
|
|
|
_bin = string();
|
|
_bin = string();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: EggAlphaMode::Inequality Operator
|
|
|
|
|
|
|
+// Function: EggRenderMode::Inequality Operator
|
|
|
// Access: Public
|
|
// Access: Public
|
|
|
// Description:
|
|
// Description:
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE bool EggAlphaMode::
|
|
|
|
|
-operator != (const EggAlphaMode &other) const {
|
|
|
|
|
|
|
+INLINE bool EggRenderMode::
|
|
|
|
|
+operator != (const EggRenderMode &other) const {
|
|
|
return !(*this == other);
|
|
return !(*this == other);
|
|
|
}
|
|
}
|