Interface ITime
Namespace: GameCanvas
Assembly: GameCanvas.dll
Syntax
public interface ITime
Properties
CurrentFrame
アプリ起動からの累計フレーム数
Declaration
int CurrentFrame { get; }
Property Value
Type | Description |
---|---|
Int32 |
CurrentTime
現在フレームの日時
Declaration
DateTimeOffset CurrentTime { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset |
CurrentTimestamp
現在フレームのUnixタイムスタンプ
Declaration
long CurrentTimestamp { get; }
Property Value
Type | Description |
---|---|
Int64 |
NowTime
現在(関数呼び出し時点)の日時
Declaration
DateTimeOffset NowTime { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset |
TargetFrameInterval
フレーム更新間隔の目標値(秒)
Declaration
double TargetFrameInterval { get; }
Property Value
Type | Description |
---|---|
Double |
TargetFrameRate
フレームレート(1秒あたりのフレーム数)の目標値
Declaration
int TargetFrameRate { get; }
Property Value
Type | Description |
---|---|
Int32 |
TimeSincePrevFrame
ひとつ前のフレームからの経過時間(秒)
Declaration
float TimeSincePrevFrame { get; }
Property Value
Type | Description |
---|---|
Single |
TimeSinceStartup
現在フレームのアプリ起動からの経過時間(秒)
Declaration
float TimeSinceStartup { get; }
Property Value
Type | Description |
---|---|
Single |
VSyncEnabled
垂直同期の有無
Declaration
bool VSyncEnabled { get; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
この設定は、SetFrameInterval(Double, Boolean) や SetFrameRate(Int32, Boolean) の第二引数から変更できます。
Methods
SetFrameInterval(Double, Boolean)
UpdateGame や DrawGame が呼び出される時間間隔を設定します。
Declaration
void SetFrameInterval(in double targetDeltaTime, bool vSyncEnabled = true)
Parameters
Type | Name | Description |
---|---|---|
Double | targetDeltaTime | フレーム更新間隔の目標値(秒) |
Boolean | vSyncEnabled | 垂直同期の有無 |
Remarks
垂直同期を無効にした場合、間隔の揺らぎは減少しますが、ディスプレイのリフレッシュレートを常に無視して描画するため、画面のちらつきが発生する場合があります。
SetFrameRate(Int32, Boolean)
フレームレートの目標値を設定します。
小数点以下を指定したい場合は、この関数の代わりに SetFrameInterval(Double, Boolean) を使用してください。
Declaration
void SetFrameRate(in int targetFrameRate, bool vSyncEnabled = true)
Parameters
Type | Name | Description |
---|---|---|
Int32 | targetFrameRate | フレームレート(1秒あたりのフレーム数)の目標値 |
Boolean | vSyncEnabled | 垂直同期の有無 |
Remarks
垂直同期を無効にした場合、間隔の揺らぎは減少しますが、ディスプレイのリフレッシュレートを常に無視して描画するため、画面のちらつきが発生する場合があります。