Watch
2
0
Fork
You've already forked raylib-cs
0

add examples project

This commit is contained in:
anggape 2023-08-14 00:28:50 +07:00
commit 34bfcd0729
No known key found for this signature in database
GPG key ID: 318EF680D0181D86
5 changed files with 93 additions and 0 deletions

View file

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>Raylib_cs.Examples</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../Raylib-cs/Raylib-cs.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,32 @@
namespace Raylib_cs.Examples;
public sealed class Samples : IDisposable
{
public Samples()
{
Raylib.InitWindow(800, 450, nameof(Samples));
Raylib.SetTargetFPS(60);
}
public void Run()
{
while (!Raylib.WindowShouldClose())
{
Raylib.BeginDrawing();
Raylib.ClearBackground(Color.RAYWHITE);
Raylib.DrawText(
"Congrats! You created your first window!",
190,
200,
20,
Color.LIGHTGRAY
);
Raylib.EndDrawing();
}
}
public void Dispose()
{
Raylib.CloseWindow();
}
}