diff --git a/ANX.Framework/Graphics/GraphicsDevice.cs b/ANX.Framework/Graphics/GraphicsDevice.cs index 29508ec7..c54826a8 100644 --- a/ANX.Framework/Graphics/GraphicsDevice.cs +++ b/ANX.Framework/Graphics/GraphicsDevice.cs @@ -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 diff --git a/Samples/WindowsGame/Game1.cs b/Samples/WindowsGame/Game1.cs index 7c15a2a0..811d722a 100644 --- a/Samples/WindowsGame/Game1.cs +++ b/Samples/WindowsGame/Game1.cs @@ -89,7 +89,7 @@ namespace WindowsGame1 { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); - } + } /// /// UnloadContent will be called once per game and is the place to unload