Fix MathUtils.LerpVector2, add cameras.

This commit is contained in:
2023-09-25 18:32:36 +02:00
parent 34c65be667
commit 6b5678cdb8
12 changed files with 139 additions and 7 deletions

View File

@@ -52,6 +52,17 @@ namespace DaggerFramework.Rendering
Raylib.EndDrawing();
}
public override void BeginCamera2d(Vector2 offset, Vector2 target, float rotation, float zoom)
{
var camera = new Camera2D(offset, target, rotation, zoom);
Raylib.BeginMode2D(camera);
}
public override void EndCamera2d()
{
Raylib.EndMode2D();
}
public override void ClearBackground(Color color)
{
Raylib.ClearBackground(DaggerColorToRaylibColor(color));

View File

@@ -58,6 +58,10 @@ namespace DaggerFramework.Rendering
/// Ends rendering of the frame.
/// </summary>
public abstract void EndFrame();
public abstract void BeginCamera2d(Vector2 offset, Vector2 target, float rotation, float zoom);
public abstract void EndCamera2d();
/// <summary>
/// Clears the render canvas and sets a background color.
/// </summary>

View File

@@ -166,6 +166,17 @@ namespace DaggerFramework.Rendering
throw new NotImplementedException();
}
public override void BeginCamera2d(Vector2 offset, Vector2 target, float rotation, float zoom)
{
throw new NotImplementedException();
}
public override void EndCamera2d()
{
throw new NotImplementedException();
}
private GL _gl;
private Glfw _glfw;
private unsafe WindowHandle* _windowHandle;