Flint Engine
Modular C++20 2D game engine powered by SDL3
Loading...
Searching...
No Matches

◆ fromRenderer()

static GPUTexture Flint::GPUTexture::fromRenderer ( SDL_GPUDevice * device,
const void * data,
size_t size )
inlinestatic

Factory: create a GPUTexture by loading from memory.

Parameters
deviceSDL GPU device.
dataRaw image file bytes.
sizeSize of data in bytes.
Returns
A fully initialized GPUTexture (moved out).
Exceptions
std::runtime_errorif loading fails.

Definition at line 258 of file gpu-texture.h.