added raylib and working boilerplate
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user