renderstack::viewport Class Reference

simple rectangle used to specify gl viewport

#include <viewport.hpp>

Public Member Functions

 viewport (int x=0, int y=0, int width=0, int height=0)
void set (int x, int y, int width, int height)
int border () const
float x () const
float y () const
float width () const
float height () const
float aspect_ratio () const

Detailed Description

Definition at line 35 of file viewport.hpp.


Constructor & Destructor Documentation

renderstack::viewport::viewport ( int  x = 0,
int  y = 0,
int  width = 0,
int  height = 0 
)

Definition at line 31 of file viewport.cpp.

00032 {
00033     set(x, y, width, height);
00034 }


Member Function Documentation

void renderstack::viewport::set ( int  x,
int  y,
int  width,
int  height 
)

Definition at line 36 of file viewport.cpp.

00037 {
00038     m_border        = 0;
00039     m_x             = (float)(x);
00040     m_y             = (float)(y);
00041     m_width         = (float)(width);
00042     m_height        = (float)(height);
00043     m_aspect_ratio  = (height != 0) ? (float)(width) / (float)(height) : 1.0f;
00044 }

int renderstack::viewport::border (  )  const [inline]

Definition at line 43 of file viewport.hpp.

00043 { return m_border; }

float renderstack::viewport::x (  )  const [inline]

Definition at line 44 of file viewport.hpp.

00044 { return m_x; }

float renderstack::viewport::y (  )  const [inline]

Definition at line 45 of file viewport.hpp.

00045 { return m_y; }

float renderstack::viewport::width (  )  const [inline]

Definition at line 46 of file viewport.hpp.

00046 { return m_width; }

float renderstack::viewport::height (  )  const [inline]

Definition at line 47 of file viewport.hpp.

00047 { return m_height; }

float renderstack::viewport::aspect_ratio (  )  const [inline]

Definition at line 48 of file viewport.hpp.

00048 { return m_aspect_ratio; }


The documentation for this class was generated from the following files:
Generated on Sun Apr 11 12:23:12 2010 for RenderStack by  doxygen 1.6.3