MoonWorksTemplate/src/ProjectNameGame.cs

47 lines
982 B
C#
Raw Permalink Normal View History

2021-04-04 21:01:40 +00:00
using MoonWorks.Graphics;
using MoonWorks;
namespace ProjectName
{
2022-08-30 05:11:51 +00:00
class ProjectNameGame : Game
{
public ProjectNameGame(
WindowCreateInfo windowCreateInfo,
2023-06-08 18:07:20 +00:00
FrameLimiterSettings frameLimiterSettings,
2022-08-30 05:11:51 +00:00
bool debugMode
2023-06-08 18:07:20 +00:00
) : base(windowCreateInfo, frameLimiterSettings, 60, debugMode)
2022-08-30 05:11:51 +00:00
{
// Insert your game initialization logic here.
}
protected override void Update(System.TimeSpan dt)
{
// Insert your game update logic here.
}
protected override void Draw(double alpha)
{
// Replace this with your own drawing code.
var commandBuffer = GraphicsDevice.AcquireCommandBuffer();
2023-06-08 18:07:20 +00:00
var swapchainTexture = commandBuffer.AcquireSwapchainTexture(MainWindow);
2021-04-04 21:01:40 +00:00
2023-12-21 21:09:33 +00:00
if (swapchainTexture != null)
{
commandBuffer.BeginRenderPass(
new ColorAttachmentInfo(swapchainTexture, Color.CornflowerBlue)
);
commandBuffer.EndRenderPass();
}
2022-08-30 05:11:51 +00:00
GraphicsDevice.Submit(commandBuffer);
}
2022-03-03 19:05:23 +00:00
2022-08-30 05:11:51 +00:00
protected override void Destroy()
2022-03-03 19:05:23 +00:00
{
}
2022-08-30 05:11:51 +00:00
}
2021-04-04 21:01:40 +00:00
}