kanzi::Framebuffer::CreateInfo Struct Reference

Framebuffer creation parameters. More...

#include <kanzi/core.ui/platform/graphics_backend/gl/framebuffer.hpp>

Public Types

enum  Status {
  StatusMissingColorAttachments, StatusMultipleRenderTargetsNotSupported, StatusAttachmentUnsupportedFormat, StatusInvalidFace,
  StatusInvalidMipmapLevel, StatusInvalidUsage, StatusSampleCountMismatch, StatusValid
}
 Status of Framebuffer creation parameters, returned as result of validate(). More...
 

Public Member Functions

 CreateInfo (Surface::Usage usage)
 
void setAttachment (AttachmentPoint attachmentPoint, const Attachment &attachment)
 Set attachment, cloning existing attachment. More...
 
void setAttachment (AttachmentPoint attachmentPoint, SurfaceSharedPtr surface)
 Set attachment for specified attachment point. More...
 
void setAttachment (AttachmentPoint attachmentPoint, TextureSharedPtr texture, unsigned int mipmapLevel)
 Set attachment for specified attachment point. More...
 
void setAttachment (AttachmentPoint attachmentPoint, TextureSharedPtr texture, Surface::Face face, unsigned int mipmapLevel)
 Set attachment for specified attachment point. More...
 
SurfaceSharedPtr getSurface (AttachmentPoint attachmentPoint) const
 Get surface for specified attachment point. More...
 
Attachment getAttachment (AttachmentPoint attachmentPoint) const
 Get attachment information for specified attachment point. More...
 
Status validate (Renderer *renderer) const
 Perform validation of framebuffer creation parameters. More...
 

Public Attributes

Surface::Usage usage
 How Framebuffer will be used. More...
 
array< Attachment, AttachmentPointCountattachments
 

Detailed Description

Framebuffer creation parameters.

Member Enumeration Documentation

Status of Framebuffer creation parameters, returned as result of validate().

Enumerator
StatusMissingColorAttachments 

Color buffers must be attached without gaps in used attachment points.

StatusMultipleRenderTargetsNotSupported 

Multiple rendertargets are not supported by graphics device.

Note
OpenGL ES 3 is required for multiple render targets.
StatusAttachmentUnsupportedFormat 

Attachment uses graphics format which is not supported.

StatusInvalidFace 

An attachment has non-existent cubemap face setting.

StatusInvalidMipmapLevel 

An attachment has non-existent mipmap level setting.

StatusInvalidUsage 

Requested Framebuffer usage is not valid.

StatusSampleCountMismatch 

Number of samples in creation parameters do not match.

StatusValid 

Framebuffer creation parameters are valid and can be used to create a new Framebuffer.

Constructor & Destructor Documentation

kanzi::Framebuffer::CreateInfo::CreateInfo ( Surface::Usage  usage)
explicit

Member Function Documentation

void kanzi::Framebuffer::CreateInfo::setAttachment ( AttachmentPoint  attachmentPoint,
const Attachment attachment 
)

Set attachment, cloning existing attachment.

Parameters
attachmentPointAttachment point to set.
attachmentExisting attachment.
void kanzi::Framebuffer::CreateInfo::setAttachment ( AttachmentPoint  attachmentPoint,
SurfaceSharedPtr  surface 
)

Set attachment for specified attachment point.

The surface is assumed to be non-cubemap Texture or Renderbuffer. If surface is Texture, the base level will be used.

Parameters
attachmentPointAttachment point to set.
surfaceSurface to place in the attachment point. This can be either Texture or Renderbuffer.
void kanzi::Framebuffer::CreateInfo::setAttachment ( AttachmentPoint  attachmentPoint,
TextureSharedPtr  texture,
unsigned int  mipmapLevel 
)

Set attachment for specified attachment point.

Parameters
attachmentPointAttachment point to set.
textureTexture to place in the attachment point.
mipmapLevelMipmap level of texture to place in the attachment point.
void kanzi::Framebuffer::CreateInfo::setAttachment ( AttachmentPoint  attachmentPoint,
TextureSharedPtr  texture,
Surface::Face  face,
unsigned int  mipmapLevel 
)

Set attachment for specified attachment point.

Parameters
attachmentPointAttachment point to set.
textureTexture to place in the attachment point. This should be a cubemap texture.
faceCubemap face.
mipmapLevelMipmap level of texture to place in the attachment point.
SurfaceSharedPtr kanzi::Framebuffer::CreateInfo::getSurface ( AttachmentPoint  attachmentPoint) const

Get surface for specified attachment point.

Parameters
attachmentPointAttachment point to query.
Returns
Surface set to the attachmentpoint.
Attachment kanzi::Framebuffer::CreateInfo::getAttachment ( AttachmentPoint  attachmentPoint) const

Get attachment information for specified attachment point.

Parameters
attachmentPointAttachment point to query.
Returns
Surface set to the attachmentpoint.
Status kanzi::Framebuffer::CreateInfo::validate ( Renderer renderer) const

Perform validation of framebuffer creation parameters.

You can call validate() to see if framebuffer creation parameters are valid before you pass the creation parameters to Framebuffer::create().

Parameters
rendererRenderer to validate with.
Returns
StatusValid if these creation parameters can be used to create a new Framebuffer. Otherwise a reason code for why this CreateInfo cannot be used to create a new Framebuffer.

Member Data Documentation

Surface::Usage kanzi::Framebuffer::CreateInfo::usage

How Framebuffer will be used.

array<Attachment, AttachmentPointCount> kanzi::Framebuffer::CreateInfo::attachments

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