Visualization Library v1.0.3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [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

 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)
 Usually you want to use rather RendererAbstract::setClearFlags()
EClearFlags clearFlags () const
void setClearColorMode (EClearColorMode mode)
EClearColorMode clearColorMode () const
bool isPointInside (int x, int y, int framebuffer_height) const
 Returns true if the given point is inside the Viewport.
void enableScissorSetup (bool enable)
 If scissor setup is enabled (by default it is), then glScissor is called during activate().

Protected Attributes

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

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

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

Definition at line 61 of file Viewport.hpp.

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

Definition at line 63 of file Viewport.hpp.

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

Definition at line 64 of file Viewport.hpp.

Referenced by vl::VLXClassWrapper_Viewport::importViewport().

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

Definition at line 66 of file Viewport.hpp.

Referenced by vl::VLXClassWrapper_Viewport::importViewport().

int vl::Viewport::y (  ) const [inline]
void vl::Viewport::setWidth ( int  width ) [inline]
int vl::Viewport::width (  ) const [inline]
void vl::Viewport::setHeight ( int  height ) [inline]
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 77 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 79 of file Viewport.hpp.

Referenced by vl::VLXClassWrapper_Viewport::importViewport().

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

Definition at line 80 of file Viewport.hpp.

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

Definition at line 81 of file Viewport.hpp.

Referenced by vl::VLXClassWrapper_Viewport::exportViewport().

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

Definition at line 83 of file Viewport.hpp.

Referenced by vl::VLXClassWrapper_Viewport::importViewport().

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

Definition at line 84 of file Viewport.hpp.

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

Definition at line 85 of file Viewport.hpp.

Referenced by vl::VLXClassWrapper_Viewport::exportViewport().

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

Definition at line 87 of file Viewport.hpp.

Referenced by vl::VLXClassWrapper_Viewport::importViewport().

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

Definition at line 88 of file Viewport.hpp.

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

Definition at line 89 of file Viewport.hpp.

Referenced by vl::VLXClassWrapper_Viewport::exportViewport().

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

Definition at line 91 of file Viewport.hpp.

Referenced by vl::VLXClassWrapper_Viewport::importViewport().

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

Definition at line 92 of file Viewport.hpp.

Referenced by vl::VLXClassWrapper_Viewport::exportViewport().

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

Definition at line 94 of file Viewport.hpp.

Referenced by vl::VLXClassWrapper_Viewport::importViewport().

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

Definition at line 95 of file Viewport.hpp.

Referenced by vl::VLXClassWrapper_Viewport::exportViewport().

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

Definition at line 99 of file Viewport.hpp.

Referenced by vl::VLXClassWrapper_Viewport::exportViewport().

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

Definition at line 101 of file Viewport.hpp.

Referenced by vl::VLXClassWrapper_Viewport::importViewport().

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

Definition at line 102 of file Viewport.hpp.

Referenced by activate(), and vl::VLXClassWrapper_Viewport::exportViewport().

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

Returns true if the given point is inside the Viewport.

Definition at line 152 of file Viewport.cpp.

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

void Viewport::enableScissorSetup ( bool  enable )

If scissor setup is enabled (by default it is), then glScissor is called during activate().

Definition at line 166 of file Viewport.cpp.

References mSetupScissor.


Member Data Documentation

Definition at line 116 of file Viewport.hpp.

Referenced by activate(), and Viewport().

Definition at line 117 of file Viewport.hpp.

Referenced by activate().

Definition at line 118 of file Viewport.hpp.

Referenced by activate().

Definition at line 120 of file Viewport.hpp.

Referenced by activate(), and Viewport().

int vl::Viewport::mClearStencil [protected]

Definition at line 121 of file Viewport.hpp.

Referenced by activate(), and Viewport().

Definition at line 122 of file Viewport.hpp.

Referenced by activate(), and Viewport().

Definition at line 123 of file Viewport.hpp.

Referenced by Viewport().

int vl::Viewport::mX [protected]

Definition at line 124 of file Viewport.hpp.

Referenced by activate(), and Viewport().

int vl::Viewport::mY [protected]

Definition at line 125 of file Viewport.hpp.

Referenced by activate(), and Viewport().

int vl::Viewport::mWidth [protected]

Definition at line 126 of file Viewport.hpp.

Referenced by activate(), and Viewport().

int vl::Viewport::mHeight [protected]

Definition at line 127 of file Viewport.hpp.

Referenced by activate(), and Viewport().

bool vl::Viewport::mSetupScissor [protected]

Definition at line 129 of file Viewport.hpp.

Referenced by activate(), enableScissorSetup(), and Viewport().


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

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:12.
Permission is granted to use this page to write and publish articles regarding Visualization Library.