[Renderers/SDL3] Use SDL_Texture instead of SDL_Surface for images (#402)

This commit is contained in:
David Delassus 2025-05-05 02:27:41 +02:00 committed by GitHub
parent e4e7b113a9
commit fb4eec93b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 57 additions and 7 deletions

View file

@ -251,12 +251,9 @@ static void SDL_Clay_RenderClayCommands(Clay_SDL3RendererData *rendererData, Cla
break;
}
case CLAY_RENDER_COMMAND_TYPE_IMAGE: {
SDL_Surface *image = (SDL_Surface *)rcmd->renderData.image.imageData;
SDL_Texture *texture = SDL_CreateTextureFromSurface(rendererData->renderer, image);
SDL_Texture *texture = (SDL_Texture *)rcmd->renderData.image.imageData;
const SDL_FRect dest = { rect.x, rect.y, rect.w, rect.h };
SDL_RenderTexture(rendererData->renderer, texture, NULL, &dest);
SDL_DestroyTexture(texture);
break;
}
default: