fixed issue #534 ("StencilSample: InvalidOperationException")
This commit is contained in:
parent
95b2968294
commit
c8bb0b6443
@ -340,6 +340,14 @@ namespace ANX.Framework.Graphics
|
|||||||
|
|
||||||
raise_DeviceResetting(this, EventArgs.Empty);
|
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
|
// reset presentation parameters
|
||||||
nativeDevice.ResizeBuffers(presentationParameters); //TODO: check if necessary
|
nativeDevice.ResizeBuffers(presentationParameters); //TODO: check if necessary
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ namespace WindowsGame1
|
|||||||
{
|
{
|
||||||
// Create a new SpriteBatch, which can be used to draw textures.
|
// Create a new SpriteBatch, which can be used to draw textures.
|
||||||
spriteBatch = new SpriteBatch(GraphicsDevice);
|
spriteBatch = new SpriteBatch(GraphicsDevice);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// UnloadContent will be called once per game and is the place to unload
|
/// UnloadContent will be called once per game and is the place to unload
|
||||||
|
Loading…
x
Reference in New Issue
Block a user