26#include <SDL3/SDL_gpu.h>
28#include <Objectively/Object.h>
39typedef struct FramebufferInterface FramebufferInterface;
47#define GPU_MAX_COLOR_TARGETS 4
235struct FramebufferInterface {
240 ObjectInterface objectInterface;
256 SDL_GPUColorTargetInfo (*colorTargetInfo)(
const Framebuffer *self, Uint32 index, SDL_GPULoadOp loadOp, SDL_GPUStoreOp storeOp);
270 SDL_GPUDepthStencilTargetInfo (*depthTargetInfo)(
const Framebuffer *self, SDL_GPULoadOp loadOp, SDL_GPUStoreOp storeOp);
285 void (*pipelineTargetInfo)(
const Framebuffer *self,
const SDL_GPUColorTargetBlendState *blendStates,
286 SDL_GPUColorTargetDescription *descriptions, SDL_GPUGraphicsPipelineTargetInfo *targetInfo);
#define GPU_MAX_COLOR_TARGETS
The maximum number of color attachments a Framebuffer may have.
Definition Framebuffer.h:47
OBJECTIVELYGPU_EXPORT Class * _Framebuffer(void)
Definition Framebuffer.c:317
#define OBJECTIVELYGPU_EXPORT
Definition Types.h:35
An off-screen render target grouping a color and/or depth texture.
Definition Framebuffer.h:177
SDL_Size size
The framebuffer dimensions.
Definition Framebuffer.h:198
Object object
The superclass.
Definition Framebuffer.h:182
GPU_FramebufferAttachment colorAttachments[GPU_MAX_COLOR_TARGETS]
The color attachments, indices [0, numColorTargets).
Definition Framebuffer.h:208
Uint32 numColorAttachments
The number of color attachments; indices [0, numColorTargets) are valid.
Definition Framebuffer.h:213
RenderDevice * device
The owning RenderDevice, used for texture allocation and dealloc.
Definition Framebuffer.h:193
GPU_FramebufferAttachment depthAttachment
The depth attachment, or format SDL_GPU_TEXTUREFORMAT_INVALID if none.
Definition Framebuffer.h:218
ident data
User data.
Definition Framebuffer.h:229
FramebufferInterface * interface
The interface.
Definition Framebuffer.h:188
SDL_GPUSampleCount sampleCount
The MSAA sample count of all color and depth attachments.
Definition Framebuffer.h:203
Describes, and backs, a single Framebuffer attachment (color or depth).
Definition Framebuffer.h:62
SDL_FColor clearColor
The clear color, for color attachments.
Definition Framebuffer.h:74
SDL_GPUTextureFormat format
The attachment format, or SDL_GPU_TEXTUREFORMAT_INVALID to omit (depth only).
Definition Framebuffer.h:67
bool doubleBuffered
If true, this attachment is double-buffered; see above.
Definition Framebuffer.h:86
float clearDepth
The clear depth value, for the depth attachment.
Definition Framebuffer.h:80
Parameters for creating a Framebuffer.
Definition Framebuffer.h:108
GPU_FramebufferAttachment colorAttachments[GPU_MAX_COLOR_TARGETS]
The color attachments, one per render target (MRT).
Definition Framebuffer.h:122
SDL_Size size
Initial framebuffer dimensions.
Definition Framebuffer.h:115
GPU_FramebufferAttachment depthAttachment
The depth attachment, or format SDL_GPU_TEXTUREFORMAT_INVALID to omit.
Definition Framebuffer.h:134
Uint32 numColorTargets
The number of color attachments; 0 to omit color entirely.
Definition Framebuffer.h:127
SDL_GPUSampleCount sampleCount
MSAA sample count; SDL_GPU_SAMPLECOUNT_1 for no multisampling.
Definition Framebuffer.h:141
The RenderDevice encapsulates an SDL_GPUDevice and provides methods for allocating GPU resources,...
Definition RenderDevice.h:63
The SDL_Size type.
Definition Types.h:47
An SDL_GPUTexture and the metadata describing it.
Definition Texture.h:60