Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Implements the viewport and clearing settings associated to a Camera. More...
#include <Viewport.hpp>
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 fvec4 & | clearColor () const |
| void | setClearColorInt (int r, int g, int b, int a) |
| void | setClearColorInt (const ivec4 &color) |
| const ivec4 & | clearColorInt () const |
| void | setClearColorUInt (unsigned int r, unsigned int g, unsigned int b, unsigned int a) |
| void | setClearColorUInt (const uvec4 &color) |
| const uvec4 & | clearColorUInt () 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 |
Implements the viewport and clearing settings associated to a Camera.
Supports glClearColor, glClearColorIiEXT and glClearColorIuiEXT (see GL_EXT_texture_integer).
Definition at line 51 of file Viewport.hpp.
| Viewport::Viewport | ( | ) |
Definition at line 42 of file Viewport.cpp.
References vl::CCM_Float, vl::CF_CLEAR_COLOR_DEPTH, mClearColor, mClearColorMode, mClearDepth, mClearFlags, mClearStencil, mHeight, mSetupScissor, mWidth, mX, mY, and VL_DEBUG_SET_OBJECT_NAME.
| Viewport::Viewport | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h | ||
| ) |
Definition at line 57 of file Viewport.cpp.
References vl::CCM_Float, vl::CF_CLEAR_COLOR_DEPTH, mClearColor, mClearColorMode, mClearDepth, mClearFlags, mClearStencil, mHeight, mSetupScissor, mWidth, mX, mY, VL_DEBUG_SET_OBJECT_NAME, x(), and y().
| void Viewport::activate | ( | ) | const |
Definition at line 72 of file Viewport.cpp.
References vl::Vector4< T_Scalar >::a(), vl::Vector4< T_Scalar >::b(), vl::Log::bug(), vl::CCM_Float, vl::CCM_Int, vl::CCM_UInt, clearColorMode(), vl::Vector4< T_Scalar >::g(), mClearColor, mClearColorInt, mClearColorUInt, mClearDepth, mClearFlags, mClearStencil, mHeight, mSetupScissor, mWidth, mX, mY, vl::Vector4< T_Scalar >::r(), VL_CHECK_OGL, x(), and y().
Referenced by vl::Renderer::render(), and vl::EdgeRenderer::render().
| 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] |
Definition at line 65 of file Viewport.hpp.
Referenced by activate(), vl::Text::boundingRectTransformed(), vl::PixelLODEvaluator::evaluate(), vl::VLXClassWrapper_Viewport::exportViewport(), isPointInside(), vl::TrackballManipulator::mouseDownEvent(), vl::FlatManipulator::mouseInViewport(), vl::TrackballManipulator::mouseMoveEvent(), vl::Renderer::render(), vl::DrawPixels::render_Implementation(), vl::Clear::render_Implementation(), vl::OcclusionCullRenderer::render_pass2(), vl::Text::renderBackground(), vl::Text::renderBorder(), vl::Text::renderText(), and Viewport().
| 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] |
Definition at line 67 of file Viewport.hpp.
Referenced by activate(), vl::Text::boundingRectTransformed(), vl::GhostCameraManipulator::enableEvent(), vl::PixelLODEvaluator::evaluate(), vl::VLXClassWrapper_Viewport::exportViewport(), isPointInside(), vl::TrackballManipulator::mouseDownEvent(), vl::FlatManipulator::mouseInViewport(), vl::TrackballManipulator::mouseMoveEvent(), vl::GhostCameraManipulator::mouseMoveEvent(), vl::Renderer::render(), vl::DrawPixels::render_Implementation(), vl::Clear::render_Implementation(), vl::OcclusionCullRenderer::render_pass2(), vl::Text::renderBackground(), vl::Text::renderBorder(), vl::Text::renderText(), and Viewport().
| void vl::Viewport::setWidth | ( | int | width ) | [inline] |
Definition at line 68 of file Viewport.hpp.
Referenced by vl::VLXClassWrapper_Viewport::importViewport(), and vl::Applet::resizeEvent().
| int vl::Viewport::width | ( | ) | const [inline] |
Definition at line 69 of file Viewport.hpp.
Referenced by vl::Text::boundingRectTransformed(), vl::TrackballManipulator::computeVector(), vl::PixelLODEvaluator::evaluate(), vl::VLXClassWrapper_Viewport::exportViewport(), isPointInside(), vl::TrackballManipulator::mouseDownEvent(), vl::FlatManipulator::mouseDownEvent(), vl::Renderer::render(), vl::DrawPixels::render_Implementation(), vl::Clear::render_Implementation(), vl::OcclusionCullRenderer::render_pass2(), vl::Text::renderBackground(), vl::Text::renderBorder(), vl::Text::renderText(), and vl::Camera::setProjectionOrtho().
| void vl::Viewport::setHeight | ( | int | height ) | [inline] |
Definition at line 70 of file Viewport.hpp.
Referenced by vl::VLXClassWrapper_Viewport::importViewport(), and vl::Applet::resizeEvent().
| int vl::Viewport::height | ( | ) | const [inline] |
Definition at line 71 of file Viewport.hpp.
Referenced by vl::Text::boundingRectTransformed(), vl::TrackballManipulator::computeVector(), vl::GhostCameraManipulator::enableEvent(), vl::PixelLODEvaluator::evaluate(), vl::VLXClassWrapper_Viewport::exportViewport(), isPointInside(), vl::TrackballManipulator::mouseDownEvent(), vl::FlatManipulator::mouseDownEvent(), vl::TrackballManipulator::mouseMoveEvent(), vl::GhostCameraManipulator::mouseMoveEvent(), vl::Renderer::render(), vl::DrawPixels::render_Implementation(), vl::Clear::render_Implementation(), vl::OcclusionCullRenderer::render_pass2(), vl::Text::renderBackground(), vl::Text::renderBorder(), vl::Text::renderText(), and vl::Camera::setProjectionOrtho().
| fvec2 vl::Viewport::center | ( | ) | const [inline] |
Definition at line 72 of file Viewport.hpp.
Referenced by vl::GhostCameraManipulator::enableEvent(), and vl::GhostCameraManipulator::mouseMoveEvent().
| 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] |
Usually you want to use rather RendererAbstract::setClearFlags()
Definition at line 98 of file Viewport.hpp.
Referenced by vl::VLXClassWrapper_Viewport::importViewport(), vl::Renderer::render(), and vl::EdgeRenderer::render().
| 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 |
| 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.
fvec4 vl::Viewport::mClearColor [protected] |
Definition at line 116 of file Viewport.hpp.
Referenced by activate(), and Viewport().
ivec4 vl::Viewport::mClearColorInt [protected] |
Definition at line 117 of file Viewport.hpp.
Referenced by activate().
uvec4 vl::Viewport::mClearColorUInt [protected] |
Definition at line 118 of file Viewport.hpp.
Referenced by activate().
real vl::Viewport::mClearDepth [protected] |
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().
EClearFlags vl::Viewport::mClearFlags [protected] |
Definition at line 122 of file Viewport.hpp.
Referenced by activate(), and Viewport().
EClearColorMode vl::Viewport::mClearColorMode [protected] |
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().