LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::RenderTarget Class Referenceabstract

Render target interface. More...

#include <RenderTarget.h>

Inheritance diagram for LLGL::RenderTarget:
LLGL::RenderSystemChild LLGL::Interface LLGL::NonCopyable LLGL::SwapChain

Public Member Functions

virtual Extent2D GetResolution () const =0
 Returns the render target resolution.
virtual std::uint32_t GetSamples () const =0
 Returns the number of samples this render target was created with.
virtual std::uint32_t GetNumColorAttachments () const =0
 Returns the number of color attachments of this render target. This can also be zero.
virtual bool HasDepthAttachment () const =0
 Returns true if this render target has a depth or depth-stencil attachment.
virtual bool HasStencilAttachment () const =0
 Returns true if this render target has a stencil or depth-stencil attachment.
virtual const RenderPass * GetRenderPass () const =0
 Returns the RenderPass object this render target is associated with, or null if render passes are optional for the the render system.
Public Member Functions inherited from LLGL::RenderSystemChild
virtual void SetDebugName (const char *name)
 Sets the name of this class instance for debugging purposes.
Public Member Functions inherited from LLGL::Interface
virtual bool IsInstanceOf (int id) const
 Returns true if this object is an instance of the specified interface.
Public Member Functions inherited from LLGL::NonCopyable
 NonCopyable (const NonCopyable &)=delete
NonCopyable & operator= (const NonCopyable &)=delete
virtual ~NonCopyable ()=default

Protected Member Functions

void ValidateResolution (const Extent2D &attachmentResolution)
 Validates the specified attachment resolution for this render target.
void ValidateMipResolution (const Texture &texture, std::uint32_t mipLevel)
 Applies the resolution of the texture MIP level.
Protected Member Functions inherited from LLGL::NonCopyable
 NonCopyable ()=default

Detailed Description

Render target interface.

Remarks
A render target in the broader sense is a composition of Texture objects which can be specified as the destination for drawing operations. After a texture has been attached to a render target, its image content is undefined until something has been rendered into the render target. The only interface that inherits from this interface is SwapChain, a special case of render targets used to present the result on the screen.
See also
RenderSystem::CreateRenderTarget
CommandBuffer::BeginRenderPass
SwapChain

Member Function Documentation

◆ GetNumColorAttachments()

virtual std::uint32_t LLGL::RenderTarget::GetNumColorAttachments ( ) const
pure virtual

Returns the number of color attachments of this render target. This can also be zero.

Remarks
For a swap-chain, this will always be 1.
See also
SwapChain::GetColorFormat

Implemented in LLGL::SwapChain.

◆ GetRenderPass()

virtual const RenderPass * LLGL::RenderTarget::GetRenderPass ( ) const
pure virtual

Returns the RenderPass object this render target is associated with, or null if render passes are optional for the the render system.

Remarks
This is either the RenderPass object that was passed to the descriptor when this render target was created, or it is the default RenderPass object that was created by the render target itself.
See also
RenderTargetDescriptor::renderPass

◆ GetResolution()

virtual Extent2D LLGL::RenderTarget::GetResolution ( ) const
pure virtual

Returns the render target resolution.

Remarks
This is either determined by the resolution specified in the render target descriptor or swap-chain descriptor.
See also
SwapChain::ResizeBuffers
RenderTargetDescriptor::resolution
SwapChainDescriptor::resolution

Implemented in LLGL::SwapChain.

◆ GetSamples()

virtual std::uint32_t LLGL::RenderTarget::GetSamples ( ) const
pure virtual

Returns the number of samples this render target was created with.

Remarks
If a certain number of samples is not supported by the rendering API, LLGL will reduce the amount of samples. This function returns the actual number of samples the hardware object was created with.
See also
RenderTargetDescriptor::samples
SwapChainDescriptor::samples

◆ HasDepthAttachment()

virtual bool LLGL::RenderTarget::HasDepthAttachment ( ) const
pure virtual

Returns true if this render target has a depth or depth-stencil attachment.

Remarks
The return value depends on whether the rendering API supports depth-stencil formats where the depth and stencil components can be strictly separated. For example, if the render target was created with only a stencil attachment, LLGL may still create a depth-stencil buffer that results in both a depth and stencil component in one attachment.
See also
SwapChain::GetDepthStencilFormat

Implemented in LLGL::SwapChain.

◆ HasStencilAttachment()

virtual bool LLGL::RenderTarget::HasStencilAttachment ( ) const
pure virtual

Returns true if this render target has a stencil or depth-stencil attachment.

Remarks
The return value depends on whether the rendering API supports depth-stencil formats where the depth and stencil components can be strictly separated. For example, if the render target was created with only a stencil attachment, LLGL may still create a depth-stencil buffer that results in both a depth and stencil component in one attachment.
See also
SwapChain::GetDepthStencilFormat

Implemented in LLGL::SwapChain.

◆ ValidateMipResolution()

void LLGL::RenderTarget::ValidateMipResolution ( const Texture & texture,
std::uint32_t mipLevel )
protected

Applies the resolution of the texture MIP level.

See also
Texture::GetMipExtent
ValidateResolution

◆ ValidateResolution()

void LLGL::RenderTarget::ValidateResolution ( const Extent2D & attachmentResolution)
protected

Validates the specified attachment resolution for this render target.

Remarks
Throws an exception or aborts execution if the specified resolution is invalid.

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