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>
</Content>
<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>
</Content>
<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>
</Content>
</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.Window;
namespace MoonWorksTest
{

View File

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