Compartir a través de


Device.Present Method ()

Presents the display with the contents of the next buffer in the sequence of back buffers owned by the device.

Namespace: Microsoft.WindowsMobile.DirectX.Direct3D
Assembly: Microsoft.WindowsMobile.DirectX (in microsoft.windowsmobile.directx.dll)

Syntax

'Declaration
Public Sub Present
'Usage
Dim instance As Device

instance.Present
public void Present ()
public:
void Present ()
public void Present ()
public function Present ()
Not applicable.

Exceptions

Exception type Condition

DriverInternalErrorException

Internal driver error. Applications should generally shut down when receiving this error.

DeviceLostException

The device is lost but cannot be reset at this time. Therefore, rendering is not possible.

InvalidCallException

The method call is invalid. For example, a method's parameter might contain an invalid value.

Remarks

If necessary, a stretch operation is applied to transfer the pixels within the source rectangle to the destination rectangle in the client area of the target window.

This method fails and throws an InvalidCallException exception if it is called between BeginScene and EndScene pairs, unless the render target is not the current render target .For example, this can happen with a back buffer that results from the creation of an additional swap chain.

Example

The following example demonstrates how to use the Present method.

Private Sub Render()
    If device Is Nothing Then
        Return
    End If
    'Clear the backbuffer to a blue color. 
    device.Clear(ClearFlags.Target, System.Drawing.Color.Blue, 1.0F, 0)
    'Begin the scene.
    device.BeginScene()

    'Render scene objects, if desired.
    'End the scene.
    device.EndScene()
    device.Present()

End Sub
private void Render()
{
    if (device == null)
        return;

    //Clear the backbuffer to a blue color. 
    device.Clear(ClearFlags.Target, System.Drawing.Color.Blue, 1.0f, 0);
    //Begin the scene.
    device.BeginScene();

    // Rendering scene objects, if desired.

    //End the scene.
    device.EndScene();
    device.Present();
}

Platforms

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Compact Framework

Supported in: 2.0

See Also

Reference

Device Class
Device Members
Microsoft.WindowsMobile.DirectX.Direct3D Namespace