ホーム › Graphics.Direct3D11 › D3D11_TEXTURE3D_DESC1
D3D11_TEXTURE3D_DESC1
構造体サイズ=各フィールドのバイト数(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フォーマット。 |
| Usage | D3D11_USAGE | 4 | +20 | +20 | リソースの使用法(GPU/CPUアクセス方式)を示すD3D11_USAGE列挙値。 |
| BindFlags | DWORD | 4 | +24 | +24 | パイプラインへのバインド方法を示すD3D11_BIND_FLAGビットフラグ。 |
| CPUAccessFlags | DWORD | 4 | +28 | +28 | CPUからのアクセス種別を示すD3D11_CPU_ACCESS_FLAGビットフラグ。不要なら0。 |
| MiscFlags | DWORD | 4 | +32 | +32 | その他のオプションを示すD3D11_RESOURCE_MISC_FLAGビットフラグ。不要なら0。 |
| TextureLayout | D3D11_TEXTURE_LAYOUT | 4 | +36 | +36 | テクスチャのメモリレイアウトを示すD3D11_TEXTURE_LAYOUT列挙値。 |
各言語での定義
#include <windows.h>
// D3D11_TEXTURE3D_DESC1 (x64 40 / x86 40 バイト)
typedef struct D3D11_TEXTURE3D_DESC1 {
DWORD Width;
DWORD Height;
DWORD Depth;
DWORD MipLevels;
DXGI_FORMAT Format;
D3D11_USAGE Usage;
DWORD BindFlags;
DWORD CPUAccessFlags;
DWORD MiscFlags;
D3D11_TEXTURE_LAYOUT TextureLayout;
} D3D11_TEXTURE3D_DESC1;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_TEXTURE3D_DESC1
{
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;
public int TextureLayout;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_TEXTURE3D_DESC1
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
Public TextureLayout As Integer
End Structureimport ctypes
from ctypes import wintypes
class D3D11_TEXTURE3D_DESC1(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),
("TextureLayout", ctypes.c_int),
]#[repr(C)]
pub struct D3D11_TEXTURE3D_DESC1 {
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,
pub TextureLayout: i32,
}import "golang.org/x/sys/windows"
type D3D11_TEXTURE3D_DESC1 struct {
Width uint32
Height uint32
Depth uint32
MipLevels uint32
Format int32
Usage int32
BindFlags uint32
CPUAccessFlags uint32
MiscFlags uint32
TextureLayout int32
}type
D3D11_TEXTURE3D_DESC1 = record
Width: DWORD;
Height: DWORD;
Depth: DWORD;
MipLevels: DWORD;
Format: Integer;
Usage: Integer;
BindFlags: DWORD;
CPUAccessFlags: DWORD;
MiscFlags: DWORD;
TextureLayout: Integer;
end;const D3D11_TEXTURE3D_DESC1 = extern struct {
Width: u32,
Height: u32,
Depth: u32,
MipLevels: u32,
Format: i32,
Usage: i32,
BindFlags: u32,
CPUAccessFlags: u32,
MiscFlags: u32,
TextureLayout: i32,
};type
D3D11_TEXTURE3D_DESC1 {.bycopy.} = object
Width: uint32
Height: uint32
Depth: uint32
MipLevels: uint32
Format: int32
Usage: int32
BindFlags: uint32
CPUAccessFlags: uint32
MiscFlags: uint32
TextureLayout: int32struct D3D11_TEXTURE3D_DESC1
{
uint Width;
uint Height;
uint Depth;
uint MipLevels;
int Format;
int Usage;
uint BindFlags;
uint CPUAccessFlags;
uint MiscFlags;
int TextureLayout;
}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_DESC1 サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 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 も可)
; TextureLayout : D3D11_TEXTURE_LAYOUT (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D11_TEXTURE3D_DESC1
#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
#field int TextureLayout
#endstruct
stdim st, D3D11_TEXTURE3D_DESC1 ; NSTRUCT 変数を確保
st->Width = 100
mes "Width=" + st->Width