SDL_CopyGPUTextureToTexture(3)
π SDL_CopyGPUTextureToTexture π
okay bestie, so this is a page from the SDL3 FUNCTIONS manual, and the function we're obsessing over today is SDL_CopyGPUTextureToTexture. it's a whole vibe. let's get into it π«Ά
β¨ NAME β¨
SDL_CopyGPUTextureToTexture β Performs a texture-to-texture copy. that's it. that's the girl. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_gpu.h>
void SDL_CopyGPUTextureToTexture(
SDL_GPUCopyPass *copy_pass,
const SDL_GPUTextureLocation *source,
const SDL_GPUTextureLocation *destination,
Uint32 w,
Uint32 h,
Uint32 d,
bool cycle);
like, look at her. no return value, she just does it. main character energy fr fr π
π¦ DESCRIPTION π¦
so the tea is: this copy happens on the GPU timeline. which means β and this is the important bit β you may assume the copy has finished in subsequent commands. no waiting around, no drama, it's done by the time the next thing rolls up. slay. β¨
β οΈ not me being the bearer of bad news β this function does not support copying between depth and color textures. nope. not happening. for those you gotta do the two-step: copy the texture to a buffer, and then copy that buffer to the destination texture. annoying? lowkey. but that's the rules, bestie π
π FUNCTION PARAMETERS π
copy_passβ a copy pass handle. your little ticket into the copy zone πsourceβ a source texture region. where the goods are coming from.destinationβ a destination texture region. where the goods are going.wβ the width of the region to copy. πhβ the height of the region to copy. πdβ the depth of the region to copy. π§cycleβ iftrue, cycles the destination texture if the destination texture is bound, otherwise overwrites the data. so: cycle or overwrite, your call, iykyk π
π AVAILABILITY π
This function is available since SDL 3.2.0. so if you're on anything older, sorry babe, no copy for you π
and that's the whole page, no cap. this was Simple Directmedia Layer, SDL 3.4.18, dated with all the love in the world β go forth and copy those textures, bestie, you're gonna eat πβ¨ππ¦πΈπ π«Ά
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms