ホーム › Graphics.Direct3D9 › D3DCOMPOSERECTDESC
D3DCOMPOSERECTDESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| X | WORD | 2 | +0 | +0 | 矩形の左上X座標(WORD)。 |
| Y | WORD | 2 | +2 | +2 | 矩形の左上Y座標(WORD)。 |
| Width | WORD | 2 | +4 | +4 | 矩形の幅(WORD)。 |
| Height | WORD | 2 | +6 | +6 | 矩形の高さ(WORD)。 |
各言語での定義
#include <windows.h>
// D3DCOMPOSERECTDESC (x64 8 / x86 8 バイト)
typedef struct D3DCOMPOSERECTDESC {
WORD X;
WORD Y;
WORD Width;
WORD Height;
} D3DCOMPOSERECTDESC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3DCOMPOSERECTDESC
{
public ushort X;
public ushort Y;
public ushort Width;
public ushort Height;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3DCOMPOSERECTDESC
Public X As UShort
Public Y As UShort
Public Width As UShort
Public Height As UShort
End Structureimport ctypes
from ctypes import wintypes
class D3DCOMPOSERECTDESC(ctypes.Structure):
_fields_ = [
("X", ctypes.c_ushort),
("Y", ctypes.c_ushort),
("Width", ctypes.c_ushort),
("Height", ctypes.c_ushort),
]#[repr(C)]
pub struct D3DCOMPOSERECTDESC {
pub X: u16,
pub Y: u16,
pub Width: u16,
pub Height: u16,
}import "golang.org/x/sys/windows"
type D3DCOMPOSERECTDESC struct {
X uint16
Y uint16
Width uint16
Height uint16
}type
D3DCOMPOSERECTDESC = record
X: Word;
Y: Word;
Width: Word;
Height: Word;
end;const D3DCOMPOSERECTDESC = extern struct {
X: u16,
Y: u16,
Width: u16,
Height: u16,
};type
D3DCOMPOSERECTDESC {.bycopy.} = object
X: uint16
Y: uint16
Width: uint16
Height: uint16struct D3DCOMPOSERECTDESC
{
ushort X;
ushort Y;
ushort Width;
ushort Height;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3DCOMPOSERECTDESC サイズ: 8 バイト(x64)
dim st, 2 ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; X : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; Y : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; Width : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; Height : WORD (+6, 2byte) wpoke st,6,値 / 値 = wpeek(st,6)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3DCOMPOSERECTDESC
#field short X
#field short Y
#field short Width
#field short Height
#endstruct
stdim st, D3DCOMPOSERECTDESC ; NSTRUCT 変数を確保
st->X = 100
mes "X=" + st->X