15 #define OSG_VIEWPORT 1
17 #include <osg/StateAttribute>
47 _height(vp._height) {}
69 if (&rhs==
this)
return *
this;
88 void getViewport(
int& x,
int& y,
int&
width,
int&
height)
const
96 void getViewport(
double& x,
double& y,
double&
width,
double&
height)
const
104 inline value_type&
x() {
return _x; }
105 inline value_type
x()
const {
return _x; }
107 inline value_type&
y() {
return _y; }
108 inline value_type
y()
const {
return _y; }
110 inline value_type&
width() {
return _width; }
111 inline value_type
width()
const {
return _width; }
113 inline value_type&
height() {
return _height; }
114 inline value_type
height()
const {
return _height; }
116 inline bool valid()
const {
return _width>0 && _height>0; }
121 inline double aspectRatio()
const {
if (_height!=0)
return (
double)_width/(double)_height;
else return 1.0; }
134 virtual void apply(
State& state)
const;
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
static Matrixd translate(const Vec3f &dv)
void setViewport(value_type x, value_type y, value_type width, value_type height)
const osg::Matrix computeWindowMatrix() const
value_type height() const
double aspectRatio() const
GLint GLenum GLsizei width
Viewport(value_type x, value_type y, value_type width, value_type height)
#define META_StateAttribute(library, name, type)
GLint GLenum GLsizei GLsizei height
static Matrixd scale(const Vec3f &sv)
#define COMPARE_StateAttribute_Parameter(parameter)
virtual int compare(const StateAttribute &sa) const
Viewport(const Viewport &vp, const CopyOp ©op=CopyOp::SHALLOW_COPY)