Share via


SurfaceCaps (Estructura)

Actualización: noviembre 2007

Representa información sobre las funciones de superficie.

Espacio de nombres:  Microsoft.WindowsMobile.DirectX.Direct3D
Ensamblado:  Microsoft.WindowsMobile.DirectX (en Microsoft.WindowsMobile.DirectX.dll)

Sintaxis

'Declaración
Public Structure SurfaceCaps
'Uso
Dim instance As SurfaceCaps
public struct SurfaceCaps
public value class SurfaceCaps
JScript admite el uso de estructuras, pero no admite la declaración de estructuras nuevas.

Ejemplos

En el ejemplo de código siguiente se muestra cómo se utiliza una estructura 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);
}

Seguridad para subprocesos

Todos los miembros static (Shared en Visual Basic) públicos de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.

Plataformas

Windows CE, Windows Mobile para Smartphone, Windows Mobile para Pocket PC

.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

Información de versión

.NET Compact Framework

Compatible con: 3.5, 2.0

Vea también

Referencia

SurfaceCaps (Miembros)

Microsoft.WindowsMobile.DirectX.Direct3D (Espacio de nombres)

Otros recursos

Programar Mobile Direct3D en .NET Compact Framework