Struttura SurfaceCaps
Aggiornamento: novembre 2007
Rappresenta informazioni sulle funzionalità relative alla superficie.
Spazio dei nomi: Microsoft.WindowsMobile.DirectX.Direct3D
Assembly: Microsoft.WindowsMobile.DirectX (in Microsoft.WindowsMobile.DirectX.dll)
Sintassi
'Dichiarazione
Public Structure SurfaceCaps
'Utilizzo
Dim instance As SurfaceCaps
public struct SurfaceCaps
public value class SurfaceCaps
JScript supporta l'utilizzo di strutture ma non la dichiarazione di nuove.
Esempi
Nell'esempio di codice riportato di seguito viene illustrato come utilizzare una struttura SurfaceCaps.
' This code example is taken from the
' Direct3D Mobile Texture Sample of the
' .NET Compact Framework Samples in the SDK.
'
' Called whenever the rendering device is created
Private Sub OnCreateDevice(ByVal sender As Object, ByVal e As EventArgs)
Dim vertexBufferPool As Pool
Dim caps As Caps
Dim dev As Device = CType(sender, Device)
' Get the device capabilities
caps = dev.DeviceCaps
If caps.SurfaceCaps.SupportsVidVertexBuffer Then
vertexBufferPool = Pool.VideoMemory
Else
vertexBufferPool = Pool.SystemMemory
End If
' Now create the vertex buffer
vertexBuffer = New VertexBuffer(GetType(CustomVertex.PositionNormalTextured), 100, dev, Usage.WriteOnly, CustomVertex.PositionNormalTextured.Format, vertexBufferPool)
AddHandler vertexBuffer.Created, AddressOf Me.OnCreateVertexBuffer
Me.OnCreateVertexBuffer(vertexBuffer, Nothing)
End Sub
// This code example is taken from the
// Direct3D Mobile Texture Sample of the
// .NET Compact Framework Samples in the SDK.
// Called whenever the rendering device is created
void OnCreateDevice(object sender, EventArgs e)
{
Pool vertexBufferPool;
Caps caps;
Device dev = (Device)sender;
// Get the device capabilities
caps = dev.DeviceCaps;
if (caps.SurfaceCaps.SupportsVidVertexBuffer)
vertexBufferPool = Pool.VideoMemory;
else
vertexBufferPool = Pool.SystemMemory;
// Now create the vertex buffer.
vertexBuffer = new VertexBuffer(
typeof(CustomVertex.PositionNormalTextured), 100, dev,
Usage.WriteOnly, CustomVertex.PositionNormalTextured.Format,
vertexBufferPool);
vertexBuffer.Created += new System.EventHandler(
this.OnCreateVertexBuffer);
this.OnCreateVertexBuffer(vertexBuffer, null);
}
Codice thread safe
Qualsiasi membro static (Shared in Visual Basic) pubblico di questo tipo è thread-safe. I membri di istanza non sono garantiti come thread-safe.
Piattaforme
Windows CE, Windows Mobile per Smartphone, Windows Mobile per Pocket PC
.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.
Informazioni sulla versione
.NET Compact Framework
Supportato in: 3.5, 2.0
Vedere anche
Riferimenti
Spazio dei nomi Microsoft.WindowsMobile.DirectX.Direct3D
Altre risorse
Programmazione per Mobile Direct3D in .NET Compact Framework