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

@@ -446,6 +446,11 @@ int PS2_RenderPoints(SDL_Renderer *renderer, void *vertices, SDL_RenderCommand *
return 0;
}
static void PS2_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 PS2_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize)
{
while (cmd) {
@@ -656,6 +661,7 @@ static SDL_Renderer *PS2_CreateRenderer(SDL_Window *window, SDL_PropertiesID cre
renderer->QueueDrawPoints = PS2_QueueDrawPoints;
renderer->QueueDrawLines = PS2_QueueDrawPoints;
renderer->QueueGeometry = PS2_QueueGeometry;
renderer->InvalidateCachedState = PS2_InvalidateCachedState;
renderer->RunCommandQueue = PS2_RunCommandQueue;
renderer->RenderReadPixels = PS2_RenderReadPixels;
renderer->RenderPresent = PS2_RenderPresent;