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