ASGE
3.2.0
Simple Game Framework in GL
|
#include <Viewport.hpp>
Public Member Functions | |
Viewport ()=default | |
Viewport (int32_t xpos, int32_t ypos, int32_t width, int32_t height) | |
Public Attributes | |
int32_t | x = 0 |
int32_t | y = 0 |
int32_t | w = 0 |
int32_t | h = 0 |
Friends | |
bool | operator!= (const Viewport &rhs, const Viewport &lhs) |
A viewport controls the mapping of the rendered scene on to the destination target. The destination could be a ASGE::RenderTarget or the game window itself. For example you could create a viewport that only consumed half the render window and render a camera's view in to it. This could allow for more complex game scenes such as the use of split screens.
In the following example, the game screen is split into half (vertically) with one viewport on the left and the other on the right. A camera is then used to frame the action, before rendering the first sprite, shifting the viewport and then rendering the second sprite.
Definition at line 43 of file Viewport.hpp.
|
default |
Default constructor.
|
inline |
The constructor for a viewport, which uses the provided dimensions.
[in] | xpos | The position the X axis that the viewport should start. |
[in] | ypos | The position the Y axis that the viewport should start. |
[in] | width | The width of the viewport. |
[in] | height | The height of the viewport. |
Definition at line 57 of file Viewport.hpp.
int32_t ASGE::Viewport::h = 0 |
The height of the viewport
Definition at line 72 of file Viewport.hpp.
int32_t ASGE::Viewport::w = 0 |
The width of the viewport
Definition at line 71 of file Viewport.hpp.
int32_t ASGE::Viewport::x = 0 |
The starting X position
Definition at line 69 of file Viewport.hpp.
int32_t ASGE::Viewport::y = 0 |
The starting Y position
Definition at line 70 of file Viewport.hpp.