restructure graphics tests
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,153 +0,0 @@
|
|||
using MoonWorks;
|
||||
using MoonWorks.Graphics;
|
||||
using MoonWorks.Math.Float;
|
||||
|
||||
namespace MoonWorks.Test
|
||||
{
|
||||
class BasicComputeGame : Game
|
||||
{
|
||||
private GraphicsPipeline drawPipeline;
|
||||
private Texture texture;
|
||||
private Sampler sampler;
|
||||
private GpuBuffer vertexBuffer;
|
||||
|
||||
public BasicComputeGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
// Create the compute pipeline that writes texture data
|
||||
ShaderModule fillTextureComputeShaderModule = new ShaderModule(
|
||||
GraphicsDevice,
|
||||
TestUtils.GetShaderPath("FillTexture.comp")
|
||||
);
|
||||
|
||||
ComputePipeline fillTextureComputePipeline = new ComputePipeline(
|
||||
GraphicsDevice,
|
||||
ComputeShaderInfo.Create(fillTextureComputeShaderModule, "main", 0, 1)
|
||||
);
|
||||
|
||||
// Create the compute pipeline that calculates squares of numbers
|
||||
ShaderModule calculateSquaresComputeShaderModule = new ShaderModule(
|
||||
GraphicsDevice,
|
||||
TestUtils.GetShaderPath("CalculateSquares.comp")
|
||||
);
|
||||
|
||||
ComputePipeline calculateSquaresComputePipeline = new ComputePipeline(
|
||||
GraphicsDevice,
|
||||
ComputeShaderInfo.Create(calculateSquaresComputeShaderModule, "main", 1, 0)
|
||||
);
|
||||
|
||||
// Create the graphics pipeline
|
||||
ShaderModule vertShaderModule = new ShaderModule(
|
||||
GraphicsDevice,
|
||||
TestUtils.GetShaderPath("TexturedQuad.vert")
|
||||
);
|
||||
|
||||
ShaderModule fragShaderModule = new ShaderModule(
|
||||
GraphicsDevice,
|
||||
TestUtils.GetShaderPath("TexturedQuad.frag")
|
||||
);
|
||||
|
||||
GraphicsPipelineCreateInfo drawPipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo(
|
||||
MainWindow.SwapchainFormat,
|
||||
vertShaderModule,
|
||||
fragShaderModule
|
||||
);
|
||||
drawPipelineCreateInfo.VertexInputState = VertexInputState.CreateSingleBinding<PositionTextureVertex>();
|
||||
drawPipelineCreateInfo.FragmentShaderInfo.SamplerBindingCount = 1;
|
||||
|
||||
drawPipeline = new GraphicsPipeline(
|
||||
GraphicsDevice,
|
||||
drawPipelineCreateInfo
|
||||
);
|
||||
|
||||
// Create buffers and textures
|
||||
uint[] squares = new uint[64];
|
||||
GpuBuffer squaresBuffer = GpuBuffer.Create<uint>(
|
||||
GraphicsDevice,
|
||||
BufferUsageFlags.Compute,
|
||||
(uint) squares.Length
|
||||
);
|
||||
|
||||
TransferBuffer transferBuffer = new TransferBuffer(
|
||||
GraphicsDevice,
|
||||
TransferUsage.Buffer,
|
||||
squaresBuffer.Size
|
||||
);
|
||||
|
||||
texture = Texture.CreateTexture2D(
|
||||
GraphicsDevice,
|
||||
MainWindow.Width,
|
||||
MainWindow.Height,
|
||||
TextureFormat.R8G8B8A8,
|
||||
TextureUsageFlags.Compute | TextureUsageFlags.Sampler
|
||||
);
|
||||
|
||||
sampler = new Sampler(GraphicsDevice, new SamplerCreateInfo());
|
||||
|
||||
// Upload GPU resources and dispatch compute work
|
||||
var resourceUploader = new ResourceUploader(GraphicsDevice);
|
||||
vertexBuffer = resourceUploader.CreateBuffer(
|
||||
[
|
||||
new PositionTextureVertex(new Vector3(-1, -1, 0), new Vector2(0, 0)),
|
||||
new PositionTextureVertex(new Vector3(1, -1, 0), new Vector2(1, 0)),
|
||||
new PositionTextureVertex(new Vector3(1, 1, 0), new Vector2(1, 1)),
|
||||
new PositionTextureVertex(new Vector3(-1, -1, 0), new Vector2(0, 0)),
|
||||
new PositionTextureVertex(new Vector3(1, 1, 0), new Vector2(1, 1)),
|
||||
new PositionTextureVertex(new Vector3(-1, 1, 0), new Vector2(0, 1)),
|
||||
],
|
||||
BufferUsageFlags.Vertex
|
||||
);
|
||||
|
||||
resourceUploader.Upload();
|
||||
resourceUploader.Dispose();
|
||||
|
||||
CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer();
|
||||
|
||||
cmdbuf.BeginComputePass();
|
||||
|
||||
// This should result in a bright yellow texture!
|
||||
cmdbuf.BindComputePipeline(fillTextureComputePipeline);
|
||||
cmdbuf.BindComputeTextures(new ComputeTextureBinding(texture, WriteOptions.Unsafe));
|
||||
cmdbuf.DispatchCompute(texture.Width / 8, texture.Height / 8, 1);
|
||||
|
||||
// This calculates the squares of the first N integers!
|
||||
cmdbuf.BindComputePipeline(calculateSquaresComputePipeline);
|
||||
cmdbuf.BindComputeBuffers(new ComputeBufferBinding(squaresBuffer, WriteOptions.Unsafe));
|
||||
cmdbuf.DispatchCompute((uint) squares.Length / 8, 1, 1);
|
||||
|
||||
cmdbuf.EndComputePass();
|
||||
|
||||
var fence = GraphicsDevice.SubmitAndAcquireFence(cmdbuf);
|
||||
GraphicsDevice.WaitForFences(fence);
|
||||
GraphicsDevice.ReleaseFence(fence);
|
||||
|
||||
// Print the squares!
|
||||
GraphicsDevice.DownloadFromBuffer(squaresBuffer, transferBuffer, TransferOptions.Unsafe);
|
||||
transferBuffer.GetData<uint>(squares, 0);
|
||||
Logger.LogInfo("Squares of the first " + squares.Length + " integers: " + string.Join(", ", squares));
|
||||
}
|
||||
|
||||
protected override void Update(System.TimeSpan delta) { }
|
||||
|
||||
protected override void Draw(double alpha)
|
||||
{
|
||||
CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer();
|
||||
Texture? backbuffer = cmdbuf.AcquireSwapchainTexture(MainWindow);
|
||||
if (backbuffer != null)
|
||||
{
|
||||
cmdbuf.BeginRenderPass(new ColorAttachmentInfo(backbuffer, WriteOptions.Cycle, Color.CornflowerBlue));
|
||||
cmdbuf.BindGraphicsPipeline(drawPipeline);
|
||||
cmdbuf.BindFragmentSamplers(new TextureSamplerBinding(texture, sampler));
|
||||
cmdbuf.BindVertexBuffers(vertexBuffer);
|
||||
cmdbuf.DrawPrimitives(0, 2);
|
||||
cmdbuf.EndRenderPass();
|
||||
}
|
||||
GraphicsDevice.Submit(cmdbuf);
|
||||
}
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
BasicComputeGame game = new BasicComputeGame();
|
||||
game.Run();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
Before Width: | Height: | Size: 3.0 MiB After Width: | Height: | Size: 3.0 MiB |
Before Width: | Height: | Size: 954 KiB After Width: | Height: | Size: 954 KiB |
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 2.4 MiB After Width: | Height: | Size: 2.4 MiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 802 B After Width: | Height: | Size: 802 B |
Before Width: | Height: | Size: 874 B After Width: | Height: | Size: 874 B |
Before Width: | Height: | Size: 678 B After Width: | Height: | Size: 678 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 2.1 MiB |
Before Width: | Height: | Size: 94 B After Width: | Height: | Size: 94 B |
Before Width: | Height: | Size: 94 B After Width: | Height: | Size: 94 B |
Before Width: | Height: | Size: 94 B After Width: | Height: | Size: 94 B |
Before Width: | Height: | Size: 92 B After Width: | Height: | Size: 92 B |
Before Width: | Height: | Size: 94 B After Width: | Height: | Size: 94 B |
Before Width: | Height: | Size: 94 B After Width: | Height: | Size: 94 B |
Before Width: | Height: | Size: 94 B After Width: | Height: | Size: 94 B |
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
|
@ -0,0 +1,136 @@
|
|||
using MoonWorks;
|
||||
using MoonWorks.Graphics;
|
||||
|
||||
namespace MoonWorksGraphicsTests;
|
||||
|
||||
public static class TestUtils
|
||||
{
|
||||
// change this to test different backends
|
||||
public static BackendFlags PreferredBackends = BackendFlags.Vulkan | BackendFlags.D3D11 | BackendFlags.Metal;
|
||||
|
||||
public static WindowCreateInfo GetStandardWindowCreateInfo()
|
||||
{
|
||||
return new WindowCreateInfo(
|
||||
"Main Window",
|
||||
640,
|
||||
480,
|
||||
ScreenMode.Windowed,
|
||||
SwapchainComposition.SDR,
|
||||
PresentMode.VSync
|
||||
);
|
||||
}
|
||||
|
||||
public static FrameLimiterSettings GetStandardFrameLimiterSettings()
|
||||
{
|
||||
return new FrameLimiterSettings(
|
||||
FrameLimiterMode.Capped,
|
||||
60
|
||||
);
|
||||
}
|
||||
|
||||
public static GraphicsPipelineCreateInfo GetStandardGraphicsPipelineCreateInfo(
|
||||
TextureFormat swapchainFormat,
|
||||
Shader vertShader,
|
||||
Shader fragShader
|
||||
) {
|
||||
return new GraphicsPipelineCreateInfo
|
||||
{
|
||||
AttachmentInfo = new GraphicsPipelineAttachmentInfo(
|
||||
new ColorAttachmentDescription(
|
||||
swapchainFormat,
|
||||
ColorAttachmentBlendState.Opaque
|
||||
)
|
||||
),
|
||||
DepthStencilState = DepthStencilState.Disable,
|
||||
MultisampleState = MultisampleState.None,
|
||||
PrimitiveType = PrimitiveType.TriangleList,
|
||||
RasterizerState = RasterizerState.CCW_CullNone,
|
||||
VertexInputState = VertexInputState.Empty,
|
||||
VertexShader = vertShader,
|
||||
FragmentShader = fragShader
|
||||
};
|
||||
}
|
||||
|
||||
public static string GetShaderPath(string shaderName)
|
||||
{
|
||||
return SDL2.SDL.SDL_GetBasePath() + "Content/Shaders/Compiled/" + shaderName + ".refresh";
|
||||
}
|
||||
|
||||
public static string GetTexturePath(string textureName)
|
||||
{
|
||||
return SDL2.SDL.SDL_GetBasePath() + "Content/Textures/" + textureName;
|
||||
}
|
||||
|
||||
public static string GetVideoPath(string videoName)
|
||||
{
|
||||
return SDL2.SDL.SDL_GetBasePath() + "Content/Videos/" + videoName;
|
||||
}
|
||||
|
||||
public enum ButtonType
|
||||
{
|
||||
Left, // A/left arrow on keyboard, left face button on gamepad
|
||||
Bottom, // S/down arrow on keyboard, bottom face button on gamepad
|
||||
Right // D/right arrow on keyboard, right face button on gamepad
|
||||
}
|
||||
|
||||
public static bool CheckButtonPressed(Input.Inputs inputs, ButtonType buttonType)
|
||||
{
|
||||
bool pressed = false;
|
||||
|
||||
if (buttonType == ButtonType.Left)
|
||||
{
|
||||
pressed = (
|
||||
(inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadLeft.IsPressed) ||
|
||||
inputs.Keyboard.IsPressed(Input.KeyCode.Left)
|
||||
);
|
||||
}
|
||||
else if (buttonType == ButtonType.Bottom)
|
||||
{
|
||||
pressed = (
|
||||
(inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadDown.IsPressed) ||
|
||||
inputs.Keyboard.IsPressed(Input.KeyCode.Down)
|
||||
);
|
||||
}
|
||||
else if (buttonType == ButtonType.Right)
|
||||
{
|
||||
pressed = (
|
||||
(inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadRight.IsPressed) ||
|
||||
inputs.Keyboard.IsPressed(Input.KeyCode.Right)
|
||||
);
|
||||
}
|
||||
|
||||
return pressed;
|
||||
}
|
||||
|
||||
public static bool CheckButtonDown(Input.Inputs inputs, ButtonType buttonType)
|
||||
{
|
||||
bool down = false;
|
||||
|
||||
if (buttonType == ButtonType.Left)
|
||||
{
|
||||
down = (
|
||||
(inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadLeft.IsDown) ||
|
||||
inputs.Keyboard.IsDown(Input.KeyCode.A) ||
|
||||
inputs.Keyboard.IsDown(Input.KeyCode.Left)
|
||||
);
|
||||
}
|
||||
else if (buttonType == ButtonType.Bottom)
|
||||
{
|
||||
down = (
|
||||
(inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadDown.IsDown) ||
|
||||
inputs.Keyboard.IsDown(Input.KeyCode.S) ||
|
||||
inputs.Keyboard.IsDown(Input.KeyCode.Down)
|
||||
);
|
||||
}
|
||||
else if (buttonType == ButtonType.Right)
|
||||
{
|
||||
down = (
|
||||
(inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadRight.IsDown) ||
|
||||
inputs.Keyboard.IsDown(Input.KeyCode.D) ||
|
||||
inputs.Keyboard.IsDown(Input.KeyCode.Right)
|
||||
);
|
||||
}
|
||||
|
||||
return down;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
using MoonWorks.Math.Float;
|
||||
|
||||
namespace MoonWorksGraphicsTests;
|
||||
|
||||
public struct TransformVertexUniform
|
||||
{
|
||||
public Matrix4x4 ViewProjection;
|
||||
|
||||
public TransformVertexUniform(Matrix4x4 viewProjection)
|
||||
{
|
||||
ViewProjection = viewProjection;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
using System.Runtime.InteropServices;
|
||||
using MoonWorks.Graphics;
|
||||
using MoonWorks.Math.Float;
|
||||
|
||||
namespace MoonWorksGraphicsTests;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct PositionVertex : IVertexType
|
||||
{
|
||||
public Vector3 Position;
|
||||
|
||||
public PositionVertex(Vector3 position)
|
||||
{
|
||||
Position = position;
|
||||
}
|
||||
|
||||
public static VertexElementFormat[] Formats { get; } = new VertexElementFormat[1]
|
||||
{
|
||||
VertexElementFormat.Vector3
|
||||
};
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Position.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct PositionColorVertex : IVertexType
|
||||
{
|
||||
public Vector3 Position;
|
||||
public Color Color;
|
||||
|
||||
public PositionColorVertex(Vector3 position, Color color)
|
||||
{
|
||||
Position = position;
|
||||
Color = color;
|
||||
}
|
||||
|
||||
public static VertexElementFormat[] Formats { get; } = new VertexElementFormat[2]
|
||||
{
|
||||
VertexElementFormat.Vector3,
|
||||
VertexElementFormat.Color
|
||||
};
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Position + " | " + Color;
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct PositionTextureVertex : IVertexType
|
||||
{
|
||||
public Vector3 Position;
|
||||
public Vector2 TexCoord;
|
||||
|
||||
public PositionTextureVertex(Vector3 position, Vector2 texCoord)
|
||||
{
|
||||
Position = position;
|
||||
TexCoord = texCoord;
|
||||
}
|
||||
|
||||
public static VertexElementFormat[] Formats { get; } = new VertexElementFormat[2]
|
||||
{
|
||||
VertexElementFormat.Vector3,
|
||||
VertexElementFormat.Vector2
|
||||
};
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Position + " | " + TexCoord;
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,17 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,17 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,191 @@
|
|||
using MoonWorks;
|
||||
using MoonWorks.Graphics;
|
||||
using MoonWorks.Math.Float;
|
||||
|
||||
namespace MoonWorksGraphicsTests;
|
||||
|
||||
class BasicComputeExample : Example
|
||||
{
|
||||
private GraphicsPipeline DrawPipeline;
|
||||
private Texture Texture;
|
||||
private Sampler Sampler;
|
||||
private GpuBuffer VertexBuffer;
|
||||
|
||||
public override void Init(Window window, GraphicsDevice graphicsDevice)
|
||||
{
|
||||
Window = window;
|
||||
GraphicsDevice = graphicsDevice;
|
||||
|
||||
// Create the compute pipeline that writes texture data
|
||||
Shader fillTextureComputeShader = new Shader(
|
||||
GraphicsDevice,
|
||||
TestUtils.GetShaderPath("FillTexture.comp"),
|
||||
"main",
|
||||
ShaderStage.Compute,
|
||||
ShaderFormat.SPIRV
|
||||
);
|
||||
|
||||
ComputePipeline fillTextureComputePipeline = new ComputePipeline(
|
||||
GraphicsDevice,
|
||||
fillTextureComputeShader,
|
||||
new ComputePipelineResourceInfo { ReadWriteStorageTextureCount = 1 }
|
||||
);
|
||||
|
||||
fillTextureComputeShader.Dispose();
|
||||
|
||||
// Create the compute pipeline that calculates squares of numbers
|
||||
Shader calculateSquaresComputeShader = new Shader(
|
||||
GraphicsDevice,
|
||||
TestUtils.GetShaderPath("CalculateSquares.comp"),
|
||||
"main",
|
||||
ShaderStage.Compute,
|
||||
ShaderFormat.SPIRV
|
||||
);
|
||||
|
||||
ComputePipeline calculateSquaresComputePipeline = new ComputePipeline(
|
||||
GraphicsDevice,
|
||||
calculateSquaresComputeShader,
|
||||
new ComputePipelineResourceInfo { ReadWriteStorageBufferCount = 1 }
|
||||
);
|
||||
|
||||
calculateSquaresComputeShader.Dispose();
|
||||
|
||||
// Create the graphics pipeline
|
||||
Shader vertShaderModule = new Shader(
|
||||
GraphicsDevice,
|
||||
TestUtils.GetShaderPath("TexturedQuad.vert"),
|
||||
"main",
|
||||
ShaderStage.Vertex,
|
||||
ShaderFormat.SPIRV
|
||||
);
|
||||
|
||||
Shader fragShaderModule = new Shader(
|
||||
GraphicsDevice,
|
||||
TestUtils.GetShaderPath("TexturedQuad.frag"),
|
||||
"main",
|
||||
ShaderStage.Fragment,
|
||||
ShaderFormat.SPIRV
|
||||
);
|
||||
|
||||
GraphicsPipelineCreateInfo drawPipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo(
|
||||
Window.SwapchainFormat,
|
||||
vertShaderModule,
|
||||
fragShaderModule
|
||||
);
|
||||
drawPipelineCreateInfo.VertexInputState = VertexInputState.CreateSingleBinding<PositionTextureVertex>();
|
||||
drawPipelineCreateInfo.FragmentShaderResourceInfo.SamplerCount = 1;
|
||||
|
||||
DrawPipeline = new GraphicsPipeline(
|
||||
GraphicsDevice,
|
||||
drawPipelineCreateInfo
|
||||
);
|
||||
|
||||
// Create buffers and textures
|
||||
uint[] squares = new uint[64];
|
||||
GpuBuffer squaresBuffer = GpuBuffer.Create<uint>(
|
||||
GraphicsDevice,
|
||||
BufferUsageFlags.ComputeStorageWrite,
|
||||
(uint) squares.Length
|
||||
);
|
||||
|
||||
TransferBuffer transferBuffer = new TransferBuffer(
|
||||
GraphicsDevice,
|
||||
TransferUsage.Buffer,
|
||||
TransferBufferMapFlags.Read,
|
||||
squaresBuffer.Size
|
||||
);
|
||||
|
||||
Texture = Texture.CreateTexture2D(
|
||||
GraphicsDevice,
|
||||
Window.Width,
|
||||
Window.Height,
|
||||
TextureFormat.R8G8B8A8,
|
||||
TextureUsageFlags.ComputeStorageWrite | TextureUsageFlags.Sampler
|
||||
);
|
||||
|
||||
Sampler = new Sampler(GraphicsDevice, new SamplerCreateInfo());
|
||||
|
||||
// Upload GPU resources and dispatch compute work
|
||||
var resourceUploader = new ResourceUploader(GraphicsDevice);
|
||||
VertexBuffer = resourceUploader.CreateBuffer(
|
||||
[
|
||||
new PositionTextureVertex(new Vector3(-1, -1, 0), new Vector2(0, 0)),
|
||||
new PositionTextureVertex(new Vector3(1, -1, 0), new Vector2(1, 0)),
|
||||
new PositionTextureVertex(new Vector3(1, 1, 0), new Vector2(1, 1)),
|
||||
new PositionTextureVertex(new Vector3(-1, -1, 0), new Vector2(0, 0)),
|
||||
new PositionTextureVertex(new Vector3(1, 1, 0), new Vector2(1, 1)),
|
||||
new PositionTextureVertex(new Vector3(-1, 1, 0), new Vector2(0, 1)),
|
||||
],
|
||||
BufferUsageFlags.Vertex
|
||||
);
|
||||
|
||||
resourceUploader.Upload();
|
||||
resourceUploader.Dispose();
|
||||
|
||||
CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer();
|
||||
|
||||
// This should result in a bright yellow texture!
|
||||
var computePass = cmdbuf.BeginComputePass(new StorageTextureReadWriteBinding
|
||||
{
|
||||
TextureSlice = Texture,
|
||||
Cycle = false
|
||||
});
|
||||
|
||||
computePass.BindComputePipeline(fillTextureComputePipeline);
|
||||
computePass.Dispatch(Texture.Width / 8, Texture.Height / 8, 1);
|
||||
|
||||
cmdbuf.EndComputePass(computePass);
|
||||
|
||||
// This calculates the squares of the first N integers!
|
||||
computePass = cmdbuf.BeginComputePass(new StorageBufferReadWriteBinding
|
||||
{
|
||||
Buffer = squaresBuffer,
|
||||
Cycle = false
|
||||
});
|
||||
|
||||
computePass.BindComputePipeline(calculateSquaresComputePipeline);
|
||||
computePass.Dispatch((uint) squares.Length / 8, 1, 1);
|
||||
|
||||
cmdbuf.EndComputePass(computePass);
|
||||
|
||||
var copyPass = cmdbuf.BeginCopyPass();
|
||||
|
||||
copyPass.DownloadFromBuffer(squaresBuffer, transferBuffer, new BufferCopy(0, 0, squaresBuffer.Size));
|
||||
|
||||
cmdbuf.EndCopyPass(copyPass);
|
||||
|
||||
var fence = GraphicsDevice.SubmitAndAcquireFence(cmdbuf);
|
||||
GraphicsDevice.WaitForFences(fence);
|
||||
GraphicsDevice.ReleaseFence(fence);
|
||||
|
||||
// Print the squares!
|
||||
transferBuffer.GetData<uint>(squares, 0);
|
||||
Logger.LogInfo("Squares of the first " + squares.Length + " integers: " + string.Join(", ", squares));
|
||||
}
|
||||
|
||||
public override void Update(System.TimeSpan delta) { }
|
||||
|
||||
public override void Draw(double alpha)
|
||||
{
|
||||
CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer();
|
||||
Texture swapchainTexture = cmdbuf.AcquireSwapchainTexture(Window);
|
||||
if (swapchainTexture != null)
|
||||
{
|
||||
var renderPass = cmdbuf.BeginRenderPass(new ColorAttachmentInfo(swapchainTexture, false, Color.CornflowerBlue));
|
||||
renderPass.BindGraphicsPipeline(DrawPipeline);
|
||||
renderPass.BindFragmentSampler(new TextureSamplerBinding(Texture, Sampler));
|
||||
renderPass.BindVertexBuffer(VertexBuffer);
|
||||
renderPass.DrawPrimitives(0, 2);
|
||||
cmdbuf.EndRenderPass(renderPass);
|
||||
}
|
||||
GraphicsDevice.Submit(cmdbuf);
|
||||
}
|
||||
|
||||
public override void Destroy()
|
||||
{
|
||||
DrawPipeline.Dispose();
|
||||
Texture.Dispose();
|
||||
Sampler.Dispose();
|
||||
VertexBuffer.Dispose();
|
||||
}
|
||||
}
|
|
@ -2,29 +2,44 @@
|
|||
using MoonWorks.Graphics;
|
||||
using MoonWorks.Math.Float;
|
||||
|
||||
namespace MoonWorks.Test
|
||||
namespace MoonWorksGraphicsTests
|
||||
{
|
||||
class BasicStencilGame : Game
|
||||
class BasicStencilGame : Example
|
||||
{
|
||||
private GraphicsPipeline maskerPipeline;
|
||||
private GraphicsPipeline maskeePipeline;
|
||||
private GpuBuffer vertexBuffer;
|
||||
private Texture depthStencilTexture;
|
||||
|
||||
public BasicStencilGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
public override void Init(Window window, GraphicsDevice graphicsDevice)
|
||||
{
|
||||
Window = window;
|
||||
GraphicsDevice = graphicsDevice;
|
||||
|
||||
// Load the shaders
|
||||
ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("PositionColor.vert"));
|
||||
ShaderModule fragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("SolidColor.frag"));
|
||||
Shader vertShaderModule = new Shader(
|
||||
GraphicsDevice,
|
||||
TestUtils.GetShaderPath("PositionColor.vert"),
|
||||
"main",
|
||||
ShaderStage.Vertex,
|
||||
ShaderFormat.SPIRV
|
||||
);
|
||||
Shader fragShaderModule = new Shader(
|
||||
GraphicsDevice,
|
||||
TestUtils.GetShaderPath("SolidColor.frag"),
|
||||
"main",
|
||||
ShaderStage.Fragment,
|
||||
ShaderFormat.SPIRV
|
||||
);
|
||||
|
||||
// Create the graphics pipelines
|
||||
GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo(
|
||||
MainWindow.SwapchainFormat,
|
||||
Window.SwapchainFormat,
|
||||
vertShaderModule,
|
||||
fragShaderModule
|
||||
);
|
||||
pipelineCreateInfo.AttachmentInfo.HasDepthStencilAttachment = true;
|
||||
pipelineCreateInfo.AttachmentInfo.DepthStencilFormat = TextureFormat.D16S8;
|
||||
pipelineCreateInfo.AttachmentInfo.DepthStencilFormat = TextureFormat.D24_UNORM_S8_UINT;
|
||||
pipelineCreateInfo.VertexInputState = VertexInputState.CreateSingleBinding<PositionColorVertex>();
|
||||
pipelineCreateInfo.DepthStencilState = new DepthStencilState
|
||||
{
|
||||
|
@ -55,10 +70,10 @@ namespace MoonWorks.Test
|
|||
// Create and populate the GPU resources
|
||||
depthStencilTexture = Texture.CreateTexture2D(
|
||||
GraphicsDevice,
|
||||
MainWindow.Width,
|
||||
MainWindow.Height,
|
||||
TextureFormat.D16S8,
|
||||
TextureUsageFlags.DepthStencilTarget
|
||||
Window.Width,
|
||||
Window.Height,
|
||||
TextureFormat.D24_UNORM_S8_UINT,
|
||||
TextureUsageFlags.DepthStencil
|
||||
);
|
||||
|
||||
var resourceUploader = new ResourceUploader(GraphicsDevice);
|
||||
|
@ -80,32 +95,31 @@ namespace MoonWorks.Test
|
|||
resourceUploader.Dispose();
|
||||
}
|
||||
|
||||
protected override void Update(System.TimeSpan delta) { }
|
||||
public override void Update(System.TimeSpan delta) { }
|
||||
|
||||
protected override void Draw(double alpha)
|
||||
public override void Draw(double alpha)
|
||||
{
|
||||
CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer();
|
||||
Texture? backbuffer = cmdbuf.AcquireSwapchainTexture(MainWindow);
|
||||
if (backbuffer != null)
|
||||
Texture swapchainTexture = cmdbuf.AcquireSwapchainTexture(Window);
|
||||
if (swapchainTexture != null)
|
||||
{
|
||||
cmdbuf.BeginRenderPass(
|
||||
new DepthStencilAttachmentInfo(depthStencilTexture, WriteOptions.Cycle, new DepthStencilValue(0, 0), StoreOp.DontCare, StoreOp.DontCare),
|
||||
new ColorAttachmentInfo(backbuffer, WriteOptions.Cycle, Color.Black)
|
||||
var renderPass = cmdbuf.BeginRenderPass(
|
||||
new DepthStencilAttachmentInfo(depthStencilTexture, true, new DepthStencilValue(0, 0), StoreOp.DontCare, StoreOp.DontCare),
|
||||
new ColorAttachmentInfo(swapchainTexture, false, Color.Black)
|
||||
);
|
||||
cmdbuf.BindGraphicsPipeline(maskerPipeline);
|
||||
cmdbuf.BindVertexBuffers(vertexBuffer);
|
||||
cmdbuf.DrawPrimitives(0, 1);
|
||||
cmdbuf.BindGraphicsPipeline(maskeePipeline);
|
||||
cmdbuf.DrawPrimitives(3, 1);
|
||||
cmdbuf.EndRenderPass();
|
||||
renderPass.BindGraphicsPipeline(maskerPipeline);
|
||||
renderPass.BindVertexBuffer(vertexBuffer);
|
||||
renderPass.DrawPrimitives(0, 1);
|
||||
renderPass.BindGraphicsPipeline(maskeePipeline);
|
||||
renderPass.DrawPrimitives(3, 1);
|
||||
cmdbuf.EndRenderPass(renderPass);
|
||||
}
|
||||
GraphicsDevice.Submit(cmdbuf);
|
||||
}
|
||||
|
||||
public static void Main(string[] args)
|
||||
public override void Destroy()
|
||||
{
|
||||
BasicStencilGame p = new BasicStencilGame();
|
||||
p.Run();
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using MoonWorks;
|
||||
using MoonWorks.Graphics;
|
||||
|
||||
namespace MoonWorksGraphicsTests;
|
||||
|
||||
public abstract class Example
|
||||
{
|
||||
protected Window Window;
|
||||
protected GraphicsDevice GraphicsDevice;
|
||||
|
||||
public abstract void Init(Window window, GraphicsDevice graphicsDevice);
|
||||
public abstract void Update(TimeSpan delta);
|
||||
public abstract void Draw(double alpha);
|
||||
public abstract void Destroy();
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,22 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>library</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="..\MoonWorks.Test.Common\Content\**\*.*">
|
||||
<Link>Content\%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project=".\CopyMoonlibs.targets" />
|
||||
|
||||
</Project>
|
|
@ -1,138 +0,0 @@
|
|||
using MoonWorks.Graphics;
|
||||
|
||||
namespace MoonWorks.Test
|
||||
{
|
||||
public static class TestUtils
|
||||
{
|
||||
// change this to test different backends
|
||||
public static Backend[] PreferredBackends = [Backend.Vulkan];
|
||||
|
||||
public static WindowCreateInfo GetStandardWindowCreateInfo()
|
||||
{
|
||||
return new WindowCreateInfo(
|
||||
"Main Window",
|
||||
640,
|
||||
480,
|
||||
ScreenMode.Windowed,
|
||||
PresentMode.FIFO
|
||||
);
|
||||
}
|
||||
|
||||
public static FrameLimiterSettings GetStandardFrameLimiterSettings()
|
||||
{
|
||||
return new FrameLimiterSettings(
|
||||
FrameLimiterMode.Capped,
|
||||
60
|
||||
);
|
||||
}
|
||||
|
||||
public static GraphicsPipelineCreateInfo GetStandardGraphicsPipelineCreateInfo(
|
||||
TextureFormat swapchainFormat,
|
||||
ShaderModule vertShaderModule,
|
||||
ShaderModule fragShaderModule
|
||||
) {
|
||||
return new GraphicsPipelineCreateInfo
|
||||
{
|
||||
AttachmentInfo = new GraphicsPipelineAttachmentInfo(
|
||||
new ColorAttachmentDescription(
|
||||
swapchainFormat,
|
||||
ColorAttachmentBlendState.Opaque
|
||||
)
|
||||
),
|
||||
DepthStencilState = DepthStencilState.Disable,
|
||||
MultisampleState = MultisampleState.None,
|
||||
PrimitiveType = PrimitiveType.TriangleList,
|
||||
RasterizerState = RasterizerState.CCW_CullNone,
|
||||
VertexInputState = VertexInputState.Empty,
|
||||
VertexShaderInfo = GraphicsShaderInfo.Create(vertShaderModule, "main", 0),
|
||||
FragmentShaderInfo = GraphicsShaderInfo.Create(fragShaderModule, "main", 0)
|
||||
};
|
||||
}
|
||||
|
||||
public static string GetShaderPath(string shaderName)
|
||||
{
|
||||
return SDL2.SDL.SDL_GetBasePath() + "Content/Shaders/Compiled/" + shaderName + ".refresh";
|
||||
}
|
||||
|
||||
public static string GetTexturePath(string textureName)
|
||||
{
|
||||
return SDL2.SDL.SDL_GetBasePath() + "Content/Textures/" + textureName;
|
||||
}
|
||||
|
||||
public static string GetVideoPath(string videoName)
|
||||
{
|
||||
return SDL2.SDL.SDL_GetBasePath() + "Content/Videos/" + videoName;
|
||||
}
|
||||
|
||||
public enum ButtonType
|
||||
{
|
||||
Left, // A/left arrow on keyboard, left face button on gamepad
|
||||
Bottom, // S/down arrow on keyboard, bottom face button on gamepad
|
||||
Right // D/right arrow on keyboard, right face button on gamepad
|
||||
}
|
||||
|
||||
public static bool CheckButtonPressed(Input.Inputs inputs, ButtonType buttonType)
|
||||
{
|
||||
bool pressed = false;
|
||||
|
||||
if (buttonType == ButtonType.Left)
|
||||
{
|
||||
pressed = (
|
||||
(inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadLeft.IsPressed) ||
|
||||
inputs.Keyboard.IsPressed(Input.KeyCode.A) ||
|
||||
inputs.Keyboard.IsPressed(Input.KeyCode.Left)
|
||||
);
|
||||
}
|
||||
else if (buttonType == ButtonType.Bottom)
|
||||
{
|
||||
pressed = (
|
||||
(inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadDown.IsPressed) ||
|
||||
inputs.Keyboard.IsPressed(Input.KeyCode.S) ||
|
||||
inputs.Keyboard.IsPressed(Input.KeyCode.Down)
|
||||
);
|
||||
}
|
||||
else if (buttonType == ButtonType.Right)
|
||||
{
|
||||
pressed = (
|
||||
(inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadRight.IsPressed) ||
|
||||
inputs.Keyboard.IsPressed(Input.KeyCode.D) ||
|
||||
inputs.Keyboard.IsPressed(Input.KeyCode.Right)
|
||||
);
|
||||
}
|
||||
|
||||
return pressed;
|
||||
}
|
||||
|
||||
public static bool CheckButtonDown(Input.Inputs inputs, ButtonType buttonType)
|
||||
{
|
||||
bool down = false;
|
||||
|
||||
if (buttonType == ButtonType.Left)
|
||||
{
|
||||
down = (
|
||||
(inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadLeft.IsDown) ||
|
||||
inputs.Keyboard.IsDown(Input.KeyCode.A) ||
|
||||
inputs.Keyboard.IsDown(Input.KeyCode.Left)
|
||||
);
|
||||
}
|
||||
else if (buttonType == ButtonType.Bottom)
|
||||
{
|
||||
down = (
|
||||
(inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadDown.IsDown) ||
|
||||
inputs.Keyboard.IsDown(Input.KeyCode.S) ||
|
||||
inputs.Keyboard.IsDown(Input.KeyCode.Down)
|
||||
);
|
||||
}
|
||||
else if (buttonType == ButtonType.Right)
|
||||
{
|
||||
down = (
|
||||
(inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadRight.IsDown) ||
|
||||
inputs.Keyboard.IsDown(Input.KeyCode.D) ||
|
||||
inputs.Keyboard.IsDown(Input.KeyCode.Right)
|
||||
);
|
||||
}
|
||||
|
||||
return down;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
using MoonWorks.Math.Float;
|
||||
|
||||
namespace MoonWorks.Test
|
||||
{
|
||||
public struct TransformVertexUniform
|
||||
{
|
||||
public Matrix4x4 ViewProjection;
|
||||
|
||||
public TransformVertexUniform(Matrix4x4 viewProjection)
|
||||
{
|
||||
ViewProjection = viewProjection;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
using System.Runtime.InteropServices;
|
||||
using MoonWorks.Graphics;
|
||||
using MoonWorks.Math.Float;
|
||||
|
||||
namespace MoonWorks.Test
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct PositionVertex : IVertexType
|
||||
{
|
||||
public Vector3 Position;
|
||||
|
||||
public PositionVertex(Vector3 position)
|
||||
{
|
||||
Position = position;
|
||||
}
|
||||
|
||||
public static VertexElementFormat[] Formats { get; } = new VertexElementFormat[1]
|
||||
{
|
||||
VertexElementFormat.Vector3
|
||||
};
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Position.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct PositionColorVertex : IVertexType
|
||||
{
|
||||
public Vector3 Position;
|
||||
public Color Color;
|
||||
|
||||
public PositionColorVertex(Vector3 position, Color color)
|
||||
{
|
||||
Position = position;
|
||||
Color = color;
|
||||
}
|
||||
|
||||
public static VertexElementFormat[] Formats { get; } = new VertexElementFormat[2]
|
||||
{
|
||||
VertexElementFormat.Vector3,
|
||||
VertexElementFormat.Color
|
||||
};
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Position + " | " + Color;
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct PositionTextureVertex : IVertexType
|
||||
{
|
||||
public Vector3 Position;
|
||||
public Vector2 TexCoord;
|
||||
|
||||
public PositionTextureVertex(Vector3 position, Vector2 texCoord)
|
||||
{
|
||||
Position = position;
|
||||
TexCoord = texCoord;
|
||||
}
|
||||
|
||||
public static VertexElementFormat[] Formats { get; } = new VertexElementFormat[2]
|
||||
{
|
||||
VertexElementFormat.Vector3,
|
||||
VertexElementFormat.Vector2
|
||||
};
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Position + " | " + TexCoord;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="..\MoonWorks.Test.Common\Content\**\*.*">
|
||||
<Link>Content\%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MoonWorks\MoonWorks.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project=".\CopyMoonlibs.targets" />
|
||||
|
||||
</Project>
|
|
@ -3,69 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30717.126
|
||||
MinimumVisualStudioVersion = 15.0.26124.0
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BasicTriangle", "BasicTriangle\BasicTriangle.csproj", "{595FE5AC-8699-494D-816A-89A2DE3786FB}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScreen", "ClearScreen\ClearScreen.csproj", "{C9B46D3A-1FA4-426E-BF84-F068FD6E0CC4}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearScreen_MultiWindow", "ClearScreen_MultiWindow\ClearScreen_MultiWindow.csproj", "{3EB54E8A-3C4E-4EE2-9DD2-6D345A92319A}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CullFace", "CullFace\CullFace.csproj", "{6567E2AD-189C-4994-9A27-72FB57546B8A}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MoonWorks.Test.Common", "MoonWorks.Test.Common\MoonWorks.Test.Common.csproj", "{550D1B95-B475-4EF8-A235-626505D7710F}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSAA", "MSAA\MSAA.csproj", "{970D18B0-0D05-4360-8208-41A2769C647E}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TexturedAnimatedQuad", "TexturedAnimatedQuad\TexturedAnimatedQuad.csproj", "{B9DE9133-9C1C-4592-927A-D3485CB493A2}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TexturedQuad", "TexturedQuad\TexturedQuad.csproj", "{22173AEA-9E5A-4DA8-B943-DEC1EA67232F}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TriangleVertexBuffer", "TriangleVertexBuffer\TriangleVertexBuffer.csproj", "{7EC935B1-DCD1-4ADD-96C8-614B4CA76501}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GetBufferData", "GetBufferData\GetBufferData.csproj", "{37BDB4E6-FCDC-4F04-A9E3-C6B9D6C3AB4E}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MoonWorks", "..\MoonWorks\MoonWorks.csproj", "{1695B1D8-4935-490C-A5EC-E2F2AA94B150}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cube", "Cube\Cube.csproj", "{C3808AFD-23DD-4622-BFA7-981A344D0C19}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BasicCompute", "BasicCompute\BasicCompute.csproj", "{68D47057-BBCB-4F86-9C0A-D6D730B18D9E}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeUniforms", "ComputeUniforms\ComputeUniforms.csproj", "{5F8BBD49-6C39-4186-A4A3-91D6662D3ABD}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DrawIndirect", "DrawIndirect\DrawIndirect.csproj", "{CA6E0ACF-3698-452F-B71F-51286EB5E1B2}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CompressedTextures", "CompressedTextures\CompressedTextures.csproj", "{E90D236C-BD0F-4420-ADD0-867D21F4DCA5}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CopyTexture", "CopyTexture\CopyTexture.csproj", "{CF25A5A2-A0BD-4C9B-BB07-19CCD97C1C4E}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VideoPlayer", "VideoPlayer\VideoPlayer.csproj", "{FCD63849-9D3C-4D48-A8BD-39671096F03A}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Texture3D", "Texture3D\Texture3D.csproj", "{9D0F0573-7FD4-4480-8F9B-CDD52120A170}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InstancingAndOffsets", "InstancingAndOffsets\InstancingAndOffsets.csproj", "{5CDA8D41-F96C-4DE7-AD53-5A76C4C0CC31}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VertexSampler", "VertexSampler\VertexSampler.csproj", "{C525B6DE-3003-45D5-BB83-89679B108C08}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RenderTexture2DArray", "RenderTexture2DArray\RenderTexture2DArray.csproj", "{6D625A4C-8618-4DFC-A6AD-AA3BE3488D70}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RenderTextureCube", "RenderTextureCube\RenderTextureCube.csproj", "{D7A8452F-123F-4965-8716-9E39F677A831}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RenderTextureMipmaps", "RenderTextureMipmaps\RenderTextureMipmaps.csproj", "{2219C628-5593-4C23-86CB-0E1E96EBD6C5}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TextureMipmaps", "TextureMipmaps\TextureMipmaps.csproj", "{5A1AC35B-EF18-426D-A633-D4899E84EAA7}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BasicStencil", "BasicStencil\BasicStencil.csproj", "{1B370BAD-966A-49B2-9EA0-2463F6C8F9AD}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DepthMSAA", "DepthMSAA\DepthMSAA.csproj", "{B36C9F65-F3F4-4EB4-8EBF-A1EDCD4261F8}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowResizing", "WindowResizing\WindowResizing.csproj", "{AF5F2804-663D-4C46-BD02-AB178002180B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StoreLoad", "StoreLoad\StoreLoad.csproj", "{CD31F1B5-C76A-428A-A812-8DFD6CAB20A9}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RenderTexture2D", "RenderTexture2D\RenderTexture2D.csproj", "{F9C9E15D-1000-46DA-BA39-1D4C0D43F023}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSAACube", "MSAACube\MSAACube.csproj", "{A1568AAF-DD02-4A6E-9C68-9AE07130A60D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Texture3DCopy", "Texture3DCopy\Texture3DCopy.csproj", "{A18B6D92-A699-480C-9ABC-4000A3FE4B94}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoonWorksGraphicsTests", "MoonWorksGraphicsTests.csproj", "{8AA61DD7-07CE-45B7-BD1A-52AA0D4DDC92}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -73,134 +13,14 @@ Global
|
|||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{595FE5AC-8699-494D-816A-89A2DE3786FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{595FE5AC-8699-494D-816A-89A2DE3786FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{595FE5AC-8699-494D-816A-89A2DE3786FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{595FE5AC-8699-494D-816A-89A2DE3786FB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C9B46D3A-1FA4-426E-BF84-F068FD6E0CC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C9B46D3A-1FA4-426E-BF84-F068FD6E0CC4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C9B46D3A-1FA4-426E-BF84-F068FD6E0CC4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C9B46D3A-1FA4-426E-BF84-F068FD6E0CC4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3EB54E8A-3C4E-4EE2-9DD2-6D345A92319A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3EB54E8A-3C4E-4EE2-9DD2-6D345A92319A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3EB54E8A-3C4E-4EE2-9DD2-6D345A92319A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3EB54E8A-3C4E-4EE2-9DD2-6D345A92319A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6567E2AD-189C-4994-9A27-72FB57546B8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6567E2AD-189C-4994-9A27-72FB57546B8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6567E2AD-189C-4994-9A27-72FB57546B8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6567E2AD-189C-4994-9A27-72FB57546B8A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{550D1B95-B475-4EF8-A235-626505D7710F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{550D1B95-B475-4EF8-A235-626505D7710F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{550D1B95-B475-4EF8-A235-626505D7710F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{550D1B95-B475-4EF8-A235-626505D7710F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{970D18B0-0D05-4360-8208-41A2769C647E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{970D18B0-0D05-4360-8208-41A2769C647E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{970D18B0-0D05-4360-8208-41A2769C647E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{970D18B0-0D05-4360-8208-41A2769C647E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B9DE9133-9C1C-4592-927A-D3485CB493A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B9DE9133-9C1C-4592-927A-D3485CB493A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B9DE9133-9C1C-4592-927A-D3485CB493A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B9DE9133-9C1C-4592-927A-D3485CB493A2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{22173AEA-9E5A-4DA8-B943-DEC1EA67232F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{22173AEA-9E5A-4DA8-B943-DEC1EA67232F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{22173AEA-9E5A-4DA8-B943-DEC1EA67232F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{22173AEA-9E5A-4DA8-B943-DEC1EA67232F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7EC935B1-DCD1-4ADD-96C8-614B4CA76501}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7EC935B1-DCD1-4ADD-96C8-614B4CA76501}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7EC935B1-DCD1-4ADD-96C8-614B4CA76501}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7EC935B1-DCD1-4ADD-96C8-614B4CA76501}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{37BDB4E6-FCDC-4F04-A9E3-C6B9D6C3AB4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{37BDB4E6-FCDC-4F04-A9E3-C6B9D6C3AB4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{37BDB4E6-FCDC-4F04-A9E3-C6B9D6C3AB4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{37BDB4E6-FCDC-4F04-A9E3-C6B9D6C3AB4E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1695B1D8-4935-490C-A5EC-E2F2AA94B150}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1695B1D8-4935-490C-A5EC-E2F2AA94B150}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1695B1D8-4935-490C-A5EC-E2F2AA94B150}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1695B1D8-4935-490C-A5EC-E2F2AA94B150}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C3808AFD-23DD-4622-BFA7-981A344D0C19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C3808AFD-23DD-4622-BFA7-981A344D0C19}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C3808AFD-23DD-4622-BFA7-981A344D0C19}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C3808AFD-23DD-4622-BFA7-981A344D0C19}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{68D47057-BBCB-4F86-9C0A-D6D730B18D9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{68D47057-BBCB-4F86-9C0A-D6D730B18D9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{68D47057-BBCB-4F86-9C0A-D6D730B18D9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{68D47057-BBCB-4F86-9C0A-D6D730B18D9E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5F8BBD49-6C39-4186-A4A3-91D6662D3ABD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5F8BBD49-6C39-4186-A4A3-91D6662D3ABD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5F8BBD49-6C39-4186-A4A3-91D6662D3ABD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5F8BBD49-6C39-4186-A4A3-91D6662D3ABD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CA6E0ACF-3698-452F-B71F-51286EB5E1B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CA6E0ACF-3698-452F-B71F-51286EB5E1B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CA6E0ACF-3698-452F-B71F-51286EB5E1B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CA6E0ACF-3698-452F-B71F-51286EB5E1B2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E90D236C-BD0F-4420-ADD0-867D21F4DCA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E90D236C-BD0F-4420-ADD0-867D21F4DCA5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E90D236C-BD0F-4420-ADD0-867D21F4DCA5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E90D236C-BD0F-4420-ADD0-867D21F4DCA5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CF25A5A2-A0BD-4C9B-BB07-19CCD97C1C4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CF25A5A2-A0BD-4C9B-BB07-19CCD97C1C4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CF25A5A2-A0BD-4C9B-BB07-19CCD97C1C4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CF25A5A2-A0BD-4C9B-BB07-19CCD97C1C4E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{FCD63849-9D3C-4D48-A8BD-39671096F03A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FCD63849-9D3C-4D48-A8BD-39671096F03A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FCD63849-9D3C-4D48-A8BD-39671096F03A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FCD63849-9D3C-4D48-A8BD-39671096F03A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9D0F0573-7FD4-4480-8F9B-CDD52120A170}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9D0F0573-7FD4-4480-8F9B-CDD52120A170}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9D0F0573-7FD4-4480-8F9B-CDD52120A170}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9D0F0573-7FD4-4480-8F9B-CDD52120A170}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5CDA8D41-F96C-4DE7-AD53-5A76C4C0CC31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5CDA8D41-F96C-4DE7-AD53-5A76C4C0CC31}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5CDA8D41-F96C-4DE7-AD53-5A76C4C0CC31}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5CDA8D41-F96C-4DE7-AD53-5A76C4C0CC31}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C525B6DE-3003-45D5-BB83-89679B108C08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C525B6DE-3003-45D5-BB83-89679B108C08}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C525B6DE-3003-45D5-BB83-89679B108C08}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C525B6DE-3003-45D5-BB83-89679B108C08}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6D625A4C-8618-4DFC-A6AD-AA3BE3488D70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6D625A4C-8618-4DFC-A6AD-AA3BE3488D70}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6D625A4C-8618-4DFC-A6AD-AA3BE3488D70}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6D625A4C-8618-4DFC-A6AD-AA3BE3488D70}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D7A8452F-123F-4965-8716-9E39F677A831}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D7A8452F-123F-4965-8716-9E39F677A831}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D7A8452F-123F-4965-8716-9E39F677A831}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D7A8452F-123F-4965-8716-9E39F677A831}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2219C628-5593-4C23-86CB-0E1E96EBD6C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2219C628-5593-4C23-86CB-0E1E96EBD6C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2219C628-5593-4C23-86CB-0E1E96EBD6C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2219C628-5593-4C23-86CB-0E1E96EBD6C5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5A1AC35B-EF18-426D-A633-D4899E84EAA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5A1AC35B-EF18-426D-A633-D4899E84EAA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5A1AC35B-EF18-426D-A633-D4899E84EAA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5A1AC35B-EF18-426D-A633-D4899E84EAA7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1B370BAD-966A-49B2-9EA0-2463F6C8F9AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1B370BAD-966A-49B2-9EA0-2463F6C8F9AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1B370BAD-966A-49B2-9EA0-2463F6C8F9AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1B370BAD-966A-49B2-9EA0-2463F6C8F9AD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B36C9F65-F3F4-4EB4-8EBF-A1EDCD4261F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B36C9F65-F3F4-4EB4-8EBF-A1EDCD4261F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B36C9F65-F3F4-4EB4-8EBF-A1EDCD4261F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B36C9F65-F3F4-4EB4-8EBF-A1EDCD4261F8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{AF5F2804-663D-4C46-BD02-AB178002180B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AF5F2804-663D-4C46-BD02-AB178002180B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AF5F2804-663D-4C46-BD02-AB178002180B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AF5F2804-663D-4C46-BD02-AB178002180B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CD31F1B5-C76A-428A-A812-8DFD6CAB20A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CD31F1B5-C76A-428A-A812-8DFD6CAB20A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CD31F1B5-C76A-428A-A812-8DFD6CAB20A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CD31F1B5-C76A-428A-A812-8DFD6CAB20A9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F9C9E15D-1000-46DA-BA39-1D4C0D43F023}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F9C9E15D-1000-46DA-BA39-1D4C0D43F023}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F9C9E15D-1000-46DA-BA39-1D4C0D43F023}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F9C9E15D-1000-46DA-BA39-1D4C0D43F023}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A1568AAF-DD02-4A6E-9C68-9AE07130A60D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A1568AAF-DD02-4A6E-9C68-9AE07130A60D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A1568AAF-DD02-4A6E-9C68-9AE07130A60D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A1568AAF-DD02-4A6E-9C68-9AE07130A60D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A18B6D92-A699-480C-9ABC-4000A3FE4B94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A18B6D92-A699-480C-9ABC-4000A3FE4B94}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A18B6D92-A699-480C-9ABC-4000A3FE4B94}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A18B6D92-A699-480C-9ABC-4000A3FE4B94}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8AA61DD7-07CE-45B7-BD1A-52AA0D4DDC92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8AA61DD7-07CE-45B7-BD1A-52AA0D4DDC92}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8AA61DD7-07CE-45B7-BD1A-52AA0D4DDC92}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8AA61DD7-07CE-45B7-BD1A-52AA0D4DDC92}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
using System;
|
||||
using MoonWorks;
|
||||
using MoonWorks.Graphics;
|
||||
using MoonWorks.Test;
|
||||
|
||||
namespace MoonWorksGraphicsTests;
|
||||
|
||||
class Program : Game
|
||||
{
|
||||
Example[] Examples =
|
||||
[
|
||||
new BasicComputeExample(),
|
||||
new BasicStencilGame()
|
||||
];
|
||||
|
||||
int ExampleIndex = 0;
|
||||
|
||||
public Program(
|
||||
WindowCreateInfo windowCreateInfo,
|
||||
FrameLimiterSettings frameLimiterSettings,
|
||||
BackendFlags preferredBackends,
|
||||
int targetTimestep = 60,
|
||||
bool debugMode = false
|
||||
) : base(windowCreateInfo, frameLimiterSettings, preferredBackends, targetTimestep, debugMode)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Update(TimeSpan delta)
|
||||
{
|
||||
if (Inputs.Keyboard.IsPressed(MoonWorks.Input.KeyCode.A))
|
||||
{
|
||||
Examples[ExampleIndex].Destroy();
|
||||
|
||||
ExampleIndex -= 1;
|
||||
if (ExampleIndex < 0)
|
||||
{
|
||||
ExampleIndex = Examples.Length - 1;
|
||||
}
|
||||
|
||||
Examples[ExampleIndex].Init(MainWindow, GraphicsDevice);
|
||||
}
|
||||
else if (Inputs.Keyboard.IsPressed(MoonWorks.Input.KeyCode.D))
|
||||
{
|
||||
Examples[ExampleIndex].Destroy();
|
||||
|
||||
ExampleIndex = (ExampleIndex + 1) % Examples.Length;
|
||||
|
||||
Examples[ExampleIndex].Init(MainWindow, GraphicsDevice);
|
||||
}
|
||||
else
|
||||
{
|
||||
Examples[ExampleIndex].Update(delta);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Draw(double alpha)
|
||||
{
|
||||
Examples[ExampleIndex].Draw(alpha);
|
||||
}
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var debugMode = false;
|
||||
|
||||
#if DEBUG
|
||||
debugMode = true;
|
||||
#endif
|
||||
|
||||
var windowCreateInfo = new WindowCreateInfo(
|
||||
"MoonWorksGraphicsTests",
|
||||
1280,
|
||||
720,
|
||||
ScreenMode.Windowed,
|
||||
SwapchainComposition.SDR,
|
||||
PresentMode.VSync
|
||||
);
|
||||
|
||||
var frameLimiterSettings = new FrameLimiterSettings(
|
||||
FrameLimiterMode.Capped,
|
||||
60
|
||||
);
|
||||
|
||||
var game = new Program(
|
||||
windowCreateInfo,
|
||||
frameLimiterSettings,
|
||||
BackendFlags.Vulkan | BackendFlags.D3D11 | BackendFlags.Metal,
|
||||
60,
|
||||
debugMode
|
||||
);
|
||||
|
||||
game.Run();
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,17 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|
|
@ -1,16 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="..\MoonWorks.Test.Common\MoonWorks.Test.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(SolutionDir)NativeAOT_Console.targets" Condition="Exists('$(SolutionDir)NativeAOT_Console.targets')" />
|
||||
|
||||
</Project>
|