Texture, classe
Mise à jour : novembre 2007
Manipule une ressource de texture.
Espace de noms : Microsoft.WindowsMobile.DirectX.Direct3D
Assembly : Microsoft.WindowsMobile.DirectX (dans Microsoft.WindowsMobile.DirectX.dll)
Syntaxe
'Déclaration
Public Class Texture _
Inherits BaseTexture _
Implements IDisposable
'Utilisation
Dim instance As Texture
public class Texture : BaseTexture, IDisposable
public ref class Texture : public BaseTexture,
IDisposable
public class Texture extends BaseTexture implements IDisposable
Notes
Cet objet hérite de fonctionnalités de BaseTexture.
Exemples
L'exemple de code suivant montre comment utiliser une texture.
' 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"));
}
Hiérarchie d'héritage
System.Object
Microsoft.WindowsMobile.DirectX.Direct3D.Resource
Microsoft.WindowsMobile.DirectX.Direct3D.BaseTexture
Microsoft.WindowsMobile.DirectX.Direct3D.Texture
Sécurité des threads
Tous les membres static (Shared en Visual Basic) publics de ce type sont thread-safe. Il n'est pas garanti que les membres d'instance soient thread-safe.
Plateformes
Windows CE, Windows Mobile pour Smartphone, Windows Mobile pour Pocket PC
Le .NET Framework et le .NET Compact Framework ne prennent pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.
Informations de version
.NET Compact Framework
Pris en charge dans : 3.5, 2.0
Voir aussi
Référence
Microsoft.WindowsMobile.DirectX.Direct3D, espace de noms
Autres ressources
Programmation Direct3D Mobile dans le .NET Compact Framework