libdonut
2.3.2
Application framework for cross-platform game development in C++20
|
Rectangular region of a framebuffer. More...
#include <donut/graphics/Viewport.hpp>
Static Public Member Functions | |
static constexpr std::pair< Viewport, int > | createIntegerScaled (ivec2 framebufferSize, ivec2 renderResolution) noexcept |
Create an integer-scaled viewport that fits into the middle of a framebuffer at the largest positive integer scale of an original render resolution that still fits within the framebuffer. More... | |
Public Attributes | |
ivec2 | position |
The offset of the viewport, in pixels, from the bottom left of the framebuffer. More... | |
ivec2 | size |
The width and height of the viewport, in pixels. More... | |
Rectangular region of a framebuffer.
|
inlinestaticconstexprnoexcept |
Create an integer-scaled viewport that fits into the middle of a framebuffer at the largest positive integer scale of an original render resolution that still fits within the framebuffer.
framebufferSize | the size of the framebuffer to fit the viewport into, in pixels. |
renderResolution | the original rendered size to be scaled into the framebuffer, in pixels. |
ivec2 donut::graphics::Viewport::position |
The offset of the viewport, in pixels, from the bottom left of the framebuffer.
ivec2 donut::graphics::Viewport::size |
The width and height of the viewport, in pixels.