#include <sglStatelet.hpp>
Inheritance diagram for sglPolygonOffset::
Public Methods | |
sglPolygonOffset (float factor=0, float units=0) | |
virtual | ~sglPolygonOffset () |
void | setPolygonOffset (float factor, float units) |
void | getPolygonOffset (float &factor, float &units) const |
bool | getPolygonOffsetFlag () const |
void | apply (sglCurrState *curr_state) const |
virtual bool | getSorted () const |
virtual void | printInfo (ostream &ostrm, const char *indent_string) const |
offset = m * factor + r * unitswhere (according to the OpenGL Red Book) "m is the maximum depth slope of the polygon and r is the smallest value guaranteed to produce a resolvable difference in the window coordinate depth values." The factor and units are provided by this class. When factor and units are set to zero, that disables the polygon offset. When either is non-zero then polygon offset will be enabled for POINTS, LINES, and FILLed polygon modes.
Note that this statelet enables polygon offset for polygons in fill, line, and point mode.
Example:
sglPolygonOffset *po = new sglPolygonOffset; // disabled by default po->setPolygonOffset(1.0, 1.0); // pushes polygons farther.
Definition at line 1917 of file sglStatelet.hpp.
|
Constructor (also the default constructor). If both parameters are set to zero then polygon offset is disabled.
Definition at line 1928 of file sglStatelet.hpp. |
|
virtual destructor.
Definition at line 1933 of file sglStatelet.hpp. |
|
Set the polygon offset parameters. If both parameters are set to zero then polygon offset is disabled.
Referenced by sglPolygonOffset(). |
|
Query the polygon offset parameters.
Definition at line 1948 of file sglStatelet.hpp. |
|
Query whether or not polygon offset is enable (it compares the two parameters to zero as a convenience to the user).
Definition at line 1958 of file sglStatelet.hpp. |
|
Apply this state change to the current rendering state.
Reimplemented from sglStatelet. |
|
Query the sorting mode for this statelet.
Reimplemented from sglStatelet. Definition at line 1964 of file sglStatelet.hpp. |
|
Output the state of this node to the specified ostream.
Reimplemented from sglStatelet. |