Win32 API 日本語リファレンス
ホームGraphics.Direct3D11 › D3D11_TILE_REGION_SIZE

D3D11_TILE_REGION_SIZE

構造体
サイズx64: 16 バイト / x86: 16 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
NumTilesDWORD4+0+0領域に含まれるタイルの総数。
bUseBoxBOOL4+4+4Width/Height/Depthで矩形ボックスとして指定するか。FALSEならNumTilesで線形指定。
WidthDWORD4+8+8ボックス指定時の幅(タイル数)。
HeightWORD2+12+12ボックス指定時の高さ(タイル数)。
DepthWORD2+14+14ボックス指定時の奥行き(タイル数)。

各言語での定義

#include <windows.h>

// D3D11_TILE_REGION_SIZE  (x64 16 / x86 16 バイト)
typedef struct D3D11_TILE_REGION_SIZE {
    DWORD NumTiles;
    BOOL bUseBox;
    DWORD Width;
    WORD Height;
    WORD Depth;
} D3D11_TILE_REGION_SIZE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_TILE_REGION_SIZE
{
    public uint NumTiles;
    [MarshalAs(UnmanagedType.Bool)] public bool bUseBox;
    public uint Width;
    public ushort Height;
    public ushort Depth;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_TILE_REGION_SIZE
    Public NumTiles As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public bUseBox As Boolean
    Public Width As UInteger
    Public Height As UShort
    Public Depth As UShort
End Structure
import ctypes
from ctypes import wintypes

class D3D11_TILE_REGION_SIZE(ctypes.Structure):
    _fields_ = [
        ("NumTiles", wintypes.DWORD),
        ("bUseBox", wintypes.BOOL),
        ("Width", wintypes.DWORD),
        ("Height", ctypes.c_ushort),
        ("Depth", ctypes.c_ushort),
    ]
#[repr(C)]
pub struct D3D11_TILE_REGION_SIZE {
    pub NumTiles: u32,
    pub bUseBox: i32,
    pub Width: u32,
    pub Height: u16,
    pub Depth: u16,
}
import "golang.org/x/sys/windows"

type D3D11_TILE_REGION_SIZE struct {
	NumTiles uint32
	bUseBox int32
	Width uint32
	Height uint16
	Depth uint16
}
type
  D3D11_TILE_REGION_SIZE = record
    NumTiles: DWORD;
    bUseBox: BOOL;
    Width: DWORD;
    Height: Word;
    Depth: Word;
  end;
const D3D11_TILE_REGION_SIZE = extern struct {
    NumTiles: u32,
    bUseBox: i32,
    Width: u32,
    Height: u16,
    Depth: u16,
};
type
  D3D11_TILE_REGION_SIZE {.bycopy.} = object
    NumTiles: uint32
    bUseBox: int32
    Width: uint32
    Height: uint16
    Depth: uint16
struct D3D11_TILE_REGION_SIZE
{
    uint NumTiles;
    int bUseBox;
    uint Width;
    ushort Height;
    ushort Depth;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D11_TILE_REGION_SIZE サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; NumTiles : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; bUseBox : BOOL (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Width : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Height : WORD (+12, 2byte)  wpoke st,12,値  /  値 = wpeek(st,12)
; Depth : WORD (+14, 2byte)  wpoke st,14,値  /  値 = wpeek(st,14)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D11_TILE_REGION_SIZE
    #field int NumTiles
    #field bool bUseBox
    #field int Width
    #field short Height
    #field short Depth
#endstruct

stdim st, D3D11_TILE_REGION_SIZE        ; NSTRUCT 変数を確保
st->NumTiles = 100
mes "NumTiles=" + st->NumTiles