ホーム › Graphics.Direct3D9 › D3DSTATS
D3DSTATS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | 本構造体のサイズ(バイト単位)。 |
| dwTrianglesDrawn | DWORD | 4 | +4 | +4 | 描画された三角形の数。 |
| dwLinesDrawn | DWORD | 4 | +8 | +8 | 描画されたラインの数。 |
| dwPointsDrawn | DWORD | 4 | +12 | +12 | 描画されたポイントの数。 |
| dwSpansDrawn | DWORD | 4 | +16 | +16 | 描画されたスパンの数。 |
| dwVerticesProcessed | DWORD | 4 | +20 | +20 | 処理された頂点の数。 |
各言語での定義
#include <windows.h>
// D3DSTATS (x64 24 / x86 24 バイト)
typedef struct D3DSTATS {
DWORD dwSize;
DWORD dwTrianglesDrawn;
DWORD dwLinesDrawn;
DWORD dwPointsDrawn;
DWORD dwSpansDrawn;
DWORD dwVerticesProcessed;
} D3DSTATS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3DSTATS
{
public uint dwSize;
public uint dwTrianglesDrawn;
public uint dwLinesDrawn;
public uint dwPointsDrawn;
public uint dwSpansDrawn;
public uint dwVerticesProcessed;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3DSTATS
Public dwSize As UInteger
Public dwTrianglesDrawn As UInteger
Public dwLinesDrawn As UInteger
Public dwPointsDrawn As UInteger
Public dwSpansDrawn As UInteger
Public dwVerticesProcessed As UInteger
End Structureimport ctypes
from ctypes import wintypes
class D3DSTATS(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwTrianglesDrawn", wintypes.DWORD),
("dwLinesDrawn", wintypes.DWORD),
("dwPointsDrawn", wintypes.DWORD),
("dwSpansDrawn", wintypes.DWORD),
("dwVerticesProcessed", wintypes.DWORD),
]#[repr(C)]
pub struct D3DSTATS {
pub dwSize: u32,
pub dwTrianglesDrawn: u32,
pub dwLinesDrawn: u32,
pub dwPointsDrawn: u32,
pub dwSpansDrawn: u32,
pub dwVerticesProcessed: u32,
}import "golang.org/x/sys/windows"
type D3DSTATS struct {
dwSize uint32
dwTrianglesDrawn uint32
dwLinesDrawn uint32
dwPointsDrawn uint32
dwSpansDrawn uint32
dwVerticesProcessed uint32
}type
D3DSTATS = record
dwSize: DWORD;
dwTrianglesDrawn: DWORD;
dwLinesDrawn: DWORD;
dwPointsDrawn: DWORD;
dwSpansDrawn: DWORD;
dwVerticesProcessed: DWORD;
end;const D3DSTATS = extern struct {
dwSize: u32,
dwTrianglesDrawn: u32,
dwLinesDrawn: u32,
dwPointsDrawn: u32,
dwSpansDrawn: u32,
dwVerticesProcessed: u32,
};type
D3DSTATS {.bycopy.} = object
dwSize: uint32
dwTrianglesDrawn: uint32
dwLinesDrawn: uint32
dwPointsDrawn: uint32
dwSpansDrawn: uint32
dwVerticesProcessed: uint32struct D3DSTATS
{
uint dwSize;
uint dwTrianglesDrawn;
uint dwLinesDrawn;
uint dwPointsDrawn;
uint dwSpansDrawn;
uint dwVerticesProcessed;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3DSTATS サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwTrianglesDrawn : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwLinesDrawn : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwPointsDrawn : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwSpansDrawn : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwVerticesProcessed : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3DSTATS
#field int dwSize
#field int dwTrianglesDrawn
#field int dwLinesDrawn
#field int dwPointsDrawn
#field int dwSpansDrawn
#field int dwVerticesProcessed
#endstruct
stdim st, D3DSTATS ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize