remove explicit RefreshCS

main
cosmonaut 2021-01-20 13:33:03 -08:00
parent 8c8fcde3bc
commit 7367b428cb
3 changed files with 29 additions and 29 deletions

@ -1 +1 @@
Subproject commit 52b60b66f43e8b20192b5cc04211a0f2a183c87d Subproject commit d22a70c116cf52cfc3ed62499ade660f4d28e8f5

View File

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

View File

@ -1,7 +1,6 @@
using MoonWorks; using MoonWorks;
using MoonWorks.Audio; using MoonWorks.Audio;
using MoonWorks.Graphics; using MoonWorks.Graphics;
using RefreshCS;
using System.IO; using System.IO;
using System.Threading; using System.Threading;
@ -19,9 +18,9 @@ namespace MoonWorksTest
Buffer vertexBuffer; Buffer vertexBuffer;
RefreshCS.Refresh.Rect renderArea; Rect renderArea;
RefreshCS.Refresh.Rect flip; Rect flip;
RefreshCS.Refresh.Color clearColor; Color clearColor;
Texture mainColorTargetTexture; Texture mainColorTargetTexture;
TextureSlice mainColorTargetTextureSlice; TextureSlice mainColorTargetTextureSlice;
@ -80,7 +79,7 @@ namespace MoonWorksTest
vertices[2].u = 0; vertices[2].u = 0;
vertices[2].v = 0; vertices[2].v = 0;
vertexBuffer = new Buffer(GraphicsDevice, Refresh.BufferUsageFlags.Vertex, 4 * 5 * 3); vertexBuffer = new Buffer(GraphicsDevice, BufferUsageFlags.Vertex, 4 * 5 * 3);
vertexBuffer.SetData(0, vertices, 4 * 5 * 3); vertexBuffer.SetData(0, vertices, 4 * 5 * 3);
/* Render Pass */ /* Render Pass */
@ -100,12 +99,12 @@ namespace MoonWorksTest
clearColor.b = 57; clearColor.b = 57;
clearColor.a = byte.MaxValue; clearColor.a = byte.MaxValue;
Refresh.ColorTargetDescription colorTargetDescription = new Refresh.ColorTargetDescription ColorTargetDescription colorTargetDescription = new ColorTargetDescription
{ {
format = Refresh.ColorFormat.R8G8B8A8, format = ColorFormat.R8G8B8A8,
multisampleCount = Refresh.SampleCount.One, multisampleCount = SampleCount.One,
loadOp = Refresh.LoadOp.Clear, loadOp = LoadOp.Clear,
storeOp = Refresh.StoreOp.Store storeOp = StoreOp.Store
}; };
mainRenderPass = new RenderPass(GraphicsDevice, colorTargetDescription); mainRenderPass = new RenderPass(GraphicsDevice, colorTargetDescription);
@ -114,13 +113,13 @@ namespace MoonWorksTest
GraphicsDevice, GraphicsDevice,
windowWidth, windowWidth,
windowHeight, windowHeight,
Refresh.ColorFormat.R8G8B8A8, ColorFormat.R8G8B8A8,
Refresh.TextureUsageFlags.ColorTargetBit TextureUsageFlags.ColorTargetBit
); );
mainColorTargetTextureSlice = new TextureSlice(mainColorTargetTexture); mainColorTargetTextureSlice = new TextureSlice(mainColorTargetTexture);
mainColorTarget = new ColorTarget(GraphicsDevice, Refresh.SampleCount.One, ref mainColorTargetTextureSlice); mainColorTarget = new ColorTarget(GraphicsDevice, SampleCount.One, ref mainColorTargetTextureSlice);
mainFramebuffer = new Framebuffer( mainFramebuffer = new Framebuffer(
GraphicsDevice, GraphicsDevice,
@ -141,7 +140,7 @@ namespace MoonWorksTest
ColorBlendState colorBlendState = new ColorBlendState ColorBlendState colorBlendState = new ColorBlendState
{ {
LogicOpEnable = false, LogicOpEnable = false,
LogicOp = Refresh.LogicOp.NoOp, LogicOp = LogicOp.NoOp,
BlendConstants = new BlendConstants(), BlendConstants = new BlendConstants(),
ColorTargetBlendStates = colorTargetBlendStates ColorTargetBlendStates = colorTargetBlendStates
}; };
@ -172,30 +171,30 @@ namespace MoonWorksTest
RasterizerState rasterizerState = RasterizerState.CullCounterClockwise; RasterizerState rasterizerState = RasterizerState.CullCounterClockwise;
var vertexBindings = new Refresh.VertexBinding[1] var vertexBindings = new VertexBinding[1]
{ {
new Refresh.VertexBinding new VertexBinding
{ {
binding = 0, binding = 0,
inputRate = Refresh.VertexInputRate.Vertex, inputRate = VertexInputRate.Vertex,
stride = 4 * 5 stride = 4 * 5
} }
}; };
var vertexAttributes = new Refresh.VertexAttribute[2] var vertexAttributes = new VertexAttribute[2]
{ {
new Refresh.VertexAttribute new VertexAttribute
{ {
binding = 0, binding = 0,
location = 0, location = 0,
format = Refresh.VertexElementFormat.Vector3, format = VertexElementFormat.Vector3,
offset = 0 offset = 0
}, },
new Refresh.VertexAttribute new VertexAttribute
{ {
binding = 0, binding = 0,
location = 1, location = 1,
format = Refresh.VertexElementFormat.Vector2, format = VertexElementFormat.Vector2,
offset = 4 * 3 offset = 4 * 3
} }
}; };
@ -206,9 +205,9 @@ namespace MoonWorksTest
VertexAttributes = vertexAttributes VertexAttributes = vertexAttributes
}; };
var viewports = new Refresh.Viewport[1] var viewports = new Viewport[1]
{ {
new Refresh.Viewport new Viewport
{ {
x = 0, x = 0,
y = 0, y = 0,
@ -219,9 +218,9 @@ namespace MoonWorksTest
} }
}; };
var scissors = new Refresh.Rect[1] var scissors = new Rect[1]
{ {
new Refresh.Rect new Rect
{ {
x = 0, x = 0,
y = 0, y = 0,
@ -245,7 +244,7 @@ namespace MoonWorksTest
multisampleState, multisampleState,
pipelineLayoutCreateInfo, pipelineLayoutCreateInfo,
rasterizerState, rasterizerState,
Refresh.PrimitiveType.TriangleList, PrimitiveType.TriangleList,
vertexInputState, vertexInputState,
viewportState, viewportState,
mainRenderPass mainRenderPass
@ -298,7 +297,7 @@ namespace MoonWorksTest
commandBuffer.CopyTextureToBuffer(ref mainColorTargetTextureSlice, screenshotBuffer); commandBuffer.CopyTextureToBuffer(ref mainColorTargetTextureSlice, screenshotBuffer);
} }
commandBuffer.QueuePresent(ref mainColorTargetTextureSlice, ref flip, Refresh.Filter.Nearest); commandBuffer.QueuePresent(ref mainColorTargetTextureSlice, ref flip, Filter.Nearest);
GraphicsDevice.Submit(commandBuffer); GraphicsDevice.Submit(commandBuffer);
if (screenshotPressed) if (screenshotPressed)