Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics
[Home] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Attributes

vl::Viewport Class Reference

Implements the viewport and clearing settings associated to a Camera. More...

#include <Viewport.hpp>

Inheritance diagram for vl::Viewport:
vl::Object

List of all members.

Public Member Functions

virtual const char * className ()
 Returns the name of the class.
 Viewport ()
 Viewport (int x, int y, int w, int h)
void activate () const
bool null ()
void set (int x, int y, int w, int h)
void setX (int x)
int x () const
void setY (int y)
int y () const
void setWidth (int width)
int width () const
void setHeight (int height)
int height () const
fvec2 center () const
RectI rect () const
 Returns the rectangular area that defines the viewport computed as RectI(x(), y(), x()+width()-1, y()+height()-1).
void setClearColor (float r, float g, float b, float a)
void setClearColor (const fvec4 &color)
const fvec4clearColor () const
void setClearColorInt (int r, int g, int b, int a)
void setClearColorInt (const ivec4 &color)
const ivec4clearColorInt () const
void setClearColorUInt (unsigned int r, unsigned int g, unsigned int b, unsigned int a)
void setClearColorUInt (const uvec4 &color)
const uvec4clearColorUInt () const
void setClearStencil (int stencil)
int clearStencil () const
void setClearDepth (Real depth)
Real clearDepth () const
void setClearFlags (EClearFlags clear_flags)
EClearFlags clearFlags () const
void setClearColorMode (EClearColorMode mode)
EClearColorMode clearColorMode () const
bool isPointInside (int x, int y, int render_target_height) const
 Returns true if the given point is inside the Viewport.

Protected Attributes

fvec4 mClearColor
ivec4 mClearColorInt
uvec4 mClearColorUInt
Real mClearDepth
int mClearStencil
EClearFlags mClearFlags
EClearColorMode mClearColorMode
int mX
int mY
int mWidth
int mHeight

Detailed Description

Implements the viewport and clearing settings associated to a Camera.

Supports glClearColor, glClearColorIiEXT and glClearColorIuiEXT (see GL_EXT_texture_integer).

See also:
Camera, Rendering, Renderer

Definition at line 51 of file Viewport.hpp.


Constructor & Destructor Documentation

Viewport::Viewport (  )
Viewport::Viewport ( int  x,
int  y,
int  w,
int  h 
)

Member Function Documentation

virtual const char* vl::Viewport::className (  ) [inline, virtual]

Returns the name of the class.

Reimplemented from vl::Object.

Definition at line 54 of file Viewport.hpp.

void Viewport::activate (  ) const
bool vl::Viewport::null (  ) [inline]

Definition at line 60 of file Viewport.hpp.

void vl::Viewport::set ( int  x,
int  y,
int  w,
int  h 
) [inline]

Definition at line 62 of file Viewport.hpp.

void vl::Viewport::setX ( int  x ) [inline]

Definition at line 63 of file Viewport.hpp.

int vl::Viewport::x (  ) const [inline]
void vl::Viewport::setY ( int  y ) [inline]

Definition at line 65 of file Viewport.hpp.

int vl::Viewport::y (  ) const [inline]
void vl::Viewport::setWidth ( int  width ) [inline]

Definition at line 67 of file Viewport.hpp.

Referenced by vl::Applet::resizeEvent().

int vl::Viewport::width (  ) const [inline]
void vl::Viewport::setHeight ( int  height ) [inline]

Definition at line 69 of file Viewport.hpp.

Referenced by vl::Applet::resizeEvent().

int vl::Viewport::height (  ) const [inline]
fvec2 vl::Viewport::center (  ) const [inline]
RectI vl::Viewport::rect (  ) const [inline]

Returns the rectangular area that defines the viewport computed as RectI(x(), y(), x()+width()-1, y()+height()-1).

Definition at line 76 of file Viewport.hpp.

Referenced by vl::Scissor::enable().

void vl::Viewport::setClearColor ( float  r,
float  g,
float  b,
float  a 
) [inline]

Definition at line 78 of file Viewport.hpp.

void vl::Viewport::setClearColor ( const fvec4 color ) [inline]

Definition at line 79 of file Viewport.hpp.

const fvec4& vl::Viewport::clearColor (  ) const [inline]

Definition at line 80 of file Viewport.hpp.

void vl::Viewport::setClearColorInt ( int  r,
int  g,
int  b,
int  a 
) [inline]

Definition at line 82 of file Viewport.hpp.

void vl::Viewport::setClearColorInt ( const ivec4 color ) [inline]

Definition at line 83 of file Viewport.hpp.

const ivec4& vl::Viewport::clearColorInt (  ) const [inline]

Definition at line 84 of file Viewport.hpp.

void vl::Viewport::setClearColorUInt ( unsigned int  r,
unsigned int  g,
unsigned int  b,
unsigned int  a 
) [inline]

Definition at line 86 of file Viewport.hpp.

void vl::Viewport::setClearColorUInt ( const uvec4 color ) [inline]

Definition at line 87 of file Viewport.hpp.

const uvec4& vl::Viewport::clearColorUInt (  ) const [inline]

Definition at line 88 of file Viewport.hpp.

void vl::Viewport::setClearStencil ( int  stencil ) [inline]

Definition at line 90 of file Viewport.hpp.

int vl::Viewport::clearStencil (  ) const [inline]

Definition at line 91 of file Viewport.hpp.

void vl::Viewport::setClearDepth ( Real  depth ) [inline]

Definition at line 93 of file Viewport.hpp.

Real vl::Viewport::clearDepth (  ) const [inline]

Definition at line 94 of file Viewport.hpp.

void vl::Viewport::setClearFlags ( EClearFlags  clear_flags ) [inline]

Definition at line 96 of file Viewport.hpp.

Referenced by vl::Renderer::render(), and vl::EdgeRenderer::render().

EClearFlags vl::Viewport::clearFlags (  ) const [inline]

Definition at line 97 of file Viewport.hpp.

void vl::Viewport::setClearColorMode ( EClearColorMode  mode ) [inline]

Definition at line 99 of file Viewport.hpp.

EClearColorMode vl::Viewport::clearColorMode (  ) const [inline]

Definition at line 100 of file Viewport.hpp.

Referenced by activate().

bool Viewport::isPointInside ( int  x,
int  y,
int  render_target_height 
) const

Returns true if the given point is inside the Viewport.

Definition at line 138 of file Viewport.cpp.

References height(), width(), x(), and y().


Member Data Documentation

Definition at line 108 of file Viewport.hpp.

Referenced by activate(), and Viewport().

Definition at line 109 of file Viewport.hpp.

Referenced by activate().

Definition at line 110 of file Viewport.hpp.

Referenced by activate().

Definition at line 112 of file Viewport.hpp.

Referenced by activate(), and Viewport().

int vl::Viewport::mClearStencil [protected]

Definition at line 113 of file Viewport.hpp.

Referenced by activate(), and Viewport().

Definition at line 114 of file Viewport.hpp.

Referenced by activate(), and Viewport().

Definition at line 115 of file Viewport.hpp.

Referenced by Viewport().

int vl::Viewport::mX [protected]

Definition at line 116 of file Viewport.hpp.

Referenced by activate(), and Viewport().

int vl::Viewport::mY [protected]

Definition at line 117 of file Viewport.hpp.

Referenced by activate(), and Viewport().

int vl::Viewport::mWidth [protected]

Definition at line 118 of file Viewport.hpp.

Referenced by activate(), and Viewport().

int vl::Viewport::mHeight [protected]

Definition at line 119 of file Viewport.hpp.

Referenced by activate(), and Viewport().


The documentation for this class was generated from the following files:

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:47.
Permission is granted to use this page to write and publish articles regarding Visualization Library.