API Documentation
Public Member Functions | Static Public Member Functions | List of all members
nkGraphics::Viewport Class Referenceabstract

Holds all the information needed about a viewport. More...

Public Member Functions

virtual ~Viewport ()
 
virtual float getWidth () const =0
 
virtual float getHeight () const =0
 
virtual float getMinDepth () const =0
 
virtual float getMaxDepth () const =0
 
virtual float getTopLeftX () const =0
 
virtual float getTopLeftY () const =0
 
virtual nkMemory::StringView getName () const
 
virtual bool getDirtyViewport () const
 
virtual void setWidth (float width)=0
 
virtual void setHeight (float height)=0
 
virtual void setMinDepth (float value)=0
 
virtual void setMaxDepth (float value)=0
 
virtual void setTopLeftX (float value)=0
 
virtual void setTopLeftY (float value)=0
 
virtual void setName (nkMemory::StringView name)
 
virtual void setDirtyViewport (bool value)
 

Static Public Member Functions

static nkMemory::UniquePtr< Viewportcreate (System *system=nullptr)
 

Detailed Description

Holds all the information needed about a viewport.

See ViewportManager::createOrRetrieve() or Viewport::create() for instantiation.

Constructor & Destructor Documentation

◆ ~Viewport()

virtual nkGraphics::Viewport::~Viewport ( )
virtual

Destructor.

Member Function Documentation

◆ getWidth()

virtual float nkGraphics::Viewport::getWidth ( ) const
pure virtual
Returns
The width of the viewport.

◆ getHeight()

virtual float nkGraphics::Viewport::getHeight ( ) const
pure virtual
Returns
The height of the viewport.

◆ getMinDepth()

virtual float nkGraphics::Viewport::getMinDepth ( ) const
pure virtual
Returns
The min depth of the viewport.

◆ getMaxDepth()

virtual float nkGraphics::Viewport::getMaxDepth ( ) const
pure virtual
Returns
The max depth of the viewport.

◆ getTopLeftX()

virtual float nkGraphics::Viewport::getTopLeftX ( ) const
pure virtual
Returns
The top left x of the viewport.

◆ getTopLeftY()

virtual float nkGraphics::Viewport::getTopLeftY ( ) const
pure virtual
Returns
The top left y of the viewport.

◆ getName()

virtual nkMemory::StringView nkGraphics::Viewport::getName ( ) const
virtual
Returns
The name of the viewport.

◆ getDirtyViewport()

virtual bool nkGraphics::Viewport::getDirtyViewport ( ) const
virtual
Returns
Whether the viewport is dirty (true) or not (false).

◆ setWidth()

virtual void nkGraphics::Viewport::setWidth ( float  width)
pure virtual

Sets the width wanted for the viewport.

Parameters
widthThe width wanted, in pixels.

◆ setHeight()

virtual void nkGraphics::Viewport::setHeight ( float  height)
pure virtual

Sets the height wanted for the viewport.

Parameters
heightThe height wanted, in pixels.

◆ setMinDepth()

virtual void nkGraphics::Viewport::setMinDepth ( float  value)
pure virtual

Sets the min depth for the viewport.

Parameters
valueThe min depth the viewport should hold, between [0, 1].

◆ setMaxDepth()

virtual void nkGraphics::Viewport::setMaxDepth ( float  value)
pure virtual

Sets the max depth for the viewport.

Parameters
valueThe max depth the viewport should hold, between [0, 1].

◆ setTopLeftX()

virtual void nkGraphics::Viewport::setTopLeftX ( float  value)
pure virtual

Sets the top left x of the viewport.

Parameters
valueThe top left x of the viewport, in pixels.

◆ setTopLeftY()

virtual void nkGraphics::Viewport::setTopLeftY ( float  value)
pure virtual

Sets the top left y of the viewport.

Parameters
valueThe top left y of the viewport, in pixels.

◆ setName()

virtual void nkGraphics::Viewport::setName ( nkMemory::StringView  name)
virtual

Sets the name of the viewport.

Parameters
nameThe name to attach.

◆ setDirtyViewport()

virtual void nkGraphics::Viewport::setDirtyViewport ( bool  value)
virtual

Sets whether the viewport has to be considered dirty and needs an update.

Parameters
valueIf an update is needed (true) or not (false).

◆ create()

static nkMemory::UniquePtr<Viewport> nkGraphics::Viewport::create ( System *  system = nullptr)
static

Creates a standalone resource, linking it to a system, but no manager. This method can be used to allocate a resource and manually manage its lifetime.

Parameters
systemThe system to create the resource into. If left to nullptr, then the Singleton instance will be used.
Returns
The created resource instance.

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