diff --git a/Windows/GPU/D3D11Context.cpp b/Windows/GPU/D3D11Context.cpp index 49cd1bbdf8..fef1438fb6 100644 --- a/Windows/GPU/D3D11Context.cpp +++ b/Windows/GPU/D3D11Context.cpp @@ -6,6 +6,7 @@ #include #include "base/logging.h" +#include "Base/display.h" #include "util/text/utf8.h" #include "i18n/i18n.h" @@ -51,6 +52,9 @@ void D3D11Context::SwapInterval(int interval) { HRESULT D3D11Context::CreateTheDevice(IDXGIAdapter *adapter) { bool windowed = true; + // D3D11 has no need for display rotation. + g_display_rotation = DisplayRotation::ROTATE_0; + g_display_rot_matrix.setIdentity(); #if defined(_DEBUG) && !defined(_M_ARM) && !defined(_M_ARM64) UINT createDeviceFlags = D3D11_CREATE_DEVICE_DEBUG; #else diff --git a/Windows/GPU/D3D9Context.cpp b/Windows/GPU/D3D9Context.cpp index c21a6d7c5d..4317fd1328 100644 --- a/Windows/GPU/D3D9Context.cpp +++ b/Windows/GPU/D3D9Context.cpp @@ -6,6 +6,7 @@ #include "gfx/d3d9_state.h" #include "base/logging.h" +#include "base/display.h" #include "util/text/utf8.h" #include "i18n/i18n.h" @@ -62,6 +63,10 @@ bool D3D9Context::Init(HINSTANCE hInst, HWND wnd, std::string *error_message) { bool windowed = true; hWnd_ = wnd; + // D3D9 has no need for display rotation. + g_display_rotation = DisplayRotation::ROTATE_0; + g_display_rot_matrix.setIdentity(); + DIRECT3DCREATE9EX g_pfnCreate9ex; hD3D9_ = LoadLibrary(TEXT("d3d9.dll")); diff --git a/android/jni/AndroidJavaGLContext.cpp b/android/jni/AndroidJavaGLContext.cpp index 2d463e76dc..f03c5b864d 100644 --- a/android/jni/AndroidJavaGLContext.cpp +++ b/android/jni/AndroidJavaGLContext.cpp @@ -1,6 +1,7 @@ #include #include "AndroidJavaGLContext.h" +#include "base/display.h" #include "base/NativeApp.h" #include "gfx_es2/gpu_features.h" #include "Core/ConfigValues.h" @@ -13,6 +14,9 @@ AndroidJavaEGLGraphicsContext::AndroidJavaEGLGraphicsContext() { bool AndroidJavaEGLGraphicsContext::InitFromRenderThread(ANativeWindow *wnd, int desiredBackbufferSizeX, int desiredBackbufferSizeY, int backbufferFormat, int androidVersion) { ILOG("AndroidJavaEGLGraphicsContext::InitFromRenderThread"); CheckGLExtensions(); + // OpenGL handles rotated rendering in the driver. + g_display_rotation = DisplayRotation::ROTATE_0; + g_display_rot_matrix.setIdentity(); draw_ = Draw::T3DCreateGLContext(); renderManager_ = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER); bool success = draw_->CreatePresets();