Game Development Reference
In-Depth Information
Draw the Frame
Present the Frame to the Screen
}
Although we will later look at this loop in detail, there are two items that you might not
expect. WinRT provides a method dispatch system that allows for the code to run on
specific threads. This is important because now the operating system can generate
events from different OS threads and we will only receive them on the main game
thread (the one that runs the game loop). If you're using XAML, this becomes even
more important as certain actions will crash if they are not run on the UI thread. By
providing the dispatcher, we now have an easy way to fire off non-thread safe ac-
tions and ensure that they run on the thread we want them to.
The final item you may not have seen before involves presenting the frame to the
screen. This will be covered in detail later in the chapter, but briefly, this is where
we signal that we are done with drawing and the graphics API can take the final
rendered frame and display it on the monitor.
Search WWH ::




Custom Search