mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-16 01:38:27 +00:00
render: Replaced SDL_RenderFlush with SDL_FlushRenderer.
This uses the same `SDL_VerbNoun` format as the rest of SDL3, and also adds stronger effort to invalidate cached state in the backend, so cooperation improves with apps that are using lowlevel rendering APIs directly. Fixes #367.
This commit is contained in:
parent
eef5c53668
commit
dfee3f9e92
19 changed files with 156 additions and 18 deletions
|
@ -658,6 +658,12 @@ static void SetDrawState(SDL_Surface *surface, SW_DrawStateCache *drawstate)
|
|||
}
|
||||
}
|
||||
|
||||
static void SW_InvalidateCachedState(SDL_Renderer *renderer)
|
||||
{
|
||||
/* SW_DrawStateCache only lives during SW_RunCommandQueue, so nothing to do here! */
|
||||
}
|
||||
|
||||
|
||||
static int SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize)
|
||||
{
|
||||
SDL_Surface *surface = SW_ActivateRenderer(renderer);
|
||||
|
@ -1134,6 +1140,7 @@ SDL_Renderer *SW_CreateRendererForSurface(SDL_Surface *surface)
|
|||
renderer->QueueCopy = SW_QueueCopy;
|
||||
renderer->QueueCopyEx = SW_QueueCopyEx;
|
||||
renderer->QueueGeometry = SW_QueueGeometry;
|
||||
renderer->InvalidateCachedState = SW_InvalidateCachedState;
|
||||
renderer->RunCommandQueue = SW_RunCommandQueue;
|
||||
renderer->RenderReadPixels = SW_RenderReadPixels;
|
||||
renderer->RenderPresent = SW_RenderPresent;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue