mirror of
https://github.com/nicbarker/clay.git
synced 2025-09-18 20:46:17 +00:00
[Renderers/SDL3] Use textures instead of surfaces when rendering images
This commit is contained in:
parent
e4e7b113a9
commit
47eeb78acd
|
@ -251,12 +251,9 @@ static void SDL_Clay_RenderClayCommands(Clay_SDL3RendererData *rendererData, Cla
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CLAY_RENDER_COMMAND_TYPE_IMAGE: {
|
case CLAY_RENDER_COMMAND_TYPE_IMAGE: {
|
||||||
SDL_Surface *image = (SDL_Surface *)rcmd->renderData.image.imageData;
|
SDL_Texture *texture = (SDL_Texture *)rcmd->renderData.image.imageData;
|
||||||
SDL_Texture *texture = SDL_CreateTextureFromSurface(rendererData->renderer, image);
|
|
||||||
const SDL_FRect dest = { rect.x, rect.y, rect.w, rect.h };
|
const SDL_FRect dest = { rect.x, rect.y, rect.w, rect.h };
|
||||||
|
|
||||||
SDL_RenderTexture(rendererData->renderer, texture, NULL, &dest);
|
SDL_RenderTexture(rendererData->renderer, texture, NULL, &dest);
|
||||||
SDL_DestroyTexture(texture);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue