Skip to content

Commit c92fecc

Browse files
committed
Add RlImGui
Signed-off-by: Tomas Slusny <[email protected]>
1 parent 202210a commit c92fecc

File tree

6 files changed

+690
-5
lines changed

6 files changed

+690
-5
lines changed

Raylib.NET.sln

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.0.31903.59
@@ -15,6 +15,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raylib.NET.Test", "src\Rayl
1515
EndProject
1616
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raylib.NET", "src\Raylib.NET\Raylib.NET.csproj", "{5A3CE360-CC8F-4ADD-B342-FD6A3246C7B9}"
1717
EndProject
18+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raylib.NET.ImGui", "src\Raylib.NET.ImGui\Raylib.NET.ImGui.csproj", "{12F7083B-FA8B-4B3E-BA43-D02237649DF7}"
19+
EndProject
1820
Global
1921
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2022
Debug|Any CPU = Debug|Any CPU
@@ -44,16 +46,21 @@ Global
4446
{29E68756-5677-461E-8E54-8017E9FBFEED}.Debug|Any CPU.Build.0 = Debug|Any CPU
4547
{29E68756-5677-461E-8E54-8017E9FBFEED}.Release|Any CPU.ActiveCfg = Release|Any CPU
4648
{29E68756-5677-461E-8E54-8017E9FBFEED}.Release|Any CPU.Build.0 = Release|Any CPU
49+
{12F7083B-FA8B-4B3E-BA43-D02237649DF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50+
{12F7083B-FA8B-4B3E-BA43-D02237649DF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
51+
{12F7083B-FA8B-4B3E-BA43-D02237649DF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
52+
{12F7083B-FA8B-4B3E-BA43-D02237649DF7}.Release|Any CPU.Build.0 = Release|Any CPU
4753
EndGlobalSection
4854
GlobalSection(NestedProjects) = preSolution
4955
{0A7DD14F-8EED-4688-8931-38AA1B940DCB} = {DA7DD588-77B2-465A-8BCF-BE3295552258}
5056
{5A3CE360-CC8F-4ADD-B342-FD6A3246C7B9} = {DA7DD588-77B2-465A-8BCF-BE3295552258}
5157
{DE44EB33-70C2-402D-9FBB-36A6CD713B4F} = {DA7DD588-77B2-465A-8BCF-BE3295552258}
5258
{0EE0C0FD-F7B7-42C9-8B63-095A066C0800} = {DA7DD588-77B2-465A-8BCF-BE3295552258}
5359
{29E68756-5677-461E-8E54-8017E9FBFEED} = {DA7DD588-77B2-465A-8BCF-BE3295552258}
60+
{12F7083B-FA8B-4B3E-BA43-D02237649DF7} = {DA7DD588-77B2-465A-8BCF-BE3295552258}
61+
EndGlobalSection
62+
GlobalSection(ProjectDependencies) = postSolution
63+
{5A3CE360-CC8F-4ADD-B342-FD6A3246C7B9}.0 = {DE44EB33-70C2-402D-9FBB-36A6CD713B4F}
64+
{29E68756-5677-461E-8E54-8017E9FBFEED}.0 = {DE44EB33-70C2-402D-9FBB-36A6CD713B4F}
5465
EndGlobalSection
55-
GlobalSection(ProjectDependencies) = postSolution
56-
{5A3CE360-CC8F-4ADD-B342-FD6A3246C7B9}.0 = {DE44EB33-70C2-402D-9FBB-36A6CD713B4F}
57-
{29E68756-5677-461E-8E54-8017E9FBFEED}.0 = {DE44EB33-70C2-402D-9FBB-36A6CD713B4F}
58-
EndGlobalSection
5966
EndGlobal
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using RaylibNET;
2+
using static RaylibNET.Raylib;
3+
4+
InitWindow(800, 600, "Raylib.NET.ImGui - Example");
5+
SetTargetFPS(60);
6+
7+
RaylibNET.RlImGui.Setup();
8+
9+
int counter = 0;
10+
bool showDemo = true;
11+
12+
while (!WindowShouldClose())
13+
{
14+
BeginDrawing();
15+
ClearBackground(Color.DARKGRAY);
16+
17+
// Start ImGui frame
18+
RaylibNET.RlImGui.Begin();
19+
20+
if (ImGuiNET.ImGui.Button("Increment Counter"))
21+
{
22+
counter++;
23+
}
24+
ImGuiNET.ImGui.SameLine();
25+
ImGuiNET.ImGui.Text($"Counter: {counter}");
26+
27+
ImGuiNET.ImGui.Checkbox("Show ImGui Demo Window", ref showDemo);
28+
if (showDemo)
29+
{
30+
ImGuiNET.ImGui.ShowDemoWindow(ref showDemo);
31+
}
32+
33+
// End ImGui frame and render
34+
RaylibNET.RlImGui.End();
35+
36+
EndDrawing();
37+
}
38+
39+
CloseWindow();
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>Exe</OutputType>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
8+
<IsPackable>false</IsPackable>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Raylib.NET.Native" Version="*-build.*" />
13+
<ProjectReference Include="..\Raylib.NET\Raylib.NET.csproj" />
14+
<ProjectReference Include="..\Raylib.NET.ImGui\Raylib.NET.ImGui.csproj" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<Content Include="assets/**/*.*">
19+
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
20+
</Content>
21+
</ItemGroup>
22+
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Window][Debug##Default]
2+
Pos=60,60
3+
Size=400,400
4+
Collapsed=0
5+
6+
[Window][Dear ImGui Demo]
7+
Pos=781,88
8+
Size=550,680
9+
Collapsed=0
10+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>net8.0</TargetFramework>
4+
<ImplicitUsings>enable</ImplicitUsings>
5+
<Nullable>enable</Nullable>
6+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
7+
<IsPackable>false</IsPackable>
8+
<Description>ImGui integration for Raylib.NET</Description>
9+
</PropertyGroup>
10+
<ItemGroup>
11+
<ProjectReference Include="..\Raylib.NET\Raylib.NET.csproj" />
12+
</ItemGroup>
13+
<ItemGroup>
14+
<PackageReference Include="ImGui.NET" Version="1.91.6.1" />
15+
</ItemGroup>
16+
</Project>

0 commit comments

Comments
 (0)