ホーム › Graphics.Direct3D9 › D3DDEVICEDESC
D3DDEVICEDESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | 本構造体のサイズ(バイト単位)。 |
| dwFlags | DWORD | 4 | +4 | +4 | 有効なフィールドを示すフラグ群。 |
| dcmColorModel | DWORD | 4 | +8 | +8 | デバイスのカラーモデル(RGB/RAMP)を示す値。 |
| dwDevCaps | DWORD | 4 | +12 | +12 | デバイスのケイパビリティフラグ群。 |
| dtcTransformCaps | D3DTRANSFORMCAPS | 8 | +16 | +16 | 変換ケイパビリティ(D3DTRANSFORMCAPS)。 |
| bClipping | BOOL | 4 | +24 | +24 | デバイスがクリッピングをサポートするかを示すBOOL。 |
| dlcLightingCaps | D3DLIGHTINGCAPS | 16 | +28 | +28 | ライティングケイパビリティ(D3DLIGHTINGCAPS)。 |
| dpcLineCaps | D3DPRIMCAPS | 56 | +44 | +44 | ライン描画のプリミティブケイパビリティ(D3DPRIMCAPS)。 |
| dpcTriCaps | D3DPRIMCAPS | 56 | +100 | +100 | 三角形描画のプリミティブケイパビリティ(D3DPRIMCAPS)。 |
| dwDeviceRenderBitDepth | DWORD | 4 | +156 | +156 | サポートするレンダリングビット深度のフラグ群。 |
| dwDeviceZBufferBitDepth | DWORD | 4 | +160 | +160 | サポートするZバッファビット深度のフラグ群。 |
| dwMaxBufferSize | DWORD | 4 | +164 | +164 | 実行バッファの最大サイズ。 |
| dwMaxVertexCount | DWORD | 4 | +168 | +168 | 扱える最大頂点数。 |
| dwMinTextureWidth | DWORD | 4 | +172 | +172 | テクスチャの最小幅。 |
| dwMinTextureHeight | DWORD | 4 | +176 | +176 | テクスチャの最小高さ。 |
| dwMaxTextureWidth | DWORD | 4 | +180 | +180 | テクスチャの最大幅。 |
| dwMaxTextureHeight | DWORD | 4 | +184 | +184 | テクスチャの最大高さ。 |
| dwMinStippleWidth | DWORD | 4 | +188 | +188 | スティップルの最小幅。 |
| dwMaxStippleWidth | DWORD | 4 | +192 | +192 | スティップルの最大幅。 |
| dwMinStippleHeight | DWORD | 4 | +196 | +196 | スティップルの最小高さ。 |
| dwMaxStippleHeight | DWORD | 4 | +200 | +200 | スティップルの最大高さ。 |
| dwMaxTextureRepeat | DWORD | 4 | +204 | +204 | テクスチャの最大繰り返し回数。 |
| dwMaxTextureAspectRatio | DWORD | 4 | +208 | +208 | テクスチャの最大アスペクト比。 |
| dwMaxAnisotropy | DWORD | 4 | +212 | +212 | サポートする最大異方性度。 |
| dvGuardBandLeft | FLOAT | 4 | +216 | +216 | ガードバンドの左端座標。 |
| dvGuardBandTop | FLOAT | 4 | +220 | +220 | ガードバンドの上端座標。 |
| dvGuardBandRight | FLOAT | 4 | +224 | +224 | ガードバンドの右端座標。 |
| dvGuardBandBottom | FLOAT | 4 | +228 | +228 | ガードバンドの下端座標。 |
| dvExtentsAdjust | FLOAT | 4 | +232 | +232 | アンチエイリアス時の範囲調整量。 |
| dwStencilCaps | DWORD | 4 | +236 | +236 | ステンシル操作のケイパビリティフラグ群。 |
| dwFVFCaps | DWORD | 4 | +240 | +240 | FVFのケイパビリティフラグ群。 |
| dwTextureOpCaps | DWORD | 4 | +244 | +244 | テクスチャ操作のケイパビリティフラグ群。 |
| wMaxTextureBlendStages | WORD | 2 | +248 | +248 | 最大テクスチャブレンドステージ数(WORD)。 |
| wMaxSimultaneousTextures | WORD | 2 | +250 | +250 | 同時使用可能な最大テクスチャ数(WORD)。 |
各言語での定義
#include <windows.h>
// D3DTRANSFORMCAPS (x64 8 / x86 8 バイト)
typedef struct D3DTRANSFORMCAPS {
DWORD dwSize;
DWORD dwCaps;
} D3DTRANSFORMCAPS;
// D3DLIGHTINGCAPS (x64 16 / x86 16 バイト)
typedef struct D3DLIGHTINGCAPS {
DWORD dwSize;
DWORD dwCaps;
DWORD dwLightingModel;
DWORD dwNumLights;
} D3DLIGHTINGCAPS;
// D3DPRIMCAPS (x64 56 / x86 56 バイト)
typedef struct D3DPRIMCAPS {
DWORD dwSize;
DWORD dwMiscCaps;
DWORD dwRasterCaps;
DWORD dwZCmpCaps;
DWORD dwSrcBlendCaps;
DWORD dwDestBlendCaps;
DWORD dwAlphaCmpCaps;
DWORD dwShadeCaps;
DWORD dwTextureCaps;
DWORD dwTextureFilterCaps;
DWORD dwTextureBlendCaps;
DWORD dwTextureAddressCaps;
DWORD dwStippleWidth;
DWORD dwStippleHeight;
} D3DPRIMCAPS;
// D3DDEVICEDESC (x64 252 / x86 252 バイト)
typedef struct D3DDEVICEDESC {
DWORD dwSize;
DWORD dwFlags;
DWORD dcmColorModel;
DWORD dwDevCaps;
D3DTRANSFORMCAPS dtcTransformCaps;
BOOL bClipping;
D3DLIGHTINGCAPS dlcLightingCaps;
D3DPRIMCAPS dpcLineCaps;
D3DPRIMCAPS dpcTriCaps;
DWORD dwDeviceRenderBitDepth;
DWORD dwDeviceZBufferBitDepth;
DWORD dwMaxBufferSize;
DWORD dwMaxVertexCount;
DWORD dwMinTextureWidth;
DWORD dwMinTextureHeight;
DWORD dwMaxTextureWidth;
DWORD dwMaxTextureHeight;
DWORD dwMinStippleWidth;
DWORD dwMaxStippleWidth;
DWORD dwMinStippleHeight;
DWORD dwMaxStippleHeight;
DWORD dwMaxTextureRepeat;
DWORD dwMaxTextureAspectRatio;
DWORD dwMaxAnisotropy;
FLOAT dvGuardBandLeft;
FLOAT dvGuardBandTop;
FLOAT dvGuardBandRight;
FLOAT dvGuardBandBottom;
FLOAT dvExtentsAdjust;
DWORD dwStencilCaps;
DWORD dwFVFCaps;
DWORD dwTextureOpCaps;
WORD wMaxTextureBlendStages;
WORD wMaxSimultaneousTextures;
} D3DDEVICEDESC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3DTRANSFORMCAPS
{
public uint dwSize;
public uint dwCaps;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3DLIGHTINGCAPS
{
public uint dwSize;
public uint dwCaps;
public uint dwLightingModel;
public uint dwNumLights;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3DPRIMCAPS
{
public uint dwSize;
public uint dwMiscCaps;
public uint dwRasterCaps;
public uint dwZCmpCaps;
public uint dwSrcBlendCaps;
public uint dwDestBlendCaps;
public uint dwAlphaCmpCaps;
public uint dwShadeCaps;
public uint dwTextureCaps;
public uint dwTextureFilterCaps;
public uint dwTextureBlendCaps;
public uint dwTextureAddressCaps;
public uint dwStippleWidth;
public uint dwStippleHeight;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3DDEVICEDESC
{
public uint dwSize;
public uint dwFlags;
public uint dcmColorModel;
public uint dwDevCaps;
public D3DTRANSFORMCAPS dtcTransformCaps;
[MarshalAs(UnmanagedType.Bool)] public bool bClipping;
public D3DLIGHTINGCAPS dlcLightingCaps;
public D3DPRIMCAPS dpcLineCaps;
public D3DPRIMCAPS dpcTriCaps;
public uint dwDeviceRenderBitDepth;
public uint dwDeviceZBufferBitDepth;
public uint dwMaxBufferSize;
public uint dwMaxVertexCount;
public uint dwMinTextureWidth;
public uint dwMinTextureHeight;
public uint dwMaxTextureWidth;
public uint dwMaxTextureHeight;
public uint dwMinStippleWidth;
public uint dwMaxStippleWidth;
public uint dwMinStippleHeight;
public uint dwMaxStippleHeight;
public uint dwMaxTextureRepeat;
public uint dwMaxTextureAspectRatio;
public uint dwMaxAnisotropy;
public float dvGuardBandLeft;
public float dvGuardBandTop;
public float dvGuardBandRight;
public float dvGuardBandBottom;
public float dvExtentsAdjust;
public uint dwStencilCaps;
public uint dwFVFCaps;
public uint dwTextureOpCaps;
public ushort wMaxTextureBlendStages;
public ushort wMaxSimultaneousTextures;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3DTRANSFORMCAPS
Public dwSize As UInteger
Public dwCaps As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3DLIGHTINGCAPS
Public dwSize As UInteger
Public dwCaps As UInteger
Public dwLightingModel As UInteger
Public dwNumLights As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3DPRIMCAPS
Public dwSize As UInteger
Public dwMiscCaps As UInteger
Public dwRasterCaps As UInteger
Public dwZCmpCaps As UInteger
Public dwSrcBlendCaps As UInteger
Public dwDestBlendCaps As UInteger
Public dwAlphaCmpCaps As UInteger
Public dwShadeCaps As UInteger
Public dwTextureCaps As UInteger
Public dwTextureFilterCaps As UInteger
Public dwTextureBlendCaps As UInteger
Public dwTextureAddressCaps As UInteger
Public dwStippleWidth As UInteger
Public dwStippleHeight As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3DDEVICEDESC
Public dwSize As UInteger
Public dwFlags As UInteger
Public dcmColorModel As UInteger
Public dwDevCaps As UInteger
Public dtcTransformCaps As D3DTRANSFORMCAPS
<MarshalAs(UnmanagedType.Bool)> Public bClipping As Boolean
Public dlcLightingCaps As D3DLIGHTINGCAPS
Public dpcLineCaps As D3DPRIMCAPS
Public dpcTriCaps As D3DPRIMCAPS
Public dwDeviceRenderBitDepth As UInteger
Public dwDeviceZBufferBitDepth As UInteger
Public dwMaxBufferSize As UInteger
Public dwMaxVertexCount As UInteger
Public dwMinTextureWidth As UInteger
Public dwMinTextureHeight As UInteger
Public dwMaxTextureWidth As UInteger
Public dwMaxTextureHeight As UInteger
Public dwMinStippleWidth As UInteger
Public dwMaxStippleWidth As UInteger
Public dwMinStippleHeight As UInteger
Public dwMaxStippleHeight As UInteger
Public dwMaxTextureRepeat As UInteger
Public dwMaxTextureAspectRatio As UInteger
Public dwMaxAnisotropy As UInteger
Public dvGuardBandLeft As Single
Public dvGuardBandTop As Single
Public dvGuardBandRight As Single
Public dvGuardBandBottom As Single
Public dvExtentsAdjust As Single
Public dwStencilCaps As UInteger
Public dwFVFCaps As UInteger
Public dwTextureOpCaps As UInteger
Public wMaxTextureBlendStages As UShort
Public wMaxSimultaneousTextures As UShort
End Structureimport ctypes
from ctypes import wintypes
class D3DTRANSFORMCAPS(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwCaps", wintypes.DWORD),
]
class D3DLIGHTINGCAPS(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwCaps", wintypes.DWORD),
("dwLightingModel", wintypes.DWORD),
("dwNumLights", wintypes.DWORD),
]
class D3DPRIMCAPS(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwMiscCaps", wintypes.DWORD),
("dwRasterCaps", wintypes.DWORD),
("dwZCmpCaps", wintypes.DWORD),
("dwSrcBlendCaps", wintypes.DWORD),
("dwDestBlendCaps", wintypes.DWORD),
("dwAlphaCmpCaps", wintypes.DWORD),
("dwShadeCaps", wintypes.DWORD),
("dwTextureCaps", wintypes.DWORD),
("dwTextureFilterCaps", wintypes.DWORD),
("dwTextureBlendCaps", wintypes.DWORD),
("dwTextureAddressCaps", wintypes.DWORD),
("dwStippleWidth", wintypes.DWORD),
("dwStippleHeight", wintypes.DWORD),
]
class D3DDEVICEDESC(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
("dcmColorModel", wintypes.DWORD),
("dwDevCaps", wintypes.DWORD),
("dtcTransformCaps", D3DTRANSFORMCAPS),
("bClipping", wintypes.BOOL),
("dlcLightingCaps", D3DLIGHTINGCAPS),
("dpcLineCaps", D3DPRIMCAPS),
("dpcTriCaps", D3DPRIMCAPS),
("dwDeviceRenderBitDepth", wintypes.DWORD),
("dwDeviceZBufferBitDepth", wintypes.DWORD),
("dwMaxBufferSize", wintypes.DWORD),
("dwMaxVertexCount", wintypes.DWORD),
("dwMinTextureWidth", wintypes.DWORD),
("dwMinTextureHeight", wintypes.DWORD),
("dwMaxTextureWidth", wintypes.DWORD),
("dwMaxTextureHeight", wintypes.DWORD),
("dwMinStippleWidth", wintypes.DWORD),
("dwMaxStippleWidth", wintypes.DWORD),
("dwMinStippleHeight", wintypes.DWORD),
("dwMaxStippleHeight", wintypes.DWORD),
("dwMaxTextureRepeat", wintypes.DWORD),
("dwMaxTextureAspectRatio", wintypes.DWORD),
("dwMaxAnisotropy", wintypes.DWORD),
("dvGuardBandLeft", ctypes.c_float),
("dvGuardBandTop", ctypes.c_float),
("dvGuardBandRight", ctypes.c_float),
("dvGuardBandBottom", ctypes.c_float),
("dvExtentsAdjust", ctypes.c_float),
("dwStencilCaps", wintypes.DWORD),
("dwFVFCaps", wintypes.DWORD),
("dwTextureOpCaps", wintypes.DWORD),
("wMaxTextureBlendStages", ctypes.c_ushort),
("wMaxSimultaneousTextures", ctypes.c_ushort),
]#[repr(C)]
pub struct D3DTRANSFORMCAPS {
pub dwSize: u32,
pub dwCaps: u32,
}
#[repr(C)]
pub struct D3DLIGHTINGCAPS {
pub dwSize: u32,
pub dwCaps: u32,
pub dwLightingModel: u32,
pub dwNumLights: u32,
}
#[repr(C)]
pub struct D3DPRIMCAPS {
pub dwSize: u32,
pub dwMiscCaps: u32,
pub dwRasterCaps: u32,
pub dwZCmpCaps: u32,
pub dwSrcBlendCaps: u32,
pub dwDestBlendCaps: u32,
pub dwAlphaCmpCaps: u32,
pub dwShadeCaps: u32,
pub dwTextureCaps: u32,
pub dwTextureFilterCaps: u32,
pub dwTextureBlendCaps: u32,
pub dwTextureAddressCaps: u32,
pub dwStippleWidth: u32,
pub dwStippleHeight: u32,
}
#[repr(C)]
pub struct D3DDEVICEDESC {
pub dwSize: u32,
pub dwFlags: u32,
pub dcmColorModel: u32,
pub dwDevCaps: u32,
pub dtcTransformCaps: D3DTRANSFORMCAPS,
pub bClipping: i32,
pub dlcLightingCaps: D3DLIGHTINGCAPS,
pub dpcLineCaps: D3DPRIMCAPS,
pub dpcTriCaps: D3DPRIMCAPS,
pub dwDeviceRenderBitDepth: u32,
pub dwDeviceZBufferBitDepth: u32,
pub dwMaxBufferSize: u32,
pub dwMaxVertexCount: u32,
pub dwMinTextureWidth: u32,
pub dwMinTextureHeight: u32,
pub dwMaxTextureWidth: u32,
pub dwMaxTextureHeight: u32,
pub dwMinStippleWidth: u32,
pub dwMaxStippleWidth: u32,
pub dwMinStippleHeight: u32,
pub dwMaxStippleHeight: u32,
pub dwMaxTextureRepeat: u32,
pub dwMaxTextureAspectRatio: u32,
pub dwMaxAnisotropy: u32,
pub dvGuardBandLeft: f32,
pub dvGuardBandTop: f32,
pub dvGuardBandRight: f32,
pub dvGuardBandBottom: f32,
pub dvExtentsAdjust: f32,
pub dwStencilCaps: u32,
pub dwFVFCaps: u32,
pub dwTextureOpCaps: u32,
pub wMaxTextureBlendStages: u16,
pub wMaxSimultaneousTextures: u16,
}import "golang.org/x/sys/windows"
type D3DTRANSFORMCAPS struct {
dwSize uint32
dwCaps uint32
}
type D3DLIGHTINGCAPS struct {
dwSize uint32
dwCaps uint32
dwLightingModel uint32
dwNumLights uint32
}
type D3DPRIMCAPS struct {
dwSize uint32
dwMiscCaps uint32
dwRasterCaps uint32
dwZCmpCaps uint32
dwSrcBlendCaps uint32
dwDestBlendCaps uint32
dwAlphaCmpCaps uint32
dwShadeCaps uint32
dwTextureCaps uint32
dwTextureFilterCaps uint32
dwTextureBlendCaps uint32
dwTextureAddressCaps uint32
dwStippleWidth uint32
dwStippleHeight uint32
}
type D3DDEVICEDESC struct {
dwSize uint32
dwFlags uint32
dcmColorModel uint32
dwDevCaps uint32
dtcTransformCaps D3DTRANSFORMCAPS
bClipping int32
dlcLightingCaps D3DLIGHTINGCAPS
dpcLineCaps D3DPRIMCAPS
dpcTriCaps D3DPRIMCAPS
dwDeviceRenderBitDepth uint32
dwDeviceZBufferBitDepth uint32
dwMaxBufferSize uint32
dwMaxVertexCount uint32
dwMinTextureWidth uint32
dwMinTextureHeight uint32
dwMaxTextureWidth uint32
dwMaxTextureHeight uint32
dwMinStippleWidth uint32
dwMaxStippleWidth uint32
dwMinStippleHeight uint32
dwMaxStippleHeight uint32
dwMaxTextureRepeat uint32
dwMaxTextureAspectRatio uint32
dwMaxAnisotropy uint32
dvGuardBandLeft float32
dvGuardBandTop float32
dvGuardBandRight float32
dvGuardBandBottom float32
dvExtentsAdjust float32
dwStencilCaps uint32
dwFVFCaps uint32
dwTextureOpCaps uint32
wMaxTextureBlendStages uint16
wMaxSimultaneousTextures uint16
}type
D3DTRANSFORMCAPS = record
dwSize: DWORD;
dwCaps: DWORD;
end;
D3DLIGHTINGCAPS = record
dwSize: DWORD;
dwCaps: DWORD;
dwLightingModel: DWORD;
dwNumLights: DWORD;
end;
D3DPRIMCAPS = record
dwSize: DWORD;
dwMiscCaps: DWORD;
dwRasterCaps: DWORD;
dwZCmpCaps: DWORD;
dwSrcBlendCaps: DWORD;
dwDestBlendCaps: DWORD;
dwAlphaCmpCaps: DWORD;
dwShadeCaps: DWORD;
dwTextureCaps: DWORD;
dwTextureFilterCaps: DWORD;
dwTextureBlendCaps: DWORD;
dwTextureAddressCaps: DWORD;
dwStippleWidth: DWORD;
dwStippleHeight: DWORD;
end;
D3DDEVICEDESC = record
dwSize: DWORD;
dwFlags: DWORD;
dcmColorModel: DWORD;
dwDevCaps: DWORD;
dtcTransformCaps: D3DTRANSFORMCAPS;
bClipping: BOOL;
dlcLightingCaps: D3DLIGHTINGCAPS;
dpcLineCaps: D3DPRIMCAPS;
dpcTriCaps: D3DPRIMCAPS;
dwDeviceRenderBitDepth: DWORD;
dwDeviceZBufferBitDepth: DWORD;
dwMaxBufferSize: DWORD;
dwMaxVertexCount: DWORD;
dwMinTextureWidth: DWORD;
dwMinTextureHeight: DWORD;
dwMaxTextureWidth: DWORD;
dwMaxTextureHeight: DWORD;
dwMinStippleWidth: DWORD;
dwMaxStippleWidth: DWORD;
dwMinStippleHeight: DWORD;
dwMaxStippleHeight: DWORD;
dwMaxTextureRepeat: DWORD;
dwMaxTextureAspectRatio: DWORD;
dwMaxAnisotropy: DWORD;
dvGuardBandLeft: Single;
dvGuardBandTop: Single;
dvGuardBandRight: Single;
dvGuardBandBottom: Single;
dvExtentsAdjust: Single;
dwStencilCaps: DWORD;
dwFVFCaps: DWORD;
dwTextureOpCaps: DWORD;
wMaxTextureBlendStages: Word;
wMaxSimultaneousTextures: Word;
end;const D3DTRANSFORMCAPS = extern struct {
dwSize: u32,
dwCaps: u32,
};
const D3DLIGHTINGCAPS = extern struct {
dwSize: u32,
dwCaps: u32,
dwLightingModel: u32,
dwNumLights: u32,
};
const D3DPRIMCAPS = extern struct {
dwSize: u32,
dwMiscCaps: u32,
dwRasterCaps: u32,
dwZCmpCaps: u32,
dwSrcBlendCaps: u32,
dwDestBlendCaps: u32,
dwAlphaCmpCaps: u32,
dwShadeCaps: u32,
dwTextureCaps: u32,
dwTextureFilterCaps: u32,
dwTextureBlendCaps: u32,
dwTextureAddressCaps: u32,
dwStippleWidth: u32,
dwStippleHeight: u32,
};
const D3DDEVICEDESC = extern struct {
dwSize: u32,
dwFlags: u32,
dcmColorModel: u32,
dwDevCaps: u32,
dtcTransformCaps: D3DTRANSFORMCAPS,
bClipping: i32,
dlcLightingCaps: D3DLIGHTINGCAPS,
dpcLineCaps: D3DPRIMCAPS,
dpcTriCaps: D3DPRIMCAPS,
dwDeviceRenderBitDepth: u32,
dwDeviceZBufferBitDepth: u32,
dwMaxBufferSize: u32,
dwMaxVertexCount: u32,
dwMinTextureWidth: u32,
dwMinTextureHeight: u32,
dwMaxTextureWidth: u32,
dwMaxTextureHeight: u32,
dwMinStippleWidth: u32,
dwMaxStippleWidth: u32,
dwMinStippleHeight: u32,
dwMaxStippleHeight: u32,
dwMaxTextureRepeat: u32,
dwMaxTextureAspectRatio: u32,
dwMaxAnisotropy: u32,
dvGuardBandLeft: f32,
dvGuardBandTop: f32,
dvGuardBandRight: f32,
dvGuardBandBottom: f32,
dvExtentsAdjust: f32,
dwStencilCaps: u32,
dwFVFCaps: u32,
dwTextureOpCaps: u32,
wMaxTextureBlendStages: u16,
wMaxSimultaneousTextures: u16,
};type
D3DTRANSFORMCAPS {.bycopy.} = object
dwSize: uint32
dwCaps: uint32
D3DLIGHTINGCAPS {.bycopy.} = object
dwSize: uint32
dwCaps: uint32
dwLightingModel: uint32
dwNumLights: uint32
D3DPRIMCAPS {.bycopy.} = object
dwSize: uint32
dwMiscCaps: uint32
dwRasterCaps: uint32
dwZCmpCaps: uint32
dwSrcBlendCaps: uint32
dwDestBlendCaps: uint32
dwAlphaCmpCaps: uint32
dwShadeCaps: uint32
dwTextureCaps: uint32
dwTextureFilterCaps: uint32
dwTextureBlendCaps: uint32
dwTextureAddressCaps: uint32
dwStippleWidth: uint32
dwStippleHeight: uint32
D3DDEVICEDESC {.bycopy.} = object
dwSize: uint32
dwFlags: uint32
dcmColorModel: uint32
dwDevCaps: uint32
dtcTransformCaps: D3DTRANSFORMCAPS
bClipping: int32
dlcLightingCaps: D3DLIGHTINGCAPS
dpcLineCaps: D3DPRIMCAPS
dpcTriCaps: D3DPRIMCAPS
dwDeviceRenderBitDepth: uint32
dwDeviceZBufferBitDepth: uint32
dwMaxBufferSize: uint32
dwMaxVertexCount: uint32
dwMinTextureWidth: uint32
dwMinTextureHeight: uint32
dwMaxTextureWidth: uint32
dwMaxTextureHeight: uint32
dwMinStippleWidth: uint32
dwMaxStippleWidth: uint32
dwMinStippleHeight: uint32
dwMaxStippleHeight: uint32
dwMaxTextureRepeat: uint32
dwMaxTextureAspectRatio: uint32
dwMaxAnisotropy: uint32
dvGuardBandLeft: float32
dvGuardBandTop: float32
dvGuardBandRight: float32
dvGuardBandBottom: float32
dvExtentsAdjust: float32
dwStencilCaps: uint32
dwFVFCaps: uint32
dwTextureOpCaps: uint32
wMaxTextureBlendStages: uint16
wMaxSimultaneousTextures: uint16struct D3DTRANSFORMCAPS
{
uint dwSize;
uint dwCaps;
}
struct D3DLIGHTINGCAPS
{
uint dwSize;
uint dwCaps;
uint dwLightingModel;
uint dwNumLights;
}
struct D3DPRIMCAPS
{
uint dwSize;
uint dwMiscCaps;
uint dwRasterCaps;
uint dwZCmpCaps;
uint dwSrcBlendCaps;
uint dwDestBlendCaps;
uint dwAlphaCmpCaps;
uint dwShadeCaps;
uint dwTextureCaps;
uint dwTextureFilterCaps;
uint dwTextureBlendCaps;
uint dwTextureAddressCaps;
uint dwStippleWidth;
uint dwStippleHeight;
}
struct D3DDEVICEDESC
{
uint dwSize;
uint dwFlags;
uint dcmColorModel;
uint dwDevCaps;
D3DTRANSFORMCAPS dtcTransformCaps;
int bClipping;
D3DLIGHTINGCAPS dlcLightingCaps;
D3DPRIMCAPS dpcLineCaps;
D3DPRIMCAPS dpcTriCaps;
uint dwDeviceRenderBitDepth;
uint dwDeviceZBufferBitDepth;
uint dwMaxBufferSize;
uint dwMaxVertexCount;
uint dwMinTextureWidth;
uint dwMinTextureHeight;
uint dwMaxTextureWidth;
uint dwMaxTextureHeight;
uint dwMinStippleWidth;
uint dwMaxStippleWidth;
uint dwMinStippleHeight;
uint dwMaxStippleHeight;
uint dwMaxTextureRepeat;
uint dwMaxTextureAspectRatio;
uint dwMaxAnisotropy;
float dvGuardBandLeft;
float dvGuardBandTop;
float dvGuardBandRight;
float dvGuardBandBottom;
float dvExtentsAdjust;
uint dwStencilCaps;
uint dwFVFCaps;
uint dwTextureOpCaps;
ushort wMaxTextureBlendStages;
ushort wMaxSimultaneousTextures;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3DDEVICEDESC サイズ: 252 バイト(x64)
dim st, 63 ; 4byte整数×63(構造体サイズ 252 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dcmColorModel : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwDevCaps : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dtcTransformCaps : D3DTRANSFORMCAPS (+16, 8byte) varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; bClipping : BOOL (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dlcLightingCaps : D3DLIGHTINGCAPS (+28, 16byte) varptr(st)+28 を基点に操作(16byte:入れ子/配列)
; dpcLineCaps : D3DPRIMCAPS (+44, 56byte) varptr(st)+44 を基点に操作(56byte:入れ子/配列)
; dpcTriCaps : D3DPRIMCAPS (+100, 56byte) varptr(st)+100 を基点に操作(56byte:入れ子/配列)
; dwDeviceRenderBitDepth : DWORD (+156, 4byte) st.39 = 値 / 値 = st.39 (lpoke/lpeek も可)
; dwDeviceZBufferBitDepth : DWORD (+160, 4byte) st.40 = 値 / 値 = st.40 (lpoke/lpeek も可)
; dwMaxBufferSize : DWORD (+164, 4byte) st.41 = 値 / 値 = st.41 (lpoke/lpeek も可)
; dwMaxVertexCount : DWORD (+168, 4byte) st.42 = 値 / 値 = st.42 (lpoke/lpeek も可)
; dwMinTextureWidth : DWORD (+172, 4byte) st.43 = 値 / 値 = st.43 (lpoke/lpeek も可)
; dwMinTextureHeight : DWORD (+176, 4byte) st.44 = 値 / 値 = st.44 (lpoke/lpeek も可)
; dwMaxTextureWidth : DWORD (+180, 4byte) st.45 = 値 / 値 = st.45 (lpoke/lpeek も可)
; dwMaxTextureHeight : DWORD (+184, 4byte) st.46 = 値 / 値 = st.46 (lpoke/lpeek も可)
; dwMinStippleWidth : DWORD (+188, 4byte) st.47 = 値 / 値 = st.47 (lpoke/lpeek も可)
; dwMaxStippleWidth : DWORD (+192, 4byte) st.48 = 値 / 値 = st.48 (lpoke/lpeek も可)
; dwMinStippleHeight : DWORD (+196, 4byte) st.49 = 値 / 値 = st.49 (lpoke/lpeek も可)
; dwMaxStippleHeight : DWORD (+200, 4byte) st.50 = 値 / 値 = st.50 (lpoke/lpeek も可)
; dwMaxTextureRepeat : DWORD (+204, 4byte) st.51 = 値 / 値 = st.51 (lpoke/lpeek も可)
; dwMaxTextureAspectRatio : DWORD (+208, 4byte) st.52 = 値 / 値 = st.52 (lpoke/lpeek も可)
; dwMaxAnisotropy : DWORD (+212, 4byte) st.53 = 値 / 値 = st.53 (lpoke/lpeek も可)
; dvGuardBandLeft : FLOAT (+216, 4byte) st.54 = 値 / 値 = st.54 (lpoke/lpeek も可)
; dvGuardBandTop : FLOAT (+220, 4byte) st.55 = 値 / 値 = st.55 (lpoke/lpeek も可)
; dvGuardBandRight : FLOAT (+224, 4byte) st.56 = 値 / 値 = st.56 (lpoke/lpeek も可)
; dvGuardBandBottom : FLOAT (+228, 4byte) st.57 = 値 / 値 = st.57 (lpoke/lpeek も可)
; dvExtentsAdjust : FLOAT (+232, 4byte) st.58 = 値 / 値 = st.58 (lpoke/lpeek も可)
; dwStencilCaps : DWORD (+236, 4byte) st.59 = 値 / 値 = st.59 (lpoke/lpeek も可)
; dwFVFCaps : DWORD (+240, 4byte) st.60 = 値 / 値 = st.60 (lpoke/lpeek も可)
; dwTextureOpCaps : DWORD (+244, 4byte) st.61 = 値 / 値 = st.61 (lpoke/lpeek も可)
; wMaxTextureBlendStages : WORD (+248, 2byte) wpoke st,248,値 / 値 = wpeek(st,248)
; wMaxSimultaneousTextures : WORD (+250, 2byte) wpoke st,250,値 / 値 = wpeek(st,250)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global D3DTRANSFORMCAPS
#field int dwSize
#field int dwCaps
#endstruct
#defstruct global D3DLIGHTINGCAPS
#field int dwSize
#field int dwCaps
#field int dwLightingModel
#field int dwNumLights
#endstruct
#defstruct global D3DPRIMCAPS
#field int dwSize
#field int dwMiscCaps
#field int dwRasterCaps
#field int dwZCmpCaps
#field int dwSrcBlendCaps
#field int dwDestBlendCaps
#field int dwAlphaCmpCaps
#field int dwShadeCaps
#field int dwTextureCaps
#field int dwTextureFilterCaps
#field int dwTextureBlendCaps
#field int dwTextureAddressCaps
#field int dwStippleWidth
#field int dwStippleHeight
#endstruct
#defstruct global D3DDEVICEDESC
#field int dwSize
#field int dwFlags
#field int dcmColorModel
#field int dwDevCaps
#field D3DTRANSFORMCAPS dtcTransformCaps
#field bool bClipping
#field D3DLIGHTINGCAPS dlcLightingCaps
#field D3DPRIMCAPS dpcLineCaps
#field D3DPRIMCAPS dpcTriCaps
#field int dwDeviceRenderBitDepth
#field int dwDeviceZBufferBitDepth
#field int dwMaxBufferSize
#field int dwMaxVertexCount
#field int dwMinTextureWidth
#field int dwMinTextureHeight
#field int dwMaxTextureWidth
#field int dwMaxTextureHeight
#field int dwMinStippleWidth
#field int dwMaxStippleWidth
#field int dwMinStippleHeight
#field int dwMaxStippleHeight
#field int dwMaxTextureRepeat
#field int dwMaxTextureAspectRatio
#field int dwMaxAnisotropy
#field float dvGuardBandLeft
#field float dvGuardBandTop
#field float dvGuardBandRight
#field float dvGuardBandBottom
#field float dvExtentsAdjust
#field int dwStencilCaps
#field int dwFVFCaps
#field int dwTextureOpCaps
#field short wMaxTextureBlendStages
#field short wMaxSimultaneousTextures
#endstruct
stdim st, D3DDEVICEDESC ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize