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


TextureLoader - класс

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

Содержит функции загрузки текстур.

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

Синтаксис

'Декларация
Public NotInheritable Class TextureLoader
'Применение
Dim instance As TextureLoader
public sealed class TextureLoader
public ref class TextureLoader sealed
public final class TextureLoader

Примеры

В следующем примере кода демонстрируется загрузка текстуры.

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

' Called whenever the rendering device is reset.
Private Sub OnResetDevice(ByVal sender As Object, ByVal e As EventArgs) 
    Dim dev As Device = CType(sender, Device)
    ' Turn off culling, to 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, to 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"));
}

Иерархия наследования

System.Object
  Microsoft.WindowsMobile.DirectX.Direct3D.TextureLoader

Потокобезопасность

Любые открытые члены этого типа, объявленные как static (Shared в Visual Basic), являются потокобезопасными. Потокобезопасность членов экземпляров не гарантируется.

Платформы

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

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

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

.NET Compact Framework

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

См. также

Ссылки

TextureLoader - члены

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

Другие ресурсы

Мобильное программирование Direct3D в .NET Compact Framework