Raven Engine v0.1
Loading...
Searching...
No Matches
Raven::Framebuffer Class Referenceabstract

Abstract interface for framebuffer management. More...

#include <Framebuffer.h>

Inheritance diagram for Raven::Framebuffer:
Raven::Castable< Framebuffer > Raven::VulkanFramebuffer

Public Member Functions

virtual ~Framebuffer ()=default
virtual void Resize (u32 width, u32 height, bool forceRecreate=false)=0
 Resize framebuffer to new dimensions.
virtual void AddResizeCallback (const std::function< void(Ref< Framebuffer >)> &func)=0
 Adds a callback triggered on framebuffer resize.
virtual FramebufferSpecificationGetSpecification ()=0
virtual const FramebufferSpecificationGetSpecification () const =0
virtual Ref< Image2DGetDepthImage () const =0
virtual Ref< Image2DGetImage (u32 index) const =0
 Returns the color attachment image at the given index.
virtual usize GetColorAttachmentCount () const =0
virtual bool HasDepthAttachment ()=0
virtual void Release ()=0
 Releases internal resources.
Public Member Functions inherited from Raven::Castable< Framebuffer >
T & As ()
 Non-const version of As<T>(), for casting to a non-const target type.

Static Public Member Functions

static Ref< FramebufferCreate (const FramebufferSpecification &spec)
 Factory method to create a framebuffer from specification.

Detailed Description

Abstract interface for framebuffer management.

Provides methods for resizing, callback registration, access to attachments, and lifecycle management.

Concrete implementations are expected to manage Vulkan resources under the hood.

Constructor & Destructor Documentation

◆ ~Framebuffer()

virtual Raven::Framebuffer::~Framebuffer ( )
virtualdefault

Member Function Documentation

◆ AddResizeCallback()

virtual void Raven::Framebuffer::AddResizeCallback ( const std::function< void(Ref< Framebuffer >)> & func)
pure virtual

Adds a callback triggered on framebuffer resize.

Parameters
funcFunction called with a reference to the framebuffer.

Implemented in Raven::VulkanFramebuffer.

◆ Create()

Ref< Framebuffer > Raven::Framebuffer::Create ( const FramebufferSpecification & spec)
static

Factory method to create a framebuffer from specification.

Parameters
specConfiguration parameters.
Returns
Reference-counted framebuffer instance.

◆ GetColorAttachmentCount()

virtual usize Raven::Framebuffer::GetColorAttachmentCount ( ) const
pure virtual
Returns
The number of color attachments.

Implemented in Raven::VulkanFramebuffer.

◆ GetDepthImage()

virtual Ref< Image2D > Raven::Framebuffer::GetDepthImage ( ) const
pure virtual
Returns
Depth attachment image, or null if none exists.

Implemented in Raven::VulkanFramebuffer.

◆ GetImage()

virtual Ref< Image2D > Raven::Framebuffer::GetImage ( u32 index) const
pure virtual

Returns the color attachment image at the given index.

Parameters
indexAttachment index.
Returns
Reference to the image.

Implemented in Raven::VulkanFramebuffer.

◆ GetSpecification() [1/2]

virtual const FramebufferSpecification & Raven::Framebuffer::GetSpecification ( ) const
pure virtual
Returns
const framebuffer specification.

Implemented in Raven::VulkanFramebuffer.

◆ GetSpecification() [2/2]

virtual FramebufferSpecification & Raven::Framebuffer::GetSpecification ( )
pure virtual
Returns
Mutable framebuffer specification.

Implemented in Raven::VulkanFramebuffer.

◆ HasDepthAttachment()

virtual bool Raven::Framebuffer::HasDepthAttachment ( )
pure virtual
Returns
Whether a depth attachment exists.

Implemented in Raven::VulkanFramebuffer.

◆ Release()

virtual void Raven::Framebuffer::Release ( )
pure virtual

Releases internal resources.

Implemented in Raven::VulkanFramebuffer.

◆ Resize()

virtual void Raven::Framebuffer::Resize ( u32 width,
u32 height,
bool forceRecreate = false )
pure virtual

Resize framebuffer to new dimensions.

Parameters
widthNew width in pixels.
heightNew height in pixels.
forceRecreateIf true, forces full resource recreation.

Implemented in Raven::VulkanFramebuffer.


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