From a7c70ddb6684aee4dfcbc7ce43f07447fac7761d Mon Sep 17 00:00:00 2001 From: hrydgard Date: Sun, 13 Sep 2009 17:46:33 +0000 Subject: D3D: Eliminate black borders, add 4:3 and 16:9 settings, and the widescreen hack. Unfortunately this temporarily breaks MSAA (in d3d only) until I have time to fix it. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4263 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_VideoDX9/Src/FramebufferManager.cpp | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Source/Plugins/Plugin_VideoDX9/Src/FramebufferManager.cpp (limited to 'Source/Plugins/Plugin_VideoDX9/Src/FramebufferManager.cpp') diff --git a/Source/Plugins/Plugin_VideoDX9/Src/FramebufferManager.cpp b/Source/Plugins/Plugin_VideoDX9/Src/FramebufferManager.cpp new file mode 100644 index 0000000000..aa53e58dc4 --- /dev/null +++ b/Source/Plugins/Plugin_VideoDX9/Src/FramebufferManager.cpp @@ -0,0 +1,55 @@ +// Copyright (C) 2003 Dolphin Project. + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, version 2.0. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official SVN repository and contact information can be found at +// http://code.google.com/p/dolphin-emu/ + +#include "D3DBase.h" +#include "Render.h" +#include "FramebufferManager.h" + +namespace FBManager +{ + +static LPDIRECT3DSURFACE9 s_efb_color_surface; +static LPDIRECT3DSURFACE9 s_efb_depth_surface; + +#undef CHECK +#define CHECK(hr) if (FAILED(hr)) { PanicAlert("FAIL: " __FUNCTION__); } + +LPDIRECT3DSURFACE9 GetEFBColorRTSurface() { return s_efb_color_surface; } +LPDIRECT3DSURFACE9 GetEFBDepthRTSurface() { return s_efb_depth_surface; } + +void Create() +{ + // Simplest possible setup to start with. + int target_width = Renderer::GetTargetWidth(); + int target_height = Renderer::GetTargetHeight(); + HRESULT hr = D3D::dev->CreateRenderTarget(target_width, target_height, D3DFMT_A8R8G8B8, + D3DMULTISAMPLE_NONE, 0, FALSE, &s_efb_color_surface, NULL); + CHECK(hr); + hr = D3D::dev->CreateDepthStencilSurface(target_width, target_height, D3DFMT_D24S8, + D3DMULTISAMPLE_NONE, 0, FALSE, &s_efb_depth_surface, NULL); + CHECK(hr); +} + +void Destroy() +{ + s_efb_depth_surface->Release(); + s_efb_depth_surface = NULL; + s_efb_color_surface->Release(); + s_efb_color_surface = NULL; +} + +} // namespace \ No newline at end of file -- cgit v1.2.3