From 9704a1aeb06e1d3999e356febd4525025d7fec86 Mon Sep 17 00:00:00 2001 From: Flamefire Date: Mon, 20 May 2013 19:10:49 +0200 Subject: [PATCH] Fixed D3D --- Vocaluxe.sln | 5 ++++- Vocaluxe/Lib/Draw/CDirect3D.cs | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Vocaluxe.sln b/Vocaluxe.sln index b1eb0f0f..636ec3bf 100644 --- a/Vocaluxe.sln +++ b/Vocaluxe.sln @@ -1,6 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Express 2012 for Windows Desktop +# Visual Studio 2012 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vocaluxe", "Vocaluxe\Vocaluxe.csproj", "{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}" ProjectSection(ProjectDependencies) = postProject {6F3E1874-F28A-40E9-AFBD-31934D593678} = {6F3E1874-F28A-40E9-AFBD-31934D593678} @@ -128,4 +128,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(Performance) = preSolution + HasPerformanceSessions = true + EndGlobalSection EndGlobal diff --git a/Vocaluxe/Lib/Draw/CDirect3D.cs b/Vocaluxe/Lib/Draw/CDirect3D.cs index 11dc0ea5..0e104ee1 100644 --- a/Vocaluxe/Lib/Draw/CDirect3D.cs +++ b/Vocaluxe/Lib/Draw/CDirect3D.cs @@ -850,6 +850,8 @@ namespace Vocaluxe.Lib.Draw w = _CheckForNextPowerOf2(w); h = _CheckForNextPowerOf2(h); + CTexture texture = new CTexture(bmp.Width, bmp.Height, w, h, true); + Bitmap bmp2 = null; byte[] data; try @@ -880,7 +882,6 @@ namespace Vocaluxe.Lib.Draw bmp2.Dispose(); } - CTexture texture = new CTexture(bmp.Width, bmp.Height, w, h, true); return _AddTexture(texture, w, data); } @@ -906,9 +907,8 @@ namespace Vocaluxe.Lib.Draw { //Create a new texture in the managed pool, which does not need to be recreated on a lost device //because a copy of the texture is hold in the Ram - Texture t; - using (t = new Texture(_Device, textureW, textureH, 0, Usage.AutoGenerateMipMap, Format.A8R8G8B8, Pool.Managed)) - _WriteDataToTexture(t, w, data); + Texture t = new Texture(_Device, textureW, textureH, 0, Usage.AutoGenerateMipMap, Format.A8R8G8B8, Pool.Managed); + _WriteDataToTexture(t, w, data); return t; }