Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
Device Class
Device Methods
 EndScene Method

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
Device..::.EndScene Method

Updated: April 2009

Ends a scene that was started by calling the BeginScene method.

Namespace:  Microsoft.WindowsMobile.DirectX.Direct3D
Assembly:  Microsoft.WindowsMobile.DirectX (in Microsoft.WindowsMobile.DirectX.dll)
Visual Basic (Declaration)
Public Sub EndScene
Visual Basic (Usage)
Dim instance As Device

instance.EndScene()
C#
public void EndScene()
Visual C++
public:
void EndScene()
JScript
public function EndScene()

This method unlocks the back buffer which is used for drawing graphical objects. Every call to BeginScene should eventually be followed by a call to EndScene before the display is updated with Present.

When EndScene succeeds, the scene is queued up for rendering by the driver. The method is not synchronous, so the scene is not guaranteed to have completed rendering when the method returns.

The following code example shows beginning and ending a scene.

Visual Basic
Protected Overrides Sub OnPaint(ByVal eventg As PaintEventArgs) 
    device.Clear(ClearFlags.Target, Color.Black, 0F, 0)
    device.BeginScene()
    sprite.Begin(SpriteFlags.None)
    sprite.Draw(texture, Vector3.Empty, New Vector3(10, 10, 0), &HFFFFFF)
    sprite.End()
    device.EndScene()
    device.Present()

End Sub


C#
protected override void OnPaint(PaintEventArgs eventg)
{
    device.Clear(ClearFlags.Target, Color.Black, 0.0f, 0);
    device.BeginScene();
    sprite.Begin(SpriteFlags.None);
    sprite.Draw(texture, Vector3.Empty, new Vector3(10, 10, 0), 0x00ffffff);
    sprite.End();
    device.EndScene();
    device.Present();
}

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

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Compact Framework

Supported in: 3.5, 2.0

Date

History

Reason

April 2009

Added descriptive information.

Customer feedback.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker