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

D3DRECTPATCH_INFO

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

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

フィールド

フィールドサイズx64x86説明
StartVertexOffsetWidthDWORD4+0+0幅方向の開始頂点オフセット。
StartVertexOffsetHeightDWORD4+4+4高さ方向の開始頂点オフセット。
WidthDWORD4+8+8パッチの幅方向の頂点数。
HeightDWORD4+12+12パッチの高さ方向の頂点数。
StrideDWORD4+16+16頂点配列の行間ストライド。
BasisD3DBASISTYPE4+20+20パッチの基底関数の種別を示すD3DBASISTYPE。
DegreeD3DDEGREETYPE4+24+24パッチの次数を示すD3DDEGREETYPE。

各言語での定義

#include <windows.h>

// D3DRECTPATCH_INFO  (x64 28 / x86 28 バイト)
typedef struct D3DRECTPATCH_INFO {
    DWORD StartVertexOffsetWidth;
    DWORD StartVertexOffsetHeight;
    DWORD Width;
    DWORD Height;
    DWORD Stride;
    D3DBASISTYPE Basis;
    D3DDEGREETYPE Degree;
} D3DRECTPATCH_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3DRECTPATCH_INFO
{
    public uint StartVertexOffsetWidth;
    public uint StartVertexOffsetHeight;
    public uint Width;
    public uint Height;
    public uint Stride;
    public int Basis;
    public int Degree;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3DRECTPATCH_INFO
    Public StartVertexOffsetWidth As UInteger
    Public StartVertexOffsetHeight As UInteger
    Public Width As UInteger
    Public Height As UInteger
    Public Stride As UInteger
    Public Basis As Integer
    Public Degree As Integer
End Structure
import ctypes
from ctypes import wintypes

class D3DRECTPATCH_INFO(ctypes.Structure):
    _fields_ = [
        ("StartVertexOffsetWidth", wintypes.DWORD),
        ("StartVertexOffsetHeight", wintypes.DWORD),
        ("Width", wintypes.DWORD),
        ("Height", wintypes.DWORD),
        ("Stride", wintypes.DWORD),
        ("Basis", ctypes.c_int),
        ("Degree", ctypes.c_int),
    ]
#[repr(C)]
pub struct D3DRECTPATCH_INFO {
    pub StartVertexOffsetWidth: u32,
    pub StartVertexOffsetHeight: u32,
    pub Width: u32,
    pub Height: u32,
    pub Stride: u32,
    pub Basis: i32,
    pub Degree: i32,
}
import "golang.org/x/sys/windows"

type D3DRECTPATCH_INFO struct {
	StartVertexOffsetWidth uint32
	StartVertexOffsetHeight uint32
	Width uint32
	Height uint32
	Stride uint32
	Basis int32
	Degree int32
}
type
  D3DRECTPATCH_INFO = record
    StartVertexOffsetWidth: DWORD;
    StartVertexOffsetHeight: DWORD;
    Width: DWORD;
    Height: DWORD;
    Stride: DWORD;
    Basis: Integer;
    Degree: Integer;
  end;
const D3DRECTPATCH_INFO = extern struct {
    StartVertexOffsetWidth: u32,
    StartVertexOffsetHeight: u32,
    Width: u32,
    Height: u32,
    Stride: u32,
    Basis: i32,
    Degree: i32,
};
type
  D3DRECTPATCH_INFO {.bycopy.} = object
    StartVertexOffsetWidth: uint32
    StartVertexOffsetHeight: uint32
    Width: uint32
    Height: uint32
    Stride: uint32
    Basis: int32
    Degree: int32
struct D3DRECTPATCH_INFO
{
    uint StartVertexOffsetWidth;
    uint StartVertexOffsetHeight;
    uint Width;
    uint Height;
    uint Stride;
    int Basis;
    int Degree;
}

HSP用 定義

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

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

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