26#include <SDL3/SDL_gpu.h>
28#include <Objectively/Object.h>
39typedef struct FramebufferInterface FramebufferInterface;
47#define GPU_MAX_COLOR_TARGETS 4
216struct FramebufferInterface {
221 ObjectInterface objectInterface;
237 SDL_GPUColorTargetInfo (*colorTargetInfo)(
const Framebuffer *self, Uint32 index,
238 SDL_GPULoadOp loadOp, SDL_GPUStoreOp storeOp,
const SDL_FColor *clearColor);
252 SDL_GPUDepthStencilTargetInfo (*depthTargetInfo)(
const Framebuffer *self,
253 SDL_GPULoadOp loadOp, SDL_GPUStoreOp storeOp,
float clearDepth);
#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:243
#define OBJECTIVELYGPU_EXPORT
Definition Types.h:35
An off-screen render target grouping a color and/or depth texture.
Definition Framebuffer.h:127
Uint32 numColorTargets
The number of color attachments; indices [0, numColorTargets) are valid.
Definition Framebuffer.h:157
SDL_Size size
The framebuffer dimensions.
Definition Framebuffer.h:143
Object object
The superclass.
Definition Framebuffer.h:132
Texture * colorTextures[GPU_MAX_COLOR_TARGETS]
The color attachment textures, indices [0, numColorTargets).
Definition Framebuffer.h:169
SDL_GPUTextureFormat depthFormat
The depth attachment texture format, or SDL_GPU_TEXTUREFORMAT_INVALID if none.
Definition Framebuffer.h:181
Texture * resolveTextures[GPU_MAX_COLOR_TARGETS]
The single-sample resolve targets, or all NULL unless sampleCount > SDL_GPU_SAMPLECOUNT_1.
Definition Framebuffer.h:176
ident data
User data.
Definition Framebuffer.h:210
SDL_GPUTextureFormat colorFormats[GPU_MAX_COLOR_TARGETS]
The color attachment texture formats, indices [0, numColorTargets).
Definition Framebuffer.h:162
FramebufferInterface * interface
The interface.
Definition Framebuffer.h:138
SDL_GPUSampleCount sampleCount
The MSAA sample count of all attachments.
Definition Framebuffer.h:152
Parameters for creating a Framebuffer.
Definition Framebuffer.h:56
SDL_GPUTextureFormat colorFormats[GPU_MAX_COLOR_TARGETS]
The color attachment formats, one per render target (MRT).
Definition Framebuffer.h:70
SDL_GPUTextureFormat depthFormat
Depth attachment format, or SDL_GPU_TEXTUREFORMAT_INVALID to omit.
Definition Framebuffer.h:81
SDL_Size size
Initial framebuffer dimensions.
Definition Framebuffer.h:63
Uint32 numColorTargets
The number of color attachments; 0 to omit color entirely.
Definition Framebuffer.h:75
SDL_GPUSampleCount sampleCount
MSAA sample count; SDL_GPU_SAMPLECOUNT_1 for no multisampling.
Definition Framebuffer.h:88
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