ホーム › Graphics.Direct3D11 › D3D11_CLASS_INSTANCE_DESC
D3D11_CLASS_INSTANCE_DESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| InstanceId | DWORD | 4 | +0 | +0 | クラスインスタンスを識別するID。 |
| InstanceIndex | DWORD | 4 | +4 | +4 | クラスインスタンスのインデックス。 |
| TypeId | DWORD | 4 | +8 | +8 | クラスの型を識別するID。 |
| ConstantBuffer | DWORD | 4 | +12 | +12 | このインスタンスが使用する定数バッファのインデックス。 |
| BaseConstantBufferOffset | DWORD | 4 | +16 | +16 | 定数バッファ内のベースオフセット。 |
| BaseTexture | DWORD | 4 | +20 | +20 | このインスタンスのベーステクスチャスロット番号。 |
| BaseSampler | DWORD | 4 | +24 | +24 | このインスタンスのベースサンプラスロット番号。 |
| Created | BOOL | 4 | +28 | +28 | インスタンスが生成済みかどうか。TRUEなら生成済み。 |
各言語での定義
#include <windows.h>
// D3D11_CLASS_INSTANCE_DESC (x64 32 / x86 32 バイト)
typedef struct D3D11_CLASS_INSTANCE_DESC {
DWORD InstanceId;
DWORD InstanceIndex;
DWORD TypeId;
DWORD ConstantBuffer;
DWORD BaseConstantBufferOffset;
DWORD BaseTexture;
DWORD BaseSampler;
BOOL Created;
} D3D11_CLASS_INSTANCE_DESC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_CLASS_INSTANCE_DESC
{
public uint InstanceId;
public uint InstanceIndex;
public uint TypeId;
public uint ConstantBuffer;
public uint BaseConstantBufferOffset;
public uint BaseTexture;
public uint BaseSampler;
[MarshalAs(UnmanagedType.Bool)] public bool Created;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_CLASS_INSTANCE_DESC
Public InstanceId As UInteger
Public InstanceIndex As UInteger
Public TypeId As UInteger
Public ConstantBuffer As UInteger
Public BaseConstantBufferOffset As UInteger
Public BaseTexture As UInteger
Public BaseSampler As UInteger
<MarshalAs(UnmanagedType.Bool)> Public Created As Boolean
End Structureimport ctypes
from ctypes import wintypes
class D3D11_CLASS_INSTANCE_DESC(ctypes.Structure):
_fields_ = [
("InstanceId", wintypes.DWORD),
("InstanceIndex", wintypes.DWORD),
("TypeId", wintypes.DWORD),
("ConstantBuffer", wintypes.DWORD),
("BaseConstantBufferOffset", wintypes.DWORD),
("BaseTexture", wintypes.DWORD),
("BaseSampler", wintypes.DWORD),
("Created", wintypes.BOOL),
]#[repr(C)]
pub struct D3D11_CLASS_INSTANCE_DESC {
pub InstanceId: u32,
pub InstanceIndex: u32,
pub TypeId: u32,
pub ConstantBuffer: u32,
pub BaseConstantBufferOffset: u32,
pub BaseTexture: u32,
pub BaseSampler: u32,
pub Created: i32,
}import "golang.org/x/sys/windows"
type D3D11_CLASS_INSTANCE_DESC struct {
InstanceId uint32
InstanceIndex uint32
TypeId uint32
ConstantBuffer uint32
BaseConstantBufferOffset uint32
BaseTexture uint32
BaseSampler uint32
Created int32
}type
D3D11_CLASS_INSTANCE_DESC = record
InstanceId: DWORD;
InstanceIndex: DWORD;
TypeId: DWORD;
ConstantBuffer: DWORD;
BaseConstantBufferOffset: DWORD;
BaseTexture: DWORD;
BaseSampler: DWORD;
Created: BOOL;
end;const D3D11_CLASS_INSTANCE_DESC = extern struct {
InstanceId: u32,
InstanceIndex: u32,
TypeId: u32,
ConstantBuffer: u32,
BaseConstantBufferOffset: u32,
BaseTexture: u32,
BaseSampler: u32,
Created: i32,
};type
D3D11_CLASS_INSTANCE_DESC {.bycopy.} = object
InstanceId: uint32
InstanceIndex: uint32
TypeId: uint32
ConstantBuffer: uint32
BaseConstantBufferOffset: uint32
BaseTexture: uint32
BaseSampler: uint32
Created: int32struct D3D11_CLASS_INSTANCE_DESC
{
uint InstanceId;
uint InstanceIndex;
uint TypeId;
uint ConstantBuffer;
uint BaseConstantBufferOffset;
uint BaseTexture;
uint BaseSampler;
int Created;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D11_CLASS_INSTANCE_DESC サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; InstanceId : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; InstanceIndex : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; TypeId : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ConstantBuffer : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; BaseConstantBufferOffset : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; BaseTexture : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; BaseSampler : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; Created : BOOL (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D11_CLASS_INSTANCE_DESC
#field int InstanceId
#field int InstanceIndex
#field int TypeId
#field int ConstantBuffer
#field int BaseConstantBufferOffset
#field int BaseTexture
#field int BaseSampler
#field bool Created
#endstruct
stdim st, D3D11_CLASS_INSTANCE_DESC ; NSTRUCT 変数を確保
st->InstanceId = 100
mes "InstanceId=" + st->InstanceId