Make frame time in Renderer a property, update TestGame.
This commit is contained in:
@@ -100,7 +100,7 @@ namespace DaggerFramework.Rendering
|
||||
Raylib.ClearBackground(DaggerColorToRaylibColor(color));
|
||||
}
|
||||
|
||||
public override double GetFrameTime()
|
||||
protected override double GetFrameTime()
|
||||
{
|
||||
return (double)Raylib.GetFrameTime();
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace DaggerFramework.Rendering
|
||||
/// </summary>
|
||||
public abstract int TargetFps { get; set; }
|
||||
public abstract bool VSync { get; set; }
|
||||
public double FrameTime => GetFrameTime();
|
||||
|
||||
// WINDOW
|
||||
/// <summary>
|
||||
@@ -52,6 +53,7 @@ namespace DaggerFramework.Rendering
|
||||
protected abstract void SetWindowTitle(string title);
|
||||
protected abstract void SetWindowVSync(bool value);
|
||||
protected abstract void SetTargetFps(int fps);
|
||||
protected abstract double GetFrameTime();
|
||||
protected abstract int GetMonitorWidth(int monitorId);
|
||||
protected abstract int GetMonitorHeight(int monitorId);
|
||||
protected abstract int GetCurrentMonitor();
|
||||
@@ -76,7 +78,6 @@ namespace DaggerFramework.Rendering
|
||||
/// </summary>
|
||||
/// <param name="color">Background color.</param>
|
||||
public abstract void ClearBackground(Color color);
|
||||
public abstract double GetFrameTime();
|
||||
|
||||
/// <summary>
|
||||
/// Loads the texture onto the GPU for later use in DrawTexture or other Texture related methods.
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace DaggerFramework.Rendering
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override double GetFrameTime()
|
||||
protected override double GetFrameTime()
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace DaggerFramework.SceneGraph
|
||||
public AudioBackend Audio => _audioBackend;
|
||||
public ResourceManager ResourceManager => _resourceManager;
|
||||
|
||||
public double DeltaTime => Renderer.GetFrameTime();
|
||||
public double DeltaTime => _renderer.FrameTime;
|
||||
public bool ShouldRun => Renderer.ShouldRun;
|
||||
|
||||
public Scene(Renderer renderer, InputHandler input, AudioBackend audioBackend, ResourceManager resourceManager)
|
||||
|
||||
Reference in New Issue
Block a user