Show More
Commit Description:
Fix issue with simulation....
Commit Description:
Fix issue with simulation. Previously, if there was more than one tick being advanced at once, it would overshoot how many ticks it covered. So if it was covering 5 ticks and each tick happens every 100 units, rather than recording that it had simulated through t= 500, it would increase the cumulative time for each tick, recording that it had simulated through t=2500. Add error message, too.
File last commit:
Show/Diff file:
Action:
FNA/src/Graphics/OcclusionQuery.cs
87 lines | 1.4 KiB | text/x-csharp | CSharpLexer
Early working version (including all dependencies, lol).
r0 #region License
/* FNA - XNA4 Reimplementation for Desktop Platforms
Upgrade FNA to 22.12...
r690 * Copyright 2009-2022 Ethan Lee and the MonoGame Team
Early working version (including all dependencies, lol).
r0 *
* Released under the Microsoft Public License.
* See LICENSE for details.
*/
#endregion
#region Using Statements
using System;
#endregion
namespace Microsoft.Xna.Framework.Graphics
{
public class OcclusionQuery : GraphicsResource
{
#region Public Properties
public bool IsComplete
{
get
{
Upgrade FNA to 22.12...
r690 return FNA3D.FNA3D_QueryComplete(
GraphicsDevice.GLDevice,
query
) == 1;
Early working version (including all dependencies, lol).
r0 }
}
public int PixelCount
{
get
{
Upgrade FNA to 22.12...
r690 return FNA3D.FNA3D_QueryPixelCount(
GraphicsDevice.GLDevice,
query
);
Early working version (including all dependencies, lol).
r0 }
}
#endregion
Upgrade FNA to 22.12...
r690 #region Private FNA3D Variables
Early working version (including all dependencies, lol).
r0
Upgrade FNA to 22.12...
r690 private IntPtr query;
Early working version (including all dependencies, lol).
r0
#endregion
#region Public Constructor
public OcclusionQuery(GraphicsDevice graphicsDevice)
{
GraphicsDevice = graphicsDevice;
Upgrade FNA to 22.12...
r690 query = FNA3D.FNA3D_CreateQuery(GraphicsDevice.GLDevice);
Early working version (including all dependencies, lol).
r0 }
#endregion
#region Protected Dispose Method
protected override void Dispose(bool disposing)
{
if (!IsDisposed)
{
Upgrade FNA to 22.12...
r690 FNA3D.FNA3D_AddDisposeQuery(GraphicsDevice.GLDevice, query);
Early working version (including all dependencies, lol).
r0 }
base.Dispose(disposing);
}
#endregion
#region Public Begin/End Methods
public void Begin()
{
Upgrade FNA to 22.12...
r690 FNA3D.FNA3D_QueryBegin(GraphicsDevice.GLDevice, query);
Early working version (including all dependencies, lol).
r0 }
public void End()
{
Upgrade FNA to 22.12...
r690 FNA3D.FNA3D_QueryEnd(GraphicsDevice.GLDevice, query);
Early working version (including all dependencies, lol).
r0 }
#endregion
}
}