mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-20 15:51:07 +01:00
tests: Update GPU tests to use new swapchain best practice
This commit is contained in:
@@ -341,20 +341,14 @@ Render(SDL_Window *window, const int windownum)
|
||||
SDL_Log("Failed to acquire command buffer :%s", SDL_GetError());
|
||||
quit(2);
|
||||
}
|
||||
if (!SDL_AcquireGPUSwapchainTexture(cmd, state->windows[windownum], &swapchainTexture, &drawablew, &drawableh)) {
|
||||
if (!SDL_WaitAndAcquireGPUSwapchainTexture(cmd, state->windows[windownum], &swapchainTexture, &drawablew, &drawableh)) {
|
||||
SDL_Log("Failed to acquire swapchain texture: %s", SDL_GetError());
|
||||
quit(2);
|
||||
}
|
||||
|
||||
if (swapchainTexture == NULL) {
|
||||
/* No swapchain was acquired, probably too many frames in flight */
|
||||
SDL_SubmitGPUCommandBuffer(cmd);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Do some rotation with Euler angles. It is not a fixed axis as
|
||||
* quaterions would be, but the effect is cool.
|
||||
* quaternions would be, but the effect is cool.
|
||||
*/
|
||||
rotate_matrix((float)winstate->angle_x, 1.0f, 0.0f, 0.0f, matrix_modelview);
|
||||
rotate_matrix((float)winstate->angle_y, 0.0f, 1.0f, 0.0f, matrix_rotate);
|
||||
|
||||
Reference in New Issue
Block a user