added raylib and working boilerplate

This commit is contained in:
maxwes08
2026-09-02 12:44:42 +02:00
parent b88c9b3581
commit 5680beef02
33 changed files with 301 additions and 67 deletions

View File

@@ -1 +1,61 @@
Console.WriteLine("Hello, World!");
using Raylib_cs;
namespace PhysicsEngine
{
class Program
{
static void Main(string[] args)
{
const int screenWidth = 1280;
const int screenHeight = 720;
Raylib.InitWindow(screenWidth, screenHeight, "Fysikmotor & Sandlåda");
Raylib.SetTargetFPS(144);
const float physicsTimeStep = 1.0f / 60.0f;
float accumulator = 0.0f;
// Main loop
while (!Raylib.WindowShouldClose())
{
float frameTime = Raylib.GetFrameTime();
if (frameTime > 0.25f)
{
frameTime = 0.25f;
}
accumulator += frameTime;
// Update loop
while (accumulator >= physicsTimeStep)
{
UpdatePhysics(physicsTimeStep);
accumulator -= physicsTimeStep;
}
// Render loop
Raylib.BeginDrawing();
Raylib.ClearBackground(Color.RayWhite);
// Draw
RenderScene();
Raylib.EndDrawing();
}
// Close
Raylib.CloseWindow();
}
private static void UpdatePhysics(float dt)
{
}
private static void RenderScene()
{
Raylib.DrawText("Physics Engine", 20, 20, 20, Color.DarkGray);
}
}
}