GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
Viewport.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Ivar Härnqvist
2// SPDX-License-Identifier: MIT
3
4#ifndef GREM_GRAPHICS_VIEWPORT_HPP
5#define GREM_GRAPHICS_VIEWPORT_HPP
6
8
10#include <GREM/core/extents.hpp>
12
13namespace grem::graphics {
14
18class Viewport {
19public:
23 Region2D region{.size{1, 1}};
24
30 float minDepth = 0.0f;
31
37 float maxDepth = 1.0f;
38
44
52 [[nodiscard]] bool operator==(const Viewport& other) const = default;
53};
54
55} // namespace grem::graphics
56
57#endif
Optional value type that holds either a value or no value.
Definition Optional.hpp:58
Region of a render target.
Definition Viewport.hpp:18
Optional< Region2D > scissor
Optional rectangular scissor region, outside of which any attempts to render a pixel will be discarde...
Definition Viewport.hpp:43
bool operator==(const Viewport &other) const =default
Compare this viewport to another for equality.
float minDepth
Minimum depth value in the depth range of the viewport.
Definition Viewport.hpp:30
float maxDepth
Maximum depth value in the depth range of the viewport.
Definition Viewport.hpp:37
Region2D region
Rectangular region of the viewport in the render target, in pixels.
Definition Viewport.hpp:23
Definition buffer_layouts.hpp:20
Region< 2 > Region2D
Rectangular region of 2D data.
Definition extents.hpp:819