Appearance
Lesson 01 — Start the host and draw a frame
Where this lesson fits: the game model is still a sketch. This lesson identifies the real executable, the shared game code, and the operations that turn one frame into another.
Time: 2–3 hours
Prerequisites and outcomes
Complete lesson 00. By the end, you can build and launch a platform host and trace the MonoGame lifecycle without putting gameplay rules in the host.
Prepare and run
- Follow getting started. Complete the existing tutorial's chapter 01 setup and steps 1–13, including the three files it tells you to copy.
- Open your new
LastPerimetersolution folder in your editor and terminal. The commands below run there; do not run them in the course repository's finished game. - Find the chapter 01 staged
Source\Game\LastPerimeterApp.cs. The staged app has fewer systems than the final game; use its actual methods for this lesson.
Code anchors
last-perimeter/Platforms/DesktopVK/last-perimeter/Platforms/WindowsDX12/last-perimeter/Source/Game/LastPerimeterApp.cslast-perimeter/Source/Rendering/PrimitiveDrawing.cs
Guided operations
Run commands from your learner project's LastPerimeter solution folder:
powershell
dotnet build LastPerimeter.sln
dotnet run --project Platforms\DesktopVK
dotnet run --project Platforms\DesktopVK -- --smoke-test-seconds 2If you created the optional WindowsDX12 host, also try dotnet run --project Platforms\WindowsDX12. For DesktopGL, substitute Platforms\DesktopGL as described in getting started.
- Open
Platforms\DesktopVK\Program.cs(orPlatforms\DesktopGL\Program.csfor the fallback) and, if created,Platforms\WindowsDX12\Program.cs. Follow the entry point toLastPerimeterApp; record what the host does not own. - In your staged
LastPerimeterApp, find the constructor,Initialize,LoadContent,Update,Draw, andDispose. Some exit/profile handling is introduced in later chapters. - Identify which objects require a graphics device and which systems can be constructed and tested without one.
- Launch the regular app and the bounded smoke run. Observe startup, first frame, and clean exit.
Checkpoint
The solution builds and the DesktopVK window renders and closes. You can describe why Draw presents the current state but should not decide whether a claim succeeds.
Common mistakes
- Running a command from the repository root instead of your learner project's solution folder.
- Adding game rules to a platform host instead of shared source.
- Assuming an empty
Content/Assetsfolder means the game is missing required art; visuals are procedural.
Questions and extension
What must be disposed when the app exits? Compare the two hosts and verify that both use the same game behavior.

