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:
Ryan C. Gordon 2023-11-25 22:41:23 -05:00
parent eef5c53668
commit dfee3f9e92
19 changed files with 156 additions and 18 deletions

View file

@ -1021,6 +1021,11 @@ static void PSP_SetBlendState(PSP_RenderData *data, PSP_BlendState *state)
*current = *state;
}
static void PSP_InvalidateCachedState(SDL_Renderer *renderer)
{
/* currently this doesn't do anything. If this needs to do something (and someone is mixing their own rendering calls in!), update this. */
}
static int PSP_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize)
{
PSP_RenderData *data = (PSP_RenderData *)renderer->driverdata;
@ -1325,6 +1330,7 @@ SDL_Renderer *PSP_CreateRenderer(SDL_Window *window, SDL_PropertiesID create_pro
renderer->QueueFillRects = PSP_QueueFillRects;
renderer->QueueCopy = PSP_QueueCopy;
renderer->QueueCopyEx = PSP_QueueCopyEx;
renderer->InvalidateCachedState = PSP_InvalidateCachedState;
renderer->RunCommandQueue = PSP_RunCommandQueue;
renderer->RenderReadPixels = PSP_RenderReadPixels;
renderer->RenderPresent = PSP_RenderPresent;