2 * Copyright (c) 2007-2009 SlimDX Group
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 namespace SampleFramework
26 /// Contains the current timing state of the game.
30 private float m_FramesPerSecond;
32 /// Gets the current frames-per-second measure.
34 /// <value>The current frames-per-second measure.</value>
35 public float FramesPerSecond
37 get { return m_FramesPerSecond; }
38 internal set { m_FramesPerSecond = value; }
41 private float m_ElapsedGameTime;
43 /// Gets the elapsed game time, in seconds.
45 /// <value>The elapsed game time.</value>
46 public float ElapsedGameTime
48 get { return m_ElapsedGameTime; }
49 internal set { m_ElapsedGameTime = value; }
52 private float m_ElapsedRealTime;
54 /// Gets the elapsed real time, in seconds.
56 /// <value>The elapsed real time.</value>
57 public float ElapsedRealTime
59 get { return m_ElapsedRealTime; }
60 internal set { m_ElapsedRealTime = value; }
63 private float m_TotalGameTime;
65 /// Gets the total game time, in seconds.
67 /// <value>The total game time.</value>
68 public float TotalGameTime
70 get { return m_TotalGameTime; }
71 internal set { m_TotalGameTime = value; }
74 private float m_TotalRealTime;
76 /// Gets the total real time, in seconds.
78 /// <value>The total real time.</value>
79 public float TotalRealTime
81 get { return m_TotalRealTime; }
82 internal set { m_TotalRealTime = value; }
85 private bool m_IsRunningSlowly;
87 /// Gets or sets a value indicating whether this instance is running slowly.
90 /// <c>true</c> if this instance is running slowly; otherwise, <c>false</c>.
92 public bool IsRunningSlowly
94 get { return m_IsRunningSlowly; }
95 internal set { m_IsRunningSlowly = value; }
99 /// Initializes a new instance of the <see cref="GameTime"/> class.
106 /// Initializes a new instance of the <see cref="GameTime"/> class.
108 /// <param name="totalRealTime">The total real time.</param>
109 /// <param name="elapsedRealTime">The elapsed real time.</param>
110 /// <param name="totalGameTime">The total game time.</param>
111 /// <param name="elapsedGameTime">The elapsed game time.</param>
112 public GameTime(float totalRealTime, float elapsedRealTime, float totalGameTime, float elapsedGameTime)
114 TotalRealTime = totalRealTime;
115 ElapsedRealTime = elapsedRealTime;
116 TotalGameTime = totalGameTime;
117 ElapsedGameTime = elapsedGameTime;