ホーム › Graphics.Direct3D9 › D3DPRIMCAPS
D3DPRIMCAPS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | 本構造体のサイズ(バイト単位)。 |
| dwMiscCaps | DWORD | 4 | +4 | +4 | 各種雑多なケイパビリティフラグ群。 |
| dwRasterCaps | DWORD | 4 | +8 | +8 | ラスタライズのケイパビリティフラグ群。 |
| dwZCmpCaps | DWORD | 4 | +12 | +12 | Z(深度)比較関数のケイパビリティフラグ群。 |
| dwSrcBlendCaps | DWORD | 4 | +16 | +16 | ソースブレンド係数のケイパビリティフラグ群。 |
| dwDestBlendCaps | DWORD | 4 | +20 | +20 | デスティネーションブレンド係数のケイパビリティフラグ群。 |
| dwAlphaCmpCaps | DWORD | 4 | +24 | +24 | アルファ比較関数のケイパビリティフラグ群。 |
| dwShadeCaps | DWORD | 4 | +28 | +28 | シェーディングのケイパビリティフラグ群。 |
| dwTextureCaps | DWORD | 4 | +32 | +32 | テクスチャ機能のケイパビリティフラグ群。 |
| dwTextureFilterCaps | DWORD | 4 | +36 | +36 | テクスチャフィルタのケイパビリティフラグ群。 |
| dwTextureBlendCaps | DWORD | 4 | +40 | +40 | テクスチャブレンドのケイパビリティフラグ群。 |
| dwTextureAddressCaps | DWORD | 4 | +44 | +44 | テクスチャアドレッシングのケイパビリティフラグ群。 |
| dwStippleWidth | DWORD | 4 | +48 | +48 | サポートするスティップルパターンの幅。 |
| dwStippleHeight | DWORD | 4 | +52 | +52 | サポートするスティップルパターンの高さ。 |
各言語での定義
#include <windows.h>
// 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;using System;
using System.Runtime.InteropServices;
[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;
}Imports System.Runtime.InteropServices
<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 Structureimport ctypes
from ctypes import wintypes
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),
]#[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,
}import "golang.org/x/sys/windows"
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
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;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,
};type
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: uint32struct 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;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3DPRIMCAPS サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwMiscCaps : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwRasterCaps : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwZCmpCaps : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwSrcBlendCaps : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwDestBlendCaps : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwAlphaCmpCaps : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwShadeCaps : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwTextureCaps : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; dwTextureFilterCaps : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; dwTextureBlendCaps : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; dwTextureAddressCaps : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; dwStippleWidth : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; dwStippleHeight : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#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
stdim st, D3DPRIMCAPS ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize