31 lines
850 B
C#
31 lines
850 B
C#
using MoonWorks;
|
|
using MoonWorks.Graphics;
|
|
|
|
namespace MoonWorks.Test
|
|
{
|
|
class ClearScreenGame : Game
|
|
{
|
|
public ClearScreenGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true) { }
|
|
|
|
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.SafeDiscard, Color.CornflowerBlue));
|
|
cmdbuf.EndRenderPass();
|
|
}
|
|
GraphicsDevice.Submit(cmdbuf);
|
|
}
|
|
|
|
public static void Main(string[] args)
|
|
{
|
|
ClearScreenGame game = new ClearScreenGame();
|
|
game.Run();
|
|
}
|
|
}
|
|
}
|