-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
68 lines (55 loc) · 1.53 KB
/
Copy pathProgram.cs
File metadata and controls
68 lines (55 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System;
using MoonWorks;
using MoonWorks.Graphics;
namespace MoonWorksAssignmentPorts;
public class Program : Game
{
Assignment[] Assignments = [
new SimpleScene()
];
int AssignmentIndex = 0;
public Program(
AppInfo appInfo,
WindowCreateInfo windowCreateInfo,
FramePacingSettings framePacingSettings,
bool debugMode
) : base(
appInfo,
windowCreateInfo,
framePacingSettings,
ShaderFormat.SPIRV | ShaderFormat.DXBC | ShaderFormat.DXIL | ShaderFormat.MSL,
debugMode
)
{
ShaderCross.Initialize();
Assignments[AssignmentIndex].Start(this);
}
override protected void Update(TimeSpan delta)
{
Assignments[AssignmentIndex].Update(delta);
}
override protected void Draw(double alpha)
{
Assignments[AssignmentIndex].Draw(alpha);
}
override protected void Destroy()
{
Assignments[AssignmentIndex].Destroy();
}
static void Main(string[] args)
{
var windowCreateInfo = new WindowCreateInfo(
"MoonWorksAssignmentPorts",
960,
720,
ScreenMode.Windowed
);
var framePacingSettings = FramePacingSettings.CreateCapped(60, 120);
var game = new Program(
new AppInfo("", "MoonWorksAssignmentPorts"),
windowCreateInfo,
framePacingSettings,
false);
game.Run();
}
}