Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents a rectangular axis-aligned portion of the screen which should be rendered to. More...
#include <omGraphicsViewport.h>
Public Member Functions | |
Viewport () | |
Create a new viewport which covers the entire framebuffer. More... | |
Viewport (Float width, Float height) | |
Create a new viewport with the specified width and height with lower left corner at (0,0). More... | |
Viewport (Float xMin, Float xMax, Float yMin, Float yMax) | |
Create a new viewport which uses the area defined by the given min and max coordinates for each axis. More... | |
Viewport (const Vector2f &min, const Vector2f &max) | |
Create a new viewport which uses the specified minimum and maximum points to define its bounds. More... | |
Viewport (const AABB2f &newBounds) | |
Create a new viewport which uses the specified 2D axis-aligned box to define its bounds. More... | |
Real | getWidth () const |
Return the width of this viewport as a fraction of the framebuffer's width. More... | |
Real | getHeight () const |
Return the height of this viewport as a fraction of the framebuffer's height. More... | |
Vector2f | getSize () const |
Return the 2D size of this viewport as a fraction of the framebuffer's width and height. More... | |
Real | getAspectRatio () const |
Return the aspect ratio of this viewport (width/height). More... | |
Vector2f | getPosition () const |
Return the position of this viewport's lower left corner on the framebuffer. More... | |
operator const AABB2f & () const | |
Convert this viewport to a 2D axis-aligned bounding box representing the viewport's bounds. More... | |
const AABB2f & | getBounds () const |
Return a 2D axis-aligned bounding box representing the bounds of this viewport. More... | |
void | setBounds (const AABB2f &newBounds) |
Set a 2D axis-aligned bounding box representing the bounds of this viewport. More... | |
Bool | operator== (const Viewport &other) const |
Return whether or not this viewport is exactly the same as another. More... | |
Bool | operator!= (const Viewport &other) const |
Return whether or not this viewport is diferent than another. More... | |
A class that represents a rectangular axis-aligned portion of the screen which should be rendered to.
During rendering, all output is rendered to only the area of the framebuffer specified by the current viewport, the rest is clipped to the outer edge of the viewport. This viewport is given in terms of a rectangular axis-aligned region where (0,0) is the lower left corner of the framebuffer, and (1,1) is the upper-right corner of the framebuffer.
|
inline |
Create a new viewport which covers the entire framebuffer.
Create a new viewport with the specified width and height with lower left corner at (0,0).
Create a new viewport which uses the area defined by the given min and max coordinates for each axis.
Create a new viewport which uses the specified minimum and maximum points to define its bounds.
|
inline |
Create a new viewport which uses the specified 2D axis-aligned box to define its bounds.
|
inline |
Return the width of this viewport as a fraction of the framebuffer's width.
|
inline |
Return the height of this viewport as a fraction of the framebuffer's height.
|
inline |
Return the 2D size of this viewport as a fraction of the framebuffer's width and height.
|
inline |
Return the aspect ratio of this viewport (width/height).
|
inline |
Return the position of this viewport's lower left corner on the framebuffer.
|
inline |
Convert this viewport to a 2D axis-aligned bounding box representing the viewport's bounds.
|
inline |
Return a 2D axis-aligned bounding box representing the bounds of this viewport.
|
inline |
Set a 2D axis-aligned bounding box representing the bounds of this viewport.
Return whether or not this viewport is exactly the same as another.
Return whether or not this viewport is diferent than another.