/* * Copyright (c) 2007-2009 SlimDX Group * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ namespace SampleFramework { /// /// Contains the current timing state of the game. /// public class GameTime { private float m_FramesPerSecond; /// /// Gets the current frames-per-second measure. /// /// The current frames-per-second measure. public float FramesPerSecond { get { return m_FramesPerSecond; } internal set { m_FramesPerSecond = value; } } private float m_ElapsedGameTime; /// /// Gets the elapsed game time, in seconds. /// /// The elapsed game time. public float ElapsedGameTime { get { return m_ElapsedGameTime; } internal set { m_ElapsedGameTime = value; } } private float m_ElapsedRealTime; /// /// Gets the elapsed real time, in seconds. /// /// The elapsed real time. public float ElapsedRealTime { get { return m_ElapsedRealTime; } internal set { m_ElapsedRealTime = value; } } private float m_TotalGameTime; /// /// Gets the total game time, in seconds. /// /// The total game time. public float TotalGameTime { get { return m_TotalGameTime; } internal set { m_TotalGameTime = value; } } private float m_TotalRealTime; /// /// Gets the total real time, in seconds. /// /// The total real time. public float TotalRealTime { get { return m_TotalRealTime; } internal set { m_TotalRealTime = value; } } private bool m_IsRunningSlowly; /// /// Gets or sets a value indicating whether this instance is running slowly. /// /// /// true if this instance is running slowly; otherwise, false. /// public bool IsRunningSlowly { get { return m_IsRunningSlowly; } internal set { m_IsRunningSlowly = value; } } /// /// Initializes a new instance of the class. /// public GameTime() { } /// /// Initializes a new instance of the class. /// /// The total real time. /// The elapsed real time. /// The total game time. /// The elapsed game time. public GameTime(float totalRealTime, float elapsedRealTime, float totalGameTime, float elapsedGameTime) { TotalRealTime = totalRealTime; ElapsedRealTime = elapsedRealTime; TotalGameTime = totalGameTime; ElapsedGameTime = elapsedGameTime; } } }