ObjectivelyGPU
Object oriented graphics framework for SDL3 and C
Loading...
Searching...
No Matches
Framebuffer.h File Reference

Framebuffer groups a color and/or depth texture as an off-screen render target. More...

#include <SDL3/SDL_gpu.h>
#include <Objectively/Object.h>
#include <ObjectivelyGPU/Types.h>

Go to the source code of this file.

Data Structures

struct  GPU_FramebufferAttachment
 Describes, and backs, a single Framebuffer attachment (color or depth). More...
 
struct  GPU_FramebufferCreateInfo
 Parameters for creating a Framebuffer. More...
 
struct  Framebuffer
 An off-screen render target grouping a color and/or depth texture. More...
 

Macros

#define GPU_MAX_COLOR_TARGETS   4
 The maximum number of color attachments a Framebuffer may have.
 

Typedefs

typedef struct RenderDevice RenderDevice
 
typedef struct Framebuffer Framebuffer
 
typedef struct Texture Texture
 
typedef struct GPU_FramebufferAttachment GPU_FramebufferAttachment
 Describes, and backs, a single Framebuffer attachment (color or depth).
 
typedef struct GPU_FramebufferCreateInfo GPU_FramebufferCreateInfo
 Parameters for creating a Framebuffer.
 

Functions

OBJECTIVELYGPU_EXPORT Class * _Framebuffer (void)
 

Detailed Description

Framebuffer groups a color and/or depth texture as an off-screen render target.

Macro Definition Documentation

◆ GPU_MAX_COLOR_TARGETS

#define GPU_MAX_COLOR_TARGETS   4

The maximum number of color attachments a Framebuffer may have.

A render pass binds N color targets plus at most one depth-stencil target; this caps N. Four matches the minimum guaranteed across backends.

Typedef Documentation

◆ Framebuffer

typedef struct Framebuffer Framebuffer

◆ GPU_FramebufferAttachment

Describes, and backs, a single Framebuffer attachment (color or depth).

format, the clear value, and doubleBuffered are the input description: set them in GPU_FramebufferCreateInfo with a designated initializer. textures and resolveTextures are live state, populated by Framebuffer::resize and owned by the Framebuffer – leave them zeroed in a GPU_FramebufferCreateInfo.

When doubleBuffered is true, the attachment allocates both texture slots and Framebuffer::swap alternates which slot is the current frame's write target, so the other slot remains valid to sample as last frame's contents – e.g. a depth copy sampled by soft particles – without a same-frame write-then-read hazard. Single-buffered attachments (doubleBuffered false) only ever use slot 0.

◆ GPU_FramebufferCreateInfo

Parameters for creating a Framebuffer.

◆ RenderDevice

typedef struct RenderDevice RenderDevice

◆ Texture

typedef struct Texture Texture

Function Documentation

◆ _Framebuffer()

OBJECTIVELYGPU_EXPORT Class * _Framebuffer ( void  )