2012-09-01 11:20:05 +00:00
|
|
|
#region Using Statements
|
2012-08-09 09:45:04 +00:00
|
|
|
using ANX.Framework.NonXNA;
|
|
|
|
using ANX.Framework.NonXNA.PlatformSystem;
|
2012-09-01 11:20:05 +00:00
|
|
|
using System;
|
2012-10-10 19:26:53 +00:00
|
|
|
using ANX.Framework.NonXNA.Development;
|
2012-09-01 11:20:05 +00:00
|
|
|
|
|
|
|
#endregion
|
2011-10-31 05:36:24 +00:00
|
|
|
|
2012-08-09 09:45:04 +00:00
|
|
|
// This file is part of the ANX.Framework created by the
|
|
|
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
|
|
|
// For details see: http://anxframework.codeplex.com/license
|
2011-10-31 05:36:24 +00:00
|
|
|
|
|
|
|
namespace ANX.Framework
|
|
|
|
{
|
2012-09-01 11:20:05 +00:00
|
|
|
//TODO: this class is public on Windows Phone
|
|
|
|
|
2012-10-10 19:26:53 +00:00
|
|
|
[Developer("Glatzemann")]
|
2012-08-09 09:45:04 +00:00
|
|
|
internal class GameTimer
|
|
|
|
{
|
|
|
|
private INativeGameTimer nativeImplementation;
|
2012-09-01 11:20:05 +00:00
|
|
|
private TimeSpan lastUpdate;
|
2012-08-09 09:45:04 +00:00
|
|
|
|
|
|
|
public GameTimer()
|
|
|
|
{
|
2012-09-18 05:53:08 +00:00
|
|
|
nativeImplementation = PlatformSystem.Instance.CreateGameTimer();
|
2012-08-09 09:45:04 +00:00
|
|
|
|
2012-09-01 11:20:05 +00:00
|
|
|
nativeImplementation.Reset();
|
|
|
|
lastUpdate = nativeImplementation.ElapsedTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Update()
|
|
|
|
{
|
|
|
|
nativeImplementation.Update();
|
|
|
|
lastUpdate = nativeImplementation.ElapsedTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
public TimeSpan Elapsed
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return nativeImplementation.ElapsedTime;
|
|
|
|
}
|
|
|
|
}
|
2012-08-09 09:45:04 +00:00
|
|
|
|
|
|
|
public long Timestamp
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return nativeImplementation.Timestamp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-10-31 05:36:24 +00:00
|
|
|
}
|