add examples project
This commit is contained in:
parent
1df4b9b395
commit
34bfcd0729
5 changed files with 93 additions and 0 deletions
14
Raylib-cs.Examples/Raylib-cs.Examples.csproj
Normal file
14
Raylib-cs.Examples/Raylib-cs.Examples.csproj
Normal 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>
|
||||
32
Raylib-cs.Examples/Samples.cs
Normal file
32
Raylib-cs.Examples/Samples.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue