Skip to content

Commit 81ba9bd

Browse files
authored
Merge pull request #80 from MonoGame-Extended/feature/monogame-example
Add MonoGame Example
2 parents 34095a3 + ec4d296 commit 81ba9bd

File tree

7 files changed

+1063
-0
lines changed

7 files changed

+1063
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using Hexa.NET.ImGui;
2+
using Microsoft.Xna.Framework.Graphics;
3+
4+
namespace ExampleMonoGame;
5+
6+
public static class DrawVertDeclaration
7+
{
8+
public static readonly VertexDeclaration Declaration;
9+
10+
public static readonly int Size;
11+
12+
static unsafe DrawVertDeclaration()
13+
{
14+
Size = sizeof(ImDrawVert);
15+
16+
VertexElement position = new VertexElement(0, VertexElementFormat.Vector2, VertexElementUsage.Position, 0);
17+
VertexElement uv = new VertexElement(8, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0);
18+
VertexElement color = new VertexElement(16, VertexElementFormat.Color, VertexElementUsage.Color, 0);
19+
20+
Declaration = new VertexDeclaration(Size, position, uv, color);
21+
}
22+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>WinExe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<RollForward>Major</RollForward>
7+
<PublishReadyToRun>false</PublishReadyToRun>
8+
<TieredCompilation>false</TieredCompilation>
9+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<!-- package reference for StrBuilder. If not using it, don't need it-->
14+
<PackageReference Include="Hexa.NET.Utilities" Version="2.2.2" />
15+
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.*" />
16+
</ItemGroup>
17+
18+
<ItemGroup>
19+
<ProjectReference Include="..\..\Hexa.NET.ImGui\Hexa.NET.ImGui.csproj" />
20+
</ItemGroup>
21+
</Project>

0 commit comments

Comments
 (0)