From ae03a855f566bcab3fa1d79cae227fe687781c4a Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Mon, 25 Aug 2014 21:33:24 +0200 Subject: [PATCH] d3d: Apply a half-pixel offset to make 2D ui graphics sharper (d3d texturing...) --- UI/NativeApp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 2cd7076fd1..1eb3962f75 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -712,6 +712,9 @@ void NativeRender() { Matrix4x4 ortho; if (g_Config.iGPUBackend == GPU_BACKEND_DIRECT3D9) { ortho.setOrthoD3D(0.0f, xres, yres, 0.0f, -1.0f, 1.0f); + Matrix4x4 translation; + translation.setTranslation(Vec3(-0.5f, -0.5f, 0.0f)); + ortho = translation * ortho; } else { ortho.setOrtho(0.0f, xres, yres, 0.0f, -1.0f, 1.0f); }