moonworks ABI update

main
cosmonaut 2022-02-25 13:27:27 -08:00
parent f7be55f6c6
commit d8708818cb
3 changed files with 33 additions and 40 deletions

@ -1 +1 @@
Subproject commit e5213da686fd4700d16a0c627d5f1ab4fce0ee12
Subproject commit 9028a8b1a02d1f73be3d8006f72a8a68acccacdf

View File

@ -1,5 +1,4 @@
using MoonWorks.Graphics;
using MoonWorks.Window;
using MoonWorks;
using MoonWorksMultiWindow.Graphics;
using System.Threading.Tasks;
@ -10,10 +9,7 @@ namespace MoonWorksMultiWindow
{
private GraphicsObjects GraphicsObjects { get; }
private int RenderWidth { get; }
private int RenderHeight { get; }
private OSWindow ExtraWindow { get; }
private Window ExtraWindow { get; }
public MoonWorksMultiWindowGame(
WindowCreateInfo windowCreateInfo,
@ -27,8 +23,6 @@ namespace MoonWorksMultiWindow
windowCreateInfo.WindowWidth,
windowCreateInfo.WindowHeight
);
RenderWidth = (int)windowCreateInfo.WindowWidth;
RenderHeight = (int)windowCreateInfo.WindowHeight;
var extraWindowCreateInfo = new WindowCreateInfo
{
@ -38,7 +32,7 @@ namespace MoonWorksMultiWindow
ScreenMode = ScreenMode.Windowed
};
ExtraWindow = new OSWindow(extraWindowCreateInfo);
ExtraWindow = new Window(extraWindowCreateInfo);
}
protected override void Update(System.TimeSpan dt)
@ -62,10 +56,10 @@ namespace MoonWorksMultiWindow
commandBuffer.BeginRenderPass(
new ColorAttachmentInfo
{
renderTarget = GraphicsObjects.RenderTargets.ExampleRenderTarget,
clearColor = Color.CornflowerBlue,
loadOp = LoadOp.Clear,
storeOp = StoreOp.DontCare
RenderTarget = GraphicsObjects.RenderTargets.ExampleRenderTarget,
ClearColor = Color.CornflowerBlue,
LoadOp = LoadOp.Clear,
StoreOp = StoreOp.DontCare
}
);
@ -87,10 +81,10 @@ namespace MoonWorksMultiWindow
commandBuffer.BeginRenderPass(
new ColorAttachmentInfo
{
renderTarget = GraphicsObjects.RenderTargets.ExtraWindowRenderTarget,
clearColor = Color.OrangeRed,
loadOp = LoadOp.Clear,
storeOp = StoreOp.DontCare
RenderTarget = GraphicsObjects.RenderTargets.ExtraWindowRenderTarget,
ClearColor = Color.OrangeRed,
LoadOp = LoadOp.Clear,
StoreOp = StoreOp.DontCare
}
);

View File

@ -2,34 +2,33 @@ using System;
using System.IO;
using System.Runtime.InteropServices;
using MoonWorks;
using MoonWorks.Window;
namespace MoonWorksMultiWindow
{
class Program
{
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool SetDllDirectory(string lpPathName);
class Program
{
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool SetDllDirectory(string lpPathName);
static void Main(string[] args)
{
WindowCreateInfo windowCreateInfo = new WindowCreateInfo
{
WindowWidth = 1280,
WindowHeight = 720,
WindowTitle = "MoonWorksMultiWindow",
ScreenMode = ScreenMode.Windowed
};
static void Main(string[] args)
{
WindowCreateInfo windowCreateInfo = new WindowCreateInfo
{
WindowWidth = 1280,
WindowHeight = 720,
WindowTitle = "MoonWorksMultiWindow",
ScreenMode = ScreenMode.Windowed
};
MoonWorksMultiWindowGame game = new MoonWorksMultiWindowGame(
windowCreateInfo,
MoonWorks.Graphics.PresentMode.FIFORelaxed,
true
);
MoonWorksMultiWindowGame game = new MoonWorksMultiWindowGame(
windowCreateInfo,
MoonWorks.Graphics.PresentMode.FIFORelaxed,
true
);
game.Run();
}
}
game.Run();
}
}
}