ホーム › Graphics.Direct3D11 › D3D11_TEXTURE3D_DESC
D3D11_TEXTURE3D_DESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Width | DWORD | 4 | +0 | +0 | テクスチャの幅(テクセル単位)。 |
| Height | DWORD | 4 | +4 | +4 | テクスチャの高さ(テクセル単位)。 |
| Depth | DWORD | 4 | +8 | +8 | テクスチャの深度(テクセル単位)。 |
| MipLevels | DWORD | 4 | +12 | +12 | ミップマップレベルの数。0で全レベル生成を指示する。 |
| Format | DXGI_FORMAT | 4 | +16 | +16 | テクスチャのデータフォーマット(DXGI_FORMAT)。 |
| Usage | D3D11_USAGE | 4 | +20 | +20 | テクスチャの想定使用法を示す列挙値。 |
| BindFlags | DWORD | 4 | +24 | +24 | パイプラインへのバインド方法を示すフラグの組み合わせ。 |
| CPUAccessFlags | DWORD | 4 | +28 | +28 | CPUによる読み書きアクセスの種類を示すフラグ。0も可。 |
| MiscFlags | DWORD | 4 | +32 | +32 | リソースのその他のオプションを示すフラグ。0も可。 |
各言語での定義
#include <windows.h>
// D3D11_TEXTURE3D_DESC (x64 36 / x86 36 バイト)
typedef struct D3D11_TEXTURE3D_DESC {
DWORD Width;
DWORD Height;
DWORD Depth;
DWORD MipLevels;
DXGI_FORMAT Format;
D3D11_USAGE Usage;
DWORD BindFlags;
DWORD CPUAccessFlags;
DWORD MiscFlags;
} D3D11_TEXTURE3D_DESC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_TEXTURE3D_DESC
{
public uint Width;
public uint Height;
public uint Depth;
public uint MipLevels;
public int Format;
public int Usage;
public uint BindFlags;
public uint CPUAccessFlags;
public uint MiscFlags;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_TEXTURE3D_DESC
Public Width As UInteger
Public Height As UInteger
Public Depth As UInteger
Public MipLevels As UInteger
Public Format As Integer
Public Usage As Integer
Public BindFlags As UInteger
Public CPUAccessFlags As UInteger
Public MiscFlags As UInteger
End Structureimport ctypes
from ctypes import wintypes
class D3D11_TEXTURE3D_DESC(ctypes.Structure):
_fields_ = [
("Width", wintypes.DWORD),
("Height", wintypes.DWORD),
("Depth", wintypes.DWORD),
("MipLevels", wintypes.DWORD),
("Format", ctypes.c_int),
("Usage", ctypes.c_int),
("BindFlags", wintypes.DWORD),
("CPUAccessFlags", wintypes.DWORD),
("MiscFlags", wintypes.DWORD),
]#[repr(C)]
pub struct D3D11_TEXTURE3D_DESC {
pub Width: u32,
pub Height: u32,
pub Depth: u32,
pub MipLevels: u32,
pub Format: i32,
pub Usage: i32,
pub BindFlags: u32,
pub CPUAccessFlags: u32,
pub MiscFlags: u32,
}import "golang.org/x/sys/windows"
type D3D11_TEXTURE3D_DESC struct {
Width uint32
Height uint32
Depth uint32
MipLevels uint32
Format int32
Usage int32
BindFlags uint32
CPUAccessFlags uint32
MiscFlags uint32
}type
D3D11_TEXTURE3D_DESC = record
Width: DWORD;
Height: DWORD;
Depth: DWORD;
MipLevels: DWORD;
Format: Integer;
Usage: Integer;
BindFlags: DWORD;
CPUAccessFlags: DWORD;
MiscFlags: DWORD;
end;const D3D11_TEXTURE3D_DESC = extern struct {
Width: u32,
Height: u32,
Depth: u32,
MipLevels: u32,
Format: i32,
Usage: i32,
BindFlags: u32,
CPUAccessFlags: u32,
MiscFlags: u32,
};type
D3D11_TEXTURE3D_DESC {.bycopy.} = object
Width: uint32
Height: uint32
Depth: uint32
MipLevels: uint32
Format: int32
Usage: int32
BindFlags: uint32
CPUAccessFlags: uint32
MiscFlags: uint32struct D3D11_TEXTURE3D_DESC
{
uint Width;
uint Height;
uint Depth;
uint MipLevels;
int Format;
int Usage;
uint BindFlags;
uint CPUAccessFlags;
uint MiscFlags;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D11_TEXTURE3D_DESC サイズ: 36 バイト(x64)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; Width : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Height : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Depth : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; MipLevels : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; Format : DXGI_FORMAT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Usage : D3D11_USAGE (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; BindFlags : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; CPUAccessFlags : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; MiscFlags : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D11_TEXTURE3D_DESC
#field int Width
#field int Height
#field int Depth
#field int MipLevels
#field int Format
#field int Usage
#field int BindFlags
#field int CPUAccessFlags
#field int MiscFlags
#endstruct
stdim st, D3D11_TEXTURE3D_DESC ; NSTRUCT 変数を確保
st->Width = 100
mes "Width=" + st->Width