|
Flint Engine
Modular C++20 2D game engine powered by SDL3
|
|
inline |
Upload an image from memory to the GPU.
Decodes the image with SDL_image and converts it to RGBA32 if it isn't already, so any source format (RGB, palettized, greyscale, etc.) uploads correctly. Allocates a 2-D R8G8B8A8_UNORM texture, copies the pixels row by row into a transfer buffer (handling source row padding), uploads, and creates a nearest-neighbor clamp-to-edge sampler.
| device | SDL GPU device to use for resource creation. |
| data | Pointer to raw image file bytes (e.g. PNG, BMP, etc.). |
| size | Number of bytes in data. |
Definition at line 78 of file gpu-texture.h.