LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::Viewport Struct Reference

Viewport dimensions. More...

#include <PipelineStateFlags.h>

Public Member Functions

 Viewport ()=default
 Viewport (float x, float y, float width, float height)
 Viewport constructor with default depth range of [0, 1].
 Viewport (float x, float y, float width, float height, float minDepth, float maxDepth)
 Viewport constructor with parameters for all attributes.
 Viewport (const Extent2D &extent)
 Viewport constructor with extent and default depth range of [0, 1].
 Viewport (const Extent2D &extent, float minDepth, float maxDepth)
 Viewport constructor with extent and explicit depth range.
 Viewport (const Offset2D &offset, const Extent2D &extent)
 Viewport constructor with offset, extent, and default depth range of [0, 1].
 Viewport (const Offset2D &offset, const Extent2D &extent, float minDepth, float maxDepth)
 Viewport constructor with offset, extent, and explicit depth range.

Public Attributes

float x = 0.0f
 Y coordinate of the left-top origin. By default 0.0.
float y = 0.0f
float width = 0.0f
 Width of the right-bottom size. By default 0.0.
float height = 0.0f
 Height of the right-bottom size. By default 0.0.
float minDepth = 0.0f
 Minimum of the depth range. Must be in the range [0, 1]. By default 0.0.
float maxDepth = 1.0f
 Maximum of the depth range. Must be in the range [0, 1]. By default 1.0.

Detailed Description

Viewport dimensions.

Remarks
A viewport is in screen coordinates where the origin is in the left-top corner.
See also
CommandBuffer::SetViewport
CommandBuffer::SetViewports
GraphicsPipelineDescriptor::viewports

Constructor & Destructor Documentation

◆ Viewport() [1/7]

LLGL::Viewport::Viewport ( )
default

◆ Viewport() [2/7]

LLGL::Viewport::Viewport ( float x,
float y,
float width,
float height )
inline

Viewport constructor with default depth range of [0, 1].

◆ Viewport() [3/7]

LLGL::Viewport::Viewport ( float x,
float y,
float width,
float height,
float minDepth,
float maxDepth )
inline

Viewport constructor with parameters for all attributes.

◆ Viewport() [4/7]

LLGL::Viewport::Viewport ( const Extent2D & extent)
inline

Viewport constructor with extent and default depth range of [0, 1].

◆ Viewport() [5/7]

LLGL::Viewport::Viewport ( const Extent2D & extent,
float minDepth,
float maxDepth )
inline

Viewport constructor with extent and explicit depth range.

◆ Viewport() [6/7]

LLGL::Viewport::Viewport ( const Offset2D & offset,
const Extent2D & extent )
inline

Viewport constructor with offset, extent, and default depth range of [0, 1].

◆ Viewport() [7/7]

LLGL::Viewport::Viewport ( const Offset2D & offset,
const Extent2D & extent,
float minDepth,
float maxDepth )
inline

Viewport constructor with offset, extent, and explicit depth range.

X coordinate of the left-top origin. By default 0.0.

Member Data Documentation

◆ height

float LLGL::Viewport::height = 0.0f

Height of the right-bottom size. By default 0.0.

Remarks
Setting a viewport of negative height results in undefined behavior.

◆ maxDepth

float LLGL::Viewport::maxDepth = 1.0f

Maximum of the depth range. Must be in the range [0, 1]. By default 1.0.

Remarks
Reverse mappings such as minDepth=1 and maxDepth=0 are also valid.

◆ minDepth

float LLGL::Viewport::minDepth = 0.0f

Minimum of the depth range. Must be in the range [0, 1]. By default 0.0.

Remarks
Reverse mappings such as minDepth=1 and maxDepth=0 are also valid.

◆ width

float LLGL::Viewport::width = 0.0f

Width of the right-bottom size. By default 0.0.

Remarks
Setting a viewport of negative width results in undefined behavior.

◆ x

float LLGL::Viewport::x = 0.0f

Y coordinate of the left-top origin. By default 0.0.

◆ y

float LLGL::Viewport::y = 0.0f

The documentation for this struct was generated from the following file: