Share via


GraphicsDevice.Present Method (IntPtr)

Specifies the window target for a presentation and presents the display with the contents of the next buffer in the sequence of back buffers owned by the GraphicsDevice.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Syntax

public void Present (
         IntPtr overrideWindowHandle
)

Parameters

  • overrideWindowHandle
    Destination window containing the client area that is the target for this presentation. If not specified, this is DeviceWindowHandle.

Exceptions

Exception type Condition
ObjectDisposedException Present was called after the GraphicsDevice was disposed.
DriverInternalErrorException Internal driver error. Applications should generally shut down when receiving this error.
DeviceLostException The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.

Remarks

Warning

On Xbox 360, all render targets (including the back buffer) share the same memory. Because of this, the previous content of any render target is lost when the render target is changed with SetRenderTarget or when Present is called, which has the same effect as swapping the render target.

To preserve the data in a render target, it is necessary to resolve it, either with ResolveRenderTarget or ResolveBackBuffer. Just remember to resolve the render target before switching the render target to avoid losing data that you want to preserve.

See Also

Reference

Present
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista