mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 00:05:35 +00:00
update SDL_render_d3d12.c after DPI scaling/highdpi support patch.
See https://github.com/libsdl-org/SDL/pull/5778#issuecomment-1153006938
This commit is contained in:
parent
6d1dfc8322
commit
960b86dcb5
|
@ -33,6 +33,7 @@
|
|||
|
||||
#define COBJMACROS
|
||||
#include "../../core/windows/SDL_windows.h"
|
||||
#include "../../video/windows/SDL_windowswindow.h"
|
||||
#include "SDL_hints.h"
|
||||
#include "SDL_loadso.h"
|
||||
#include "SDL_syswm.h"
|
||||
|
@ -240,7 +241,6 @@ static const GUID SDL_IID_ID3D12InfoQueue = { 0x0742a90b, 0xc387, 0x483f, { 0xb9
|
|||
#endif
|
||||
|
||||
|
||||
|
||||
UINT
|
||||
D3D12_Align(UINT location, UINT alignment)
|
||||
{
|
||||
|
@ -485,6 +485,13 @@ D3D12_DestroyRenderer(SDL_Renderer * renderer)
|
|||
SDL_free(renderer);
|
||||
}
|
||||
|
||||
static int
|
||||
D3D12_GetOutputSize(SDL_Renderer *renderer, int *w, int *h)
|
||||
{
|
||||
WIN_GetDrawableSize(renderer->window, w, h);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static D3D12_BLEND
|
||||
GetBlendFunc(SDL_BlendFactor factor)
|
||||
{
|
||||
|
@ -1211,7 +1218,7 @@ D3D12_CreateWindowSizeDependentResources(SDL_Renderer * renderer)
|
|||
/* The width and height of the swap chain must be based on the display's
|
||||
* non-rotated size.
|
||||
*/
|
||||
SDL_GetWindowSize(renderer->window, &w, &h);
|
||||
WIN_GetDrawableSize(renderer->window, &w, &h);
|
||||
data->rotation = D3D12_GetCurrentRotation();
|
||||
if (D3D12_IsDisplayRotated90Degrees(data->rotation)) {
|
||||
int tmp = w;
|
||||
|
@ -2936,6 +2943,7 @@ D3D12_CreateRenderer(SDL_Window * window, Uint32 flags)
|
|||
data->identity = MatrixIdentity();
|
||||
|
||||
renderer->WindowEvent = D3D12_WindowEvent;
|
||||
renderer->GetOutputSize = D3D12_GetOutputSize;
|
||||
renderer->SupportsBlendMode = D3D12_SupportsBlendMode;
|
||||
renderer->CreateTexture = D3D12_CreateTexture;
|
||||
renderer->UpdateTexture = D3D12_UpdateTexture;
|
||||
|
|
Loading…
Reference in a new issue