wiiu/render: Fix projection matrix for render targets

This commit is contained in:
GaryOderNichts 2022-10-02 17:37:04 +02:00 committed by Dave Murphy
parent a63e0d188d
commit 2b0fd8fa1c
No known key found for this signature in database
GPG Key ID: F7FD5492264BB9D0
2 changed files with 2 additions and 2 deletions

View File

@ -98,6 +98,7 @@ SDL_Renderer *WIIU_SDL_CreateRenderer(SDL_Window * window, Uint32 flags)
data->drawState.blendMode = SDL_BLENDMODE_INVALID;
data->drawState.shader = SHADER_INVALID;
data->drawState.projectionMatrix[3][0] = -1.0f;
data->drawState.projectionMatrix[3][1] = 1.0f;
data->drawState.projectionMatrix[3][3] = 1.0f;
/* Make a texture for the window */

View File

@ -279,8 +279,7 @@ static int WIIU_SDL_SetDrawState(WIIU_RenderData * data, const SDL_RenderCommand
if (viewport->w && viewport->h) {
data->drawState.projectionMatrix[0][0] = 2.0f / viewport->w;
data->drawState.projectionMatrix[1][1] = (data->drawState.target ? 2.0f : -2.0f) / viewport->h;
data->drawState.projectionMatrix[3][1] = data->drawState.target ? -1.0f : 1.0f;
data->drawState.projectionMatrix[1][1] = -2.0f / viewport->h;
matrixUpdated = SDL_TRUE;
}