Поделиться через


Device.RenderState - свойство

Обновлен: Ноябрь 2007

Возвращает значение состояния рендеринга устройства.

Пространство имен:  Microsoft.WindowsMobile.DirectX.Direct3D
Сборка:  Microsoft.WindowsMobile.DirectX (в Microsoft.WindowsMobile.DirectX.dll)

Синтаксис

'Декларация
Public ReadOnly Property RenderState As RenderStateManager
'Применение
Dim instance As Device
Dim value As RenderStateManager

value = instance.RenderState
public RenderStateManager RenderState { get; }
public:
property RenderStateManager^ RenderState {
    RenderStateManager^ get ();
}
public function get RenderState () : RenderStateManager

Значение свойства

Тип: Microsoft.WindowsMobile.DirectX.Direct3D.RenderStateManager
Возвращает структуру RenderStateManager устройства.

Примеры

В следующем примере демонстрируется использование свойства RenderState.

' This code example is taken from the
' Direct3D Mobile Texture Sample included with the
' .NET Compact Framework samples.

' Called whenever the rendering device is reset.
Friend Sub OnResetDevice(ByVal sender As Object, ByVal e As EventArgs)
    Dim dev As Device = CType(sender, Device)
    ' Turn off culling, so we see the front and back of the triangle.
    dev.RenderState.CullMode = Cull.None
    ' Turn off D3D lighting.
    dev.RenderState.Lighting = False
    ' Turn on the ZBuffer.
    dev.RenderState.ZBufferEnable = True
    ' Turn on perspective correction for textures.
    ' This provides a more accurate visual at the cost
    ' of a small performance overhead.
    dev.RenderState.TexturePerspective = True
    ' Now create the texture.
    texture = TextureLoader.FromStream(dev, _
      [Assembly].GetExecutingAssembly().GetManifestResourceStream("Texture.Content.Banana.bmp"))

End Sub

// This code example is taken from the
// Direct3D Mobile Texture Sample included with the
// .NET Compact Framework samples.

// Called whenever the rendering device is reset.
void OnResetDevice(object sender, EventArgs e)
{
    Device dev = (Device)sender;
    // Turn off culling, so we see the front and back of the triangle
    dev.RenderState.CullMode = Cull.None;
    // Turn off D3D lighting
    dev.RenderState.Lighting = false;
    // Turn on the ZBuffer
    dev.RenderState.ZBufferEnable = true;
    // Turn on perspective correction for textures
    // This provides a more accurate visual at the cost
    // of a small performance overhead
    dev.RenderState.TexturePerspective = true;
    // Now create our texture

    texture = TextureLoader.FromStream(dev,
        Assembly.GetExecutingAssembly().GetManifestResourceStream(
        "Texture.Content.Banana.bmp"));
}

Разрешения

Платформы

Windows CE, Windows Mobile for Smartphone, Windows Mobile для карманных ПК

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Compact Framework

Поддерживается в версиях: 3.5, 2.0

См. также

Ссылки

Device Класс

Device - члены

Microsoft.WindowsMobile.DirectX.Direct3D - пространство имен