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

D3D10_EFFECT_TYPE_DESC

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

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

フィールド

フィールドサイズx64x86説明
TypeNameLPSTR8/4+0+0エフェクト型の名前を示す文字列。
ClassD3D_SHADER_VARIABLE_CLASS4+8+4型のクラス(スカラ/ベクトル/行列/オブジェクト等)を示す列挙値。
TypeD3D_SHADER_VARIABLE_TYPE4+12+8型の基本データ型を示す列挙値。
ElementsDWORD4+16+12配列要素の数。非配列なら0。
MembersDWORD4+20+16構造体メンバの数。
RowsDWORD4+24+20行列型の行数。
ColumnsDWORD4+28+24行列型の列数またはベクトルの要素数。
PackedSizeDWORD4+32+28パッキング後のサイズ(バイト単位)。
UnpackedSizeDWORD4+36+32パッキング前のサイズ(バイト単位)。
StrideDWORD4+40+36配列要素間のストライド(バイト単位)。

各言語での定義

#include <windows.h>

// D3D10_EFFECT_TYPE_DESC  (x64 48 / x86 40 バイト)
typedef struct D3D10_EFFECT_TYPE_DESC {
    LPSTR TypeName;
    D3D_SHADER_VARIABLE_CLASS Class;
    D3D_SHADER_VARIABLE_TYPE Type;
    DWORD Elements;
    DWORD Members;
    DWORD Rows;
    DWORD Columns;
    DWORD PackedSize;
    DWORD UnpackedSize;
    DWORD Stride;
} D3D10_EFFECT_TYPE_DESC;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D10_EFFECT_TYPE_DESC
{
    public IntPtr TypeName;
    public int Class;
    public int Type;
    public uint Elements;
    public uint Members;
    public uint Rows;
    public uint Columns;
    public uint PackedSize;
    public uint UnpackedSize;
    public uint Stride;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D10_EFFECT_TYPE_DESC
    Public TypeName As IntPtr
    Public Class As Integer
    Public Type As Integer
    Public Elements As UInteger
    Public Members As UInteger
    Public Rows As UInteger
    Public Columns As UInteger
    Public PackedSize As UInteger
    Public UnpackedSize As UInteger
    Public Stride As UInteger
End Structure
import ctypes
from ctypes import wintypes

class D3D10_EFFECT_TYPE_DESC(ctypes.Structure):
    _fields_ = [
        ("TypeName", ctypes.c_void_p),
        ("Class", ctypes.c_int),
        ("Type", ctypes.c_int),
        ("Elements", wintypes.DWORD),
        ("Members", wintypes.DWORD),
        ("Rows", wintypes.DWORD),
        ("Columns", wintypes.DWORD),
        ("PackedSize", wintypes.DWORD),
        ("UnpackedSize", wintypes.DWORD),
        ("Stride", wintypes.DWORD),
    ]
#[repr(C)]
pub struct D3D10_EFFECT_TYPE_DESC {
    pub TypeName: *mut core::ffi::c_void,
    pub Class: i32,
    pub Type: i32,
    pub Elements: u32,
    pub Members: u32,
    pub Rows: u32,
    pub Columns: u32,
    pub PackedSize: u32,
    pub UnpackedSize: u32,
    pub Stride: u32,
}
import "golang.org/x/sys/windows"

type D3D10_EFFECT_TYPE_DESC struct {
	TypeName uintptr
	Class int32
	Type int32
	Elements uint32
	Members uint32
	Rows uint32
	Columns uint32
	PackedSize uint32
	UnpackedSize uint32
	Stride uint32
}
type
  D3D10_EFFECT_TYPE_DESC = record
    TypeName: Pointer;
    Class: Integer;
    Type: Integer;
    Elements: DWORD;
    Members: DWORD;
    Rows: DWORD;
    Columns: DWORD;
    PackedSize: DWORD;
    UnpackedSize: DWORD;
    Stride: DWORD;
  end;
const D3D10_EFFECT_TYPE_DESC = extern struct {
    TypeName: ?*anyopaque,
    Class: i32,
    Type: i32,
    Elements: u32,
    Members: u32,
    Rows: u32,
    Columns: u32,
    PackedSize: u32,
    UnpackedSize: u32,
    Stride: u32,
};
type
  D3D10_EFFECT_TYPE_DESC {.bycopy.} = object
    TypeName: pointer
    Class: int32
    Type: int32
    Elements: uint32
    Members: uint32
    Rows: uint32
    Columns: uint32
    PackedSize: uint32
    UnpackedSize: uint32
    Stride: uint32
struct D3D10_EFFECT_TYPE_DESC
{
    void* TypeName;
    int Class;
    int Type;
    uint Elements;
    uint Members;
    uint Rows;
    uint Columns;
    uint PackedSize;
    uint UnpackedSize;
    uint Stride;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D3D10_EFFECT_TYPE_DESC サイズ: 40 バイト(x86)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; TypeName : LPSTR (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Class : D3D_SHADER_VARIABLE_CLASS (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Type : D3D_SHADER_VARIABLE_TYPE (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Elements : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Members : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; Rows : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; Columns : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; PackedSize : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; UnpackedSize : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; Stride : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D10_EFFECT_TYPE_DESC サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; TypeName : LPSTR (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; Class : D3D_SHADER_VARIABLE_CLASS (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Type : D3D_SHADER_VARIABLE_TYPE (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Elements : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; Members : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; Rows : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; Columns : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; PackedSize : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; UnpackedSize : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; Stride : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D10_EFFECT_TYPE_DESC
    #field intptr TypeName
    #field int Class
    #field int Type
    #field int Elements
    #field int Members
    #field int Rows
    #field int Columns
    #field int PackedSize
    #field int UnpackedSize
    #field int Stride
#endstruct

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