I’m creating a game application using Microsoft XNA that will run on one public-facing screen (projector) with controls on the laptop screen (Windows 7.) When the second monitor is not available, I’d like only the public-facing screen to show on the laptop screen. The proportions of the screens will be identical.
Is there a library to allow us to do this automatically, or at worst by changing a setting?
Check if there are two monitors available with
GraphicsAdapter.Adapters.Count()If there are, create another form, and set it to the second monitor (projector). Then, with every frame, render your public-facing interface onto the secondary monitor, and draw the controls onto the primary.
To switch between forms, just swap the handles:
Otherwise, draw the public-facing only.
You can read about how to use WinForms with XNA at http://create.msdn.com/en-US/education/catalog/sample/winforms_series_1
This solution assumes two things: