Added deltaTime-parameter to UpdatingEventArgs

This commit is contained in:
DarthAffe committed 2016-06-03 22:02:35 +02:00
1 parent 5d1c8a1433
commit d453cdc9bc
2 files changed
+20 -2

No files matched your search

+4 -1
View File
@@ -64,6 +64,7 @@ namespace CUE.NET.Devices.Generic
private CancellationTokenSource _updateTokenSource;
private CancellationToken _updateToken;
private Task _updateTask;
private DateTime _lastUpdate = DateTime.Now;
#endregion
@@ -356,7 +357,9 @@ namespace CUE.NET.Devices.Generic
{
try
{
Updating?.Invoke(this, new UpdatingEventArgs());
long lastUpdateTicks = _lastUpdate.Ticks;
_lastUpdate = DateTime.Now;
Updating?.Invoke(this, new UpdatingEventArgs((float)((DateTime.Now.Ticks - lastUpdateTicks) / 10000000f)));
}
catch
{
+16 -1
View File
@@ -1,5 +1,20 @@
namespace CUE.NET.Devices.Generic.EventArgs
{
public class UpdatingEventArgs : System.EventArgs
{ }
{
#region Properties & Fields
public float DeltaTime { get; }
#endregion
#region Constructors
public UpdatingEventArgs(float deltaTime)
{
this.DeltaTime = deltaTime;
}
#endregion
}
}