fixed issue #534 ("StencilSample: InvalidOperationException")

This commit is contained in:
Glatzemann 2011-12-16 07:54:47 +00:00
parent 95b2968294
commit c8bb0b6443
2 changed files with 9 additions and 1 deletions

View File

@ -340,6 +340,14 @@ namespace ANX.Framework.Graphics
raise_DeviceResetting(this, EventArgs.Empty);
// As it seams that no hardware Depth24 exists we handle Depth24 and Depth24Stencil8 the same way. Problem is that the Clear method checks for Depth24Stencil8 when
// trying to clear the stencil buffer and the format is setted to Depth24. Internally Depth24 is already handled as Depth24Stencil8 so it is interchangeable.
if ((this.currentPresentationParameters.DepthStencilFormat == DepthFormat.Depth24 || this.currentPresentationParameters.DepthStencilFormat == DepthFormat.Depth24Stencil8) &&
(presentationParameters.DepthStencilFormat == DepthFormat.Depth24 || presentationParameters.DepthStencilFormat == DepthFormat.Depth24Stencil8))
{
this.currentPresentationParameters.DepthStencilFormat = presentationParameters.DepthStencilFormat;
}
// reset presentation parameters
nativeDevice.ResizeBuffers(presentationParameters); //TODO: check if necessary

View File

@ -89,7 +89,7 @@ namespace WindowsGame1
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
}
}
/// <summary>
/// UnloadContent will be called once per game and is the place to unload