XII Release 0.1.0
Loading...
Searching...
No Matches
xiiClipSpaceYMode Struct Reference

#include <Declarations.h>

Public Types

enum  Enum { Regular , Flipped }

Static Public Attributes

static XII_FOUNDATION_DLL Enum RenderToTextureDefault = xiiClipSpaceYMode::Regular

Detailed Description

Specifies whether a projection matrix should flip the result along the Y axis or not.

Mostly needed to compensate for differing Y texture coordinate conventions. Ie. on some platforms the Y texture coordinate origin is at the lower left and on others on the upper left. To prevent having to modify content to compensate, instead textures are simply flipped along Y on texture load. The same has to be done for all render targets, ie. content has to be rendered upside-down.

Use xiiClipSpaceYMode::RenderToTextureDefault when rendering to a texture, to always get the correct projection matrix.

Member Enumeration Documentation

◆ Enum

Enumerator
Regular 

Creates a regular projection matrix.

Flipped 

Creates a projection matrix that flips the image on its head. On platforms with different Y texture coordinate conventions, this can be used to compensate, by rendering images flipped to render targets.

Member Data Documentation

◆ RenderToTextureDefault

xiiClipSpaceYMode::Enum xiiClipSpaceYMode::RenderToTextureDefault = xiiClipSpaceYMode::Regular
static

Holds the platform default value for the clip space Y mode when rendering to a texture. This can be overridden by renderers to ensure the proper mode is used when they become active. On Windows/D3D this is initialized with 'Regular' by default on all other platforms/OpenGL it is initialized with 'Flipped' by default.


The documentation for this struct was generated from the following files:
  • /home/runner/work/XII/XII/Source/Engine/Foundation/Math/Declarations.h
  • /home/runner/work/XII/XII/Source/Engine/Foundation/Math/Implementation/Math.cpp