From 34bfcd07294093d589d6a68c1ffae66609d655d1 Mon Sep 17 00:00:00 2001 From: anggape Date: Mon, 14 Aug 2023 00:28:50 +0700 Subject: [PATCH] add examples project --- Raylib-cs.Examples.Desktop/Program.cs | 4 +++ .../Raylib-cs.Examples.Desktop.csproj | 15 +++++++++ Raylib-cs.Examples/Raylib-cs.Examples.csproj | 14 ++++++++ Raylib-cs.Examples/Samples.cs | 32 +++++++++++++++++++ Raylib-cs.sln | 28 ++++++++++++++++ 5 files changed, 93 insertions(+) create mode 100644 Raylib-cs.Examples.Desktop/Program.cs create mode 100644 Raylib-cs.Examples.Desktop/Raylib-cs.Examples.Desktop.csproj create mode 100644 Raylib-cs.Examples/Raylib-cs.Examples.csproj create mode 100644 Raylib-cs.Examples/Samples.cs diff --git a/Raylib-cs.Examples.Desktop/Program.cs b/Raylib-cs.Examples.Desktop/Program.cs new file mode 100644 index 0000000..eaeaacc --- /dev/null +++ b/Raylib-cs.Examples.Desktop/Program.cs @@ -0,0 +1,4 @@ +using Raylib_cs.Examples; + +using (var samples = new Samples()) + samples.Run(); diff --git a/Raylib-cs.Examples.Desktop/Raylib-cs.Examples.Desktop.csproj b/Raylib-cs.Examples.Desktop/Raylib-cs.Examples.Desktop.csproj new file mode 100644 index 0000000..f0521f1 --- /dev/null +++ b/Raylib-cs.Examples.Desktop/Raylib-cs.Examples.Desktop.csproj @@ -0,0 +1,15 @@ + + + + Exe + net7.0 + Raylib_cs.Examples.Desktop + enable + enable + + + + + + + \ No newline at end of file diff --git a/Raylib-cs.Examples/Raylib-cs.Examples.csproj b/Raylib-cs.Examples/Raylib-cs.Examples.csproj new file mode 100644 index 0000000..45a0bf4 --- /dev/null +++ b/Raylib-cs.Examples/Raylib-cs.Examples.csproj @@ -0,0 +1,14 @@ + + + + net7.0 + Raylib_cs.Examples + enable + enable + + + + + + + \ No newline at end of file diff --git a/Raylib-cs.Examples/Samples.cs b/Raylib-cs.Examples/Samples.cs new file mode 100644 index 0000000..5fb3e6b --- /dev/null +++ b/Raylib-cs.Examples/Samples.cs @@ -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(); + } +} diff --git a/Raylib-cs.sln b/Raylib-cs.sln index 823188f..5ec87e9 100644 --- a/Raylib-cs.sln +++ b/Raylib-cs.sln @@ -7,6 +7,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raylib-cs", "Raylib-cs\Rayl EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raylib-cs.Tests", "Raylib-cs.Tests\Raylib-cs.Tests.csproj", "{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raylib-cs.Examples", "Raylib-cs.Examples\Raylib-cs.Examples.csproj", "{EE8D1328-A59D-42A8-877C-1F71BBCBD0DE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raylib-cs.Examples.Desktop", "Raylib-cs.Examples.Desktop\Raylib-cs.Examples.Desktop.csproj", "{0C6DD775-B5D5-400B-82EA-D48DFEBED202}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -25,6 +29,30 @@ Global {523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Release|Any CPU.Build.0 = Release|Any CPU {523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EE8D1328-A59D-42A8-877C-1F71BBCBD0DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EE8D1328-A59D-42A8-877C-1F71BBCBD0DE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EE8D1328-A59D-42A8-877C-1F71BBCBD0DE}.Debug|x64.ActiveCfg = Debug|Any CPU + {EE8D1328-A59D-42A8-877C-1F71BBCBD0DE}.Debug|x64.Build.0 = Debug|Any CPU + {EE8D1328-A59D-42A8-877C-1F71BBCBD0DE}.Debug|x86.ActiveCfg = Debug|Any CPU + {EE8D1328-A59D-42A8-877C-1F71BBCBD0DE}.Debug|x86.Build.0 = Debug|Any CPU + {EE8D1328-A59D-42A8-877C-1F71BBCBD0DE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EE8D1328-A59D-42A8-877C-1F71BBCBD0DE}.Release|Any CPU.Build.0 = Release|Any CPU + {EE8D1328-A59D-42A8-877C-1F71BBCBD0DE}.Release|x64.ActiveCfg = Release|Any CPU + {EE8D1328-A59D-42A8-877C-1F71BBCBD0DE}.Release|x64.Build.0 = Release|Any CPU + {EE8D1328-A59D-42A8-877C-1F71BBCBD0DE}.Release|x86.ActiveCfg = Release|Any CPU + {EE8D1328-A59D-42A8-877C-1F71BBCBD0DE}.Release|x86.Build.0 = Release|Any CPU + {0C6DD775-B5D5-400B-82EA-D48DFEBED202}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0C6DD775-B5D5-400B-82EA-D48DFEBED202}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0C6DD775-B5D5-400B-82EA-D48DFEBED202}.Debug|x64.ActiveCfg = Debug|Any CPU + {0C6DD775-B5D5-400B-82EA-D48DFEBED202}.Debug|x64.Build.0 = Debug|Any CPU + {0C6DD775-B5D5-400B-82EA-D48DFEBED202}.Debug|x86.ActiveCfg = Debug|Any CPU + {0C6DD775-B5D5-400B-82EA-D48DFEBED202}.Debug|x86.Build.0 = Debug|Any CPU + {0C6DD775-B5D5-400B-82EA-D48DFEBED202}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0C6DD775-B5D5-400B-82EA-D48DFEBED202}.Release|Any CPU.Build.0 = Release|Any CPU + {0C6DD775-B5D5-400B-82EA-D48DFEBED202}.Release|x64.ActiveCfg = Release|Any CPU + {0C6DD775-B5D5-400B-82EA-D48DFEBED202}.Release|x64.Build.0 = Release|Any CPU + {0C6DD775-B5D5-400B-82EA-D48DFEBED202}.Release|x86.ActiveCfg = Release|Any CPU + {0C6DD775-B5D5-400B-82EA-D48DFEBED202}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE