user2361925
user2361925

Reputation: 81

C# XNA - Drawing into a form that is bigger than the main window

Drawing into a form that is bigger than the main window with GraphicsDevice.Present results in the form cutting the stuff that is drawn along an imaginary border, which has exactly the size of the main window. I added a picture to be clear

img

The red rectangle has the same size as the Main Form. Main Form is an XNA Game, whereas Secondary Form is a Windows Form, which Main Form draws on with GraphicsDevice.Present

I tried setting the Viewport which results in an exception.

Upvotes: 1

Views: 91

Answers (1)

Andrew Russell
Andrew Russell

Reputation: 27235

Use the official WinForms sample. It has correct support for multiple windows (and includes an explanation of how it works).

The Game class doesn't support this.

Upvotes: 1

Related Questions