ホーム › Graphics.Direct3D9 › D3DEXECUTEDATA
D3DEXECUTEDATA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | 本構造体のサイズ(バイト単位)。 |
| dwVertexOffset | DWORD | 4 | +4 | +4 | 頂点リストの実行バッファ内オフセット。 |
| dwVertexCount | DWORD | 4 | +8 | +8 | 頂点の数。 |
| dwInstructionOffset | DWORD | 4 | +12 | +12 | 命令リストの実行バッファ内オフセット。 |
| dwInstructionLength | DWORD | 4 | +16 | +16 | 命令リストの長さ(バイト単位)。 |
| dwHVertexOffset | DWORD | 4 | +20 | +20 | 同次頂点データのオフセット。 |
| dsStatus | D3DSTATUS | 24 | +24 | +24 | 実行後のステータス情報(D3DSTATUS)。 |
各言語での定義
#include <windows.h>
// D3DRECT (x64 16 / x86 16 バイト)
typedef struct D3DRECT {
INT x1;
INT y1;
INT x2;
INT y2;
} D3DRECT;
// D3DSTATUS (x64 24 / x86 24 バイト)
typedef struct D3DSTATUS {
DWORD dwFlags;
DWORD dwStatus;
D3DRECT drExtent;
} D3DSTATUS;
// D3DEXECUTEDATA (x64 48 / x86 48 バイト)
typedef struct D3DEXECUTEDATA {
DWORD dwSize;
DWORD dwVertexOffset;
DWORD dwVertexCount;
DWORD dwInstructionOffset;
DWORD dwInstructionLength;
DWORD dwHVertexOffset;
D3DSTATUS dsStatus;
} D3DEXECUTEDATA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3DRECT
{
public int x1;
public int y1;
public int x2;
public int y2;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3DSTATUS
{
public uint dwFlags;
public uint dwStatus;
public D3DRECT drExtent;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3DEXECUTEDATA
{
public uint dwSize;
public uint dwVertexOffset;
public uint dwVertexCount;
public uint dwInstructionOffset;
public uint dwInstructionLength;
public uint dwHVertexOffset;
public D3DSTATUS dsStatus;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3DRECT
Public x1 As Integer
Public y1 As Integer
Public x2 As Integer
Public y2 As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3DSTATUS
Public dwFlags As UInteger
Public dwStatus As UInteger
Public drExtent As D3DRECT
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3DEXECUTEDATA
Public dwSize As UInteger
Public dwVertexOffset As UInteger
Public dwVertexCount As UInteger
Public dwInstructionOffset As UInteger
Public dwInstructionLength As UInteger
Public dwHVertexOffset As UInteger
Public dsStatus As D3DSTATUS
End Structureimport ctypes
from ctypes import wintypes
class D3DRECT(ctypes.Structure):
_fields_ = [
("x1", ctypes.c_int),
("y1", ctypes.c_int),
("x2", ctypes.c_int),
("y2", ctypes.c_int),
]
class D3DSTATUS(ctypes.Structure):
_fields_ = [
("dwFlags", wintypes.DWORD),
("dwStatus", wintypes.DWORD),
("drExtent", D3DRECT),
]
class D3DEXECUTEDATA(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwVertexOffset", wintypes.DWORD),
("dwVertexCount", wintypes.DWORD),
("dwInstructionOffset", wintypes.DWORD),
("dwInstructionLength", wintypes.DWORD),
("dwHVertexOffset", wintypes.DWORD),
("dsStatus", D3DSTATUS),
]#[repr(C)]
pub struct D3DRECT {
pub x1: i32,
pub y1: i32,
pub x2: i32,
pub y2: i32,
}
#[repr(C)]
pub struct D3DSTATUS {
pub dwFlags: u32,
pub dwStatus: u32,
pub drExtent: D3DRECT,
}
#[repr(C)]
pub struct D3DEXECUTEDATA {
pub dwSize: u32,
pub dwVertexOffset: u32,
pub dwVertexCount: u32,
pub dwInstructionOffset: u32,
pub dwInstructionLength: u32,
pub dwHVertexOffset: u32,
pub dsStatus: D3DSTATUS,
}import "golang.org/x/sys/windows"
type D3DRECT struct {
x1 int32
y1 int32
x2 int32
y2 int32
}
type D3DSTATUS struct {
dwFlags uint32
dwStatus uint32
drExtent D3DRECT
}
type D3DEXECUTEDATA struct {
dwSize uint32
dwVertexOffset uint32
dwVertexCount uint32
dwInstructionOffset uint32
dwInstructionLength uint32
dwHVertexOffset uint32
dsStatus D3DSTATUS
}type
D3DRECT = record
x1: Integer;
y1: Integer;
x2: Integer;
y2: Integer;
end;
D3DSTATUS = record
dwFlags: DWORD;
dwStatus: DWORD;
drExtent: D3DRECT;
end;
D3DEXECUTEDATA = record
dwSize: DWORD;
dwVertexOffset: DWORD;
dwVertexCount: DWORD;
dwInstructionOffset: DWORD;
dwInstructionLength: DWORD;
dwHVertexOffset: DWORD;
dsStatus: D3DSTATUS;
end;const D3DRECT = extern struct {
x1: i32,
y1: i32,
x2: i32,
y2: i32,
};
const D3DSTATUS = extern struct {
dwFlags: u32,
dwStatus: u32,
drExtent: D3DRECT,
};
const D3DEXECUTEDATA = extern struct {
dwSize: u32,
dwVertexOffset: u32,
dwVertexCount: u32,
dwInstructionOffset: u32,
dwInstructionLength: u32,
dwHVertexOffset: u32,
dsStatus: D3DSTATUS,
};type
D3DRECT {.bycopy.} = object
x1: int32
y1: int32
x2: int32
y2: int32
D3DSTATUS {.bycopy.} = object
dwFlags: uint32
dwStatus: uint32
drExtent: D3DRECT
D3DEXECUTEDATA {.bycopy.} = object
dwSize: uint32
dwVertexOffset: uint32
dwVertexCount: uint32
dwInstructionOffset: uint32
dwInstructionLength: uint32
dwHVertexOffset: uint32
dsStatus: D3DSTATUSstruct D3DRECT
{
int x1;
int y1;
int x2;
int y2;
}
struct D3DSTATUS
{
uint dwFlags;
uint dwStatus;
D3DRECT drExtent;
}
struct D3DEXECUTEDATA
{
uint dwSize;
uint dwVertexOffset;
uint dwVertexCount;
uint dwInstructionOffset;
uint dwInstructionLength;
uint dwHVertexOffset;
D3DSTATUS dsStatus;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3DEXECUTEDATA サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwVertexOffset : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwVertexCount : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwInstructionOffset : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwInstructionLength : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwHVertexOffset : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dsStatus : D3DSTATUS (+24, 24byte) varptr(st)+24 を基点に操作(24byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global D3DRECT
#field int x1
#field int y1
#field int x2
#field int y2
#endstruct
#defstruct global D3DSTATUS
#field int dwFlags
#field int dwStatus
#field D3DRECT drExtent
#endstruct
#defstruct global D3DEXECUTEDATA
#field int dwSize
#field int dwVertexOffset
#field int dwVertexCount
#field int dwInstructionOffset
#field int dwInstructionLength
#field int dwHVertexOffset
#field D3DSTATUS dsStatus
#endstruct
stdim st, D3DEXECUTEDATA ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize