Encapsulate OpenGL glViewport.
More...
List of all members.
Public Types |
typedef double | value_type |
Public Member Functions |
| Viewport () |
| Viewport (value_type x, value_type y, value_type width, value_type height) |
| Viewport (const Viewport &vp, const CopyOp ©op=CopyOp::SHALLOW_COPY) |
| Copy constructor using CopyOp to manage deep vs shallow copy.
|
| META_StateAttribute (osg, Viewport, VIEWPORT) |
virtual int | compare (const StateAttribute &sa) const |
| Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
|
void | setViewport (value_type x, value_type y, value_type width, value_type height) |
value_type & | x () |
value_type | x () const |
value_type & | y () |
value_type | y () const |
value_type & | width () |
value_type | width () const |
value_type & | height () |
value_type | height () const |
bool | valid () const |
double | aspectRatio () const |
| Return the aspectRatio of the viewport, which is equal to width/height.
|
const osg::Matrix | computeWindowMatrix () const |
| Compute the Window Matrix which takes projected coords into Window coordinates.
|
virtual void | apply (State &state) const |
| apply the OpenGL state attributes.
|
Protected Member Functions |
virtual | ~Viewport () |
Protected Attributes |
value_type | _x |
value_type | _y |
value_type | _width |
value_type | _height |
Detailed Description
Encapsulate OpenGL glViewport.
Member Typedef Documentation
Constructor & Destructor Documentation
osg::Viewport::Viewport |
( |
|
) |
|
osg::Viewport::Viewport |
( |
const Viewport & |
vp, |
|
|
const CopyOp & |
copyop = CopyOp::SHALLOW_COPY | |
|
) |
| | [inline] |
Copy constructor using CopyOp to manage deep vs shallow copy.
virtual osg::Viewport::~Viewport |
( |
|
) |
[protected, virtual] |
Member Function Documentation
virtual void osg::Viewport::apply |
( |
State & |
|
) |
const [virtual] |
apply the OpenGL state attributes.
The render info for the current OpenGL context is passed in to allow the StateAttribute to obtain details on the the current context and state.
Reimplemented from osg::StateAttribute.
double osg::Viewport::aspectRatio |
( |
|
) |
const [inline] |
Return the aspectRatio of the viewport, which is equal to width/height.
If height is zero, the potential division by zero is avoided by simply returning 1.0f.
virtual int osg::Viewport::compare |
( |
const StateAttribute & |
sa |
) |
const [inline, virtual] |
const osg::Matrix osg::Viewport::computeWindowMatrix |
( |
|
) |
const [inline] |
value_type osg::Viewport::height |
( |
|
) |
const [inline] |
osg::Viewport::META_StateAttribute |
( |
osg |
, |
|
|
Viewport |
, |
|
|
VIEWPORT |
| |
|
) |
| | |
bool osg::Viewport::valid |
( |
|
) |
const [inline] |
value_type osg::Viewport::width |
( |
|
) |
const [inline] |
Member Data Documentation
The documentation for this class was generated from the following file: