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

@@ -7,4 +7,8 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="Raylib-cs" Version="8.0.0" />
</ItemGroup>
</Project> </Project>

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);
}
}
}

View File

@@ -0,0 +1,68 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v10.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v10.0": {
"PhysicsEngine/1.0.0": {
"dependencies": {
"Raylib-cs": "8.0.0"
},
"runtime": {
"PhysicsEngine.dll": {}
}
},
"Raylib-cs/8.0.0": {
"runtime": {
"lib/net10.0/Raylib-cs.dll": {
"assemblyVersion": "0.0.0.0",
"fileVersion": "0.0.0.0"
}
},
"runtimeTargets": {
"runtimes/linux-x64/native/libraylib.so": {
"rid": "linux-x64",
"assetType": "native",
"fileVersion": "0.0.0.0"
},
"runtimes/osx-arm64/native/libraylib.dylib": {
"rid": "osx-arm64",
"assetType": "native",
"fileVersion": "0.0.0.0"
},
"runtimes/osx-x64/native/libraylib.dylib": {
"rid": "osx-x64",
"assetType": "native",
"fileVersion": "0.0.0.0"
},
"runtimes/win-x64/native/raylib.dll": {
"rid": "win-x64",
"assetType": "native",
"fileVersion": "0.0.0.0"
},
"runtimes/win-x86/native/raylib.dll": {
"rid": "win-x86",
"assetType": "native",
"fileVersion": "0.0.0.0"
}
}
}
}
},
"libraries": {
"PhysicsEngine/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"Raylib-cs/8.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-m+fStTZjOGtkx05RNflERtKbmEUrIZ5/PFV5QXnlA02kAEwxxOC+XhNeCSZJhaGHu9d8m0eTMmefRhHueS3hkg==",
"path": "raylib-cs/8.0.0",
"hashPath": "raylib-cs.8.0.0.nupkg.sha512"
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,12 @@
{
"runtimeOptions": {
"tfm": "net10.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "10.0.0"
},
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v10.0", FrameworkDisplayName = ".NET 10.0")]

View File

@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("PhysicsEngine")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+b88c9b3581c79bcf7dab83ce9a4a3ddfe9b5c791")]
[assembly: System.Reflection.AssemblyProductAttribute("PhysicsEngine")]
[assembly: System.Reflection.AssemblyTitleAttribute("PhysicsEngine")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.

View File

@@ -0,0 +1 @@
6e7f12d0a748e6f800b5c90b709ee56dda6d5016d01ed56969641ea0c3b50864

View File

@@ -0,0 +1,17 @@
is_global = true
build_property.TargetFramework = net10.0
build_property.TargetFrameworkIdentifier = .NETCoreApp
build_property.TargetFrameworkVersion = v10.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = PhysicsEngine
build_property.ProjectDir = C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.EffectiveAnalysisLevelStyle = 10.0
build_property.EnableCodeStyleSeverity =

View File

@@ -0,0 +1,8 @@
// <auto-generated/>
global using System;
global using System.Collections.Generic;
global using System.IO;
global using System.Linq;
global using System.Net.Http;
global using System.Threading;
global using System.Threading.Tasks;

View File

@@ -0,0 +1 @@
e0ab312c01de0fc5b913a50944f6e9e9f433b7e80a2ed356c2dd839872cf6c9d

View File

@@ -0,0 +1,22 @@
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\bin\Debug\net10.0\PhysicsEngine.exe
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\bin\Debug\net10.0\PhysicsEngine.deps.json
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\bin\Debug\net10.0\PhysicsEngine.runtimeconfig.json
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\bin\Debug\net10.0\PhysicsEngine.dll
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\bin\Debug\net10.0\PhysicsEngine.pdb
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\obj\Debug\net10.0\PhysicsEngine.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\obj\Debug\net10.0\PhysicsEngine.AssemblyInfoInputs.cache
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\obj\Debug\net10.0\PhysicsEngine.AssemblyInfo.cs
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\obj\Debug\net10.0\PhysicsEngine.csproj.CoreCompileInputs.cache
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\obj\Debug\net10.0\PhysicsEngine.dll
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\obj\Debug\net10.0\refint\PhysicsEngine.dll
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\obj\Debug\net10.0\PhysicsEngine.pdb
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\obj\Debug\net10.0\PhysicsEngine.genruntimeconfig.cache
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\obj\Debug\net10.0\ref\PhysicsEngine.dll
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\bin\Debug\net10.0\Raylib-cs.dll
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\bin\Debug\net10.0\runtimes\linux-x64\native\libraylib.so
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\bin\Debug\net10.0\runtimes\osx-arm64\native\libraylib.dylib
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\bin\Debug\net10.0\runtimes\osx-x64\native\libraylib.dylib
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\bin\Debug\net10.0\runtimes\win-x64\native\raylib.dll
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\bin\Debug\net10.0\runtimes\win-x86\native\raylib.dll
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\obj\Debug\net10.0\PhysicsEngine.csproj.AssemblyReference.cache
C:\Users\maxwes08\source\repos\Physics-Engine\Physics-Engine\PhysicsEngine\obj\Debug\net10.0\PhysicsE.CA49F505.Up2Date

Binary file not shown.

View File

@@ -0,0 +1 @@
e7eef5f4e79a0494c21170ebb5e4e3181fcde6e607179c48869e445b1eefb095

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -45,6 +45,12 @@
"frameworks": { "frameworks": {
"net10.0": { "net10.0": {
"targetAlias": "net10.0", "targetAlias": "net10.0",
"dependencies": {
"Raylib-cs": {
"target": "Package",
"version": "[8.0.0, )"
}
},
"imports": [ "imports": [
"net461", "net461",
"net462", "net462",

View File

@@ -1,11 +1,72 @@
{ {
"version": 3, "version": 3,
"targets": { "targets": {
"net10.0": {} "net10.0": {
"Raylib-cs/8.0.0": {
"type": "package",
"compile": {
"lib/net10.0/Raylib-cs.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/net10.0/Raylib-cs.dll": {
"related": ".xml"
}
},
"runtimeTargets": {
"runtimes/linux-x64/native/libraylib.so": {
"assetType": "native",
"rid": "linux-x64"
},
"runtimes/osx-arm64/native/libraylib.dylib": {
"assetType": "native",
"rid": "osx-arm64"
},
"runtimes/osx-x64/native/libraylib.dylib": {
"assetType": "native",
"rid": "osx-x64"
},
"runtimes/win-x64/native/raylib.dll": {
"assetType": "native",
"rid": "win-x64"
},
"runtimes/win-x86/native/raylib.dll": {
"assetType": "native",
"rid": "win-x86"
}
}
}
}
},
"libraries": {
"Raylib-cs/8.0.0": {
"sha512": "m+fStTZjOGtkx05RNflERtKbmEUrIZ5/PFV5QXnlA02kAEwxxOC+XhNeCSZJhaGHu9d8m0eTMmefRhHueS3hkg==",
"type": "package",
"path": "raylib-cs/8.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"README.md",
"lib/net10.0/Raylib-cs.dll",
"lib/net10.0/Raylib-cs.xml",
"lib/net8.0/Raylib-cs.dll",
"lib/net8.0/Raylib-cs.xml",
"raylib-cs.8.0.0.nupkg.sha512",
"raylib-cs.nuspec",
"raylib-cs_64x64.png",
"runtimes/linux-x64/native/libraylib.so",
"runtimes/osx-arm64/native/libraylib.dylib",
"runtimes/osx-x64/native/libraylib.dylib",
"runtimes/win-x64/native/raylib.dll",
"runtimes/win-x86/native/raylib.dll"
]
}
}, },
"libraries": {},
"projectFileDependencyGroups": { "projectFileDependencyGroups": {
"net10.0": [] "net10.0": [
"Raylib-cs >= 8.0.0"
]
}, },
"packageFolders": { "packageFolders": {
"C:\\Users\\maxwes08\\.nuget\\packages\\": {} "C:\\Users\\maxwes08\\.nuget\\packages\\": {}
@@ -51,6 +112,12 @@
"frameworks": { "frameworks": {
"net10.0": { "net10.0": {
"targetAlias": "net10.0", "targetAlias": "net10.0",
"dependencies": {
"Raylib-cs": {
"target": "Package",
"version": "[8.0.0, )"
}
},
"imports": [ "imports": [
"net461", "net461",
"net462", "net462",

View File

@@ -1,8 +1,10 @@
{ {
"version": 2, "version": 2,
"dgSpecHash": "/OGcwBNFGPA=", "dgSpecHash": "+GLC3EnolcY=",
"success": true, "success": true,
"projectFilePath": "C:\\Users\\maxwes08\\source\\repos\\Physics-Engine\\Physics-Engine\\PhysicsEngine\\PhysicsEngine.csproj", "projectFilePath": "C:\\Users\\maxwes08\\source\\repos\\Physics-Engine\\Physics-Engine\\PhysicsEngine\\PhysicsEngine.csproj",
"expectedPackageFiles": [], "expectedPackageFiles": [
"C:\\Users\\maxwes08\\.nuget\\packages\\raylib-cs\\8.0.0\\raylib-cs.8.0.0.nupkg.sha512"
],
"logs": [] "logs": []
} }

View File

@@ -1,61 +0,0 @@
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);
}
}
}