API update

main
cosmonaut 2021-01-26 20:29:10 -08:00
parent 7367b428cb
commit 31e65e11ff
7 changed files with 23 additions and 23 deletions

View File

@ -7,11 +7,11 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include=".\moonlibs\osx\**\*.*" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'" > <Content Include=".\moonlibs\osx\**\*.*" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'" >
<Link>osx\%(RecursiveDir)%(Filename)%(Extension)</Link> <Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include=".\moonlibs\lib64\**\*.*" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'" > <Content Include=".\moonlibs\lib64\**\*.*" Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'" >
<Link>lib64\%(RecursiveDir)%(Filename)%(Extension)</Link> <Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>

@ -1 +1 @@
Subproject commit d22a70c116cf52cfc3ed62499ade660f4d28e8f5 Subproject commit 7f6236cb492bece7584416948186cebfcd9f422a

BIN
moonlibs/lib64/libFAudio.so Executable file

Binary file not shown.

BIN
moonlibs/lib64/libRefresh.so Executable file

Binary file not shown.

BIN
moonlibs/lib64/libSDL2-2.0.so Executable file

Binary file not shown.

View File

@ -1,5 +1,5 @@
using MoonWorks;
using MoonWorks.Graphics; using MoonWorks.Graphics;
using MoonWorks.Window;
namespace MoonWorksTest namespace MoonWorksTest
{ {

View File

@ -1,6 +1,8 @@
using MoonWorks; using MoonWorks;
using MoonWorks.Audio; using MoonWorks.Audio;
using MoonWorks.Graphics; using MoonWorks.Graphics;
using MoonWorks.Input;
using MoonWorks.Window;
using System.IO; using System.IO;
using System.Threading; using System.Threading;
@ -24,7 +26,7 @@ namespace MoonWorksTest
Texture mainColorTargetTexture; Texture mainColorTargetTexture;
TextureSlice mainColorTargetTextureSlice; TextureSlice mainColorTargetTextureSlice;
ColorTarget mainColorTarget; RenderTarget mainColorTarget;
RenderPass mainRenderPass; RenderPass mainRenderPass;
Framebuffer mainFramebuffer; Framebuffer mainFramebuffer;
@ -55,8 +57,7 @@ namespace MoonWorksTest
woodTexture = Texture.LoadPNG(GraphicsDevice, new System.IO.FileInfo("Content/woodgrain.png")); woodTexture = Texture.LoadPNG(GraphicsDevice, new System.IO.FileInfo("Content/woodgrain.png"));
noiseTexture = Texture.LoadPNG(GraphicsDevice, new System.IO.FileInfo("Content/noise.png")); noiseTexture = Texture.LoadPNG(GraphicsDevice, new System.IO.FileInfo("Content/noise.png"));
SamplerState samplerState = SamplerState.LinearWrap; sampler = new Sampler(GraphicsDevice, SamplerState.LinearWrap);
sampler = new Sampler(GraphicsDevice, ref samplerState);
/* Load Vertex Data */ /* Load Vertex Data */
@ -94,14 +95,14 @@ namespace MoonWorksTest
flip.w = (int) windowWidth; flip.w = (int) windowWidth;
flip.h = -(int) windowHeight; flip.h = -(int) windowHeight;
clearColor.r = 237; clearColor.R = 237;
clearColor.g = 41; clearColor.G = 41;
clearColor.b = 57; clearColor.B = 57;
clearColor.a = byte.MaxValue; clearColor.A = byte.MaxValue;
ColorTargetDescription colorTargetDescription = new ColorTargetDescription ColorTargetDescription colorTargetDescription = new ColorTargetDescription
{ {
format = ColorFormat.R8G8B8A8, format = TextureFormat.R8G8B8A8,
multisampleCount = SampleCount.One, multisampleCount = SampleCount.One,
loadOp = LoadOp.Clear, loadOp = LoadOp.Clear,
storeOp = StoreOp.Store storeOp = StoreOp.Store
@ -113,13 +114,12 @@ namespace MoonWorksTest
GraphicsDevice, GraphicsDevice,
windowWidth, windowWidth,
windowHeight, windowHeight,
ColorFormat.R8G8B8A8, TextureFormat.R8G8B8A8,
TextureUsageFlags.ColorTargetBit TextureUsageFlags.ColorTarget
); );
mainColorTargetTextureSlice = new TextureSlice(mainColorTargetTexture); mainColorTargetTextureSlice = new TextureSlice(mainColorTargetTexture);
mainColorTarget = new RenderTarget(GraphicsDevice, mainColorTargetTextureSlice);
mainColorTarget = new ColorTarget(GraphicsDevice, SampleCount.One, ref mainColorTargetTextureSlice);
mainFramebuffer = new Framebuffer( mainFramebuffer = new Framebuffer(
GraphicsDevice, GraphicsDevice,
@ -158,7 +158,7 @@ namespace MoonWorksTest
{ {
ShaderModule = raymarchFragmentShaderModule, ShaderModule = raymarchFragmentShaderModule,
EntryPointName = "main", EntryPointName = "main",
UniformBufferSize = 4 UniformBufferSize = 16
}; };
MultisampleState multisampleState = MultisampleState.None; MultisampleState multisampleState = MultisampleState.None;
@ -169,7 +169,7 @@ namespace MoonWorksTest
FragmentSamplerBindingCount = 2 FragmentSamplerBindingCount = 2
}; };
RasterizerState rasterizerState = RasterizerState.CullCounterClockwise; RasterizerState rasterizerState = RasterizerState.CW_CullBack;
var vertexBindings = new VertexBinding[1] var vertexBindings = new VertexBinding[1]
{ {
@ -269,16 +269,16 @@ namespace MoonWorksTest
raymarchUniforms.time += (float) dt; raymarchUniforms.time += (float) dt;
} }
protected override void Draw() protected override void Draw(double dt, double alpha)
{ {
var screenshotPressed = Input.Keyboard.IsPressed(Keycode.S); var screenshotPressed = Inputs.Keyboard.IsPressed(Keycode.S);
var commandBuffer = GraphicsDevice.AcquireCommandBuffer(); var commandBuffer = GraphicsDevice.AcquireCommandBuffer();
commandBuffer.BeginRenderPass( commandBuffer.BeginRenderPass(
mainRenderPass, mainRenderPass,
mainFramebuffer, mainFramebuffer,
ref renderArea, renderArea,
clearColor clearColor
); );
@ -294,10 +294,10 @@ namespace MoonWorksTest
if (screenshotPressed) if (screenshotPressed)
{ {
commandBuffer.CopyTextureToBuffer(ref mainColorTargetTextureSlice, screenshotBuffer); commandBuffer.CopyTextureToBuffer(mainColorTargetTextureSlice, screenshotBuffer);
} }
commandBuffer.QueuePresent(ref mainColorTargetTextureSlice, ref flip, Filter.Nearest); commandBuffer.QueuePresent(mainColorTargetTextureSlice, flip, Filter.Nearest);
GraphicsDevice.Submit(commandBuffer); GraphicsDevice.Submit(commandBuffer);
if (screenshotPressed) if (screenshotPressed)