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

D3DCLIPSTATUS

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

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

フィールド

フィールドサイズx64x86説明
dwFlagsDWORD4+0+0クリップステータスの種別を示すフラグ群。
dwStatusDWORD4+4+4クリップ状態を示す値。
minxFLOAT4+8+8クリップ範囲のX最小値。
maxxFLOAT4+12+12クリップ範囲のX最大値。
minyFLOAT4+16+16クリップ範囲のY最小値。
maxyFLOAT4+20+20クリップ範囲のY最大値。
minzFLOAT4+24+24クリップ範囲のZ最小値。
maxzFLOAT4+28+28クリップ範囲のZ最大値。

各言語での定義

#include <windows.h>

// D3DCLIPSTATUS  (x64 32 / x86 32 バイト)
typedef struct D3DCLIPSTATUS {
    DWORD dwFlags;
    DWORD dwStatus;
    FLOAT minx;
    FLOAT maxx;
    FLOAT miny;
    FLOAT maxy;
    FLOAT minz;
    FLOAT maxz;
} D3DCLIPSTATUS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3DCLIPSTATUS
{
    public uint dwFlags;
    public uint dwStatus;
    public float minx;
    public float maxx;
    public float miny;
    public float maxy;
    public float minz;
    public float maxz;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3DCLIPSTATUS
    Public dwFlags As UInteger
    Public dwStatus As UInteger
    Public minx As Single
    Public maxx As Single
    Public miny As Single
    Public maxy As Single
    Public minz As Single
    Public maxz As Single
End Structure
import ctypes
from ctypes import wintypes

class D3DCLIPSTATUS(ctypes.Structure):
    _fields_ = [
        ("dwFlags", wintypes.DWORD),
        ("dwStatus", wintypes.DWORD),
        ("minx", ctypes.c_float),
        ("maxx", ctypes.c_float),
        ("miny", ctypes.c_float),
        ("maxy", ctypes.c_float),
        ("minz", ctypes.c_float),
        ("maxz", ctypes.c_float),
    ]
#[repr(C)]
pub struct D3DCLIPSTATUS {
    pub dwFlags: u32,
    pub dwStatus: u32,
    pub minx: f32,
    pub maxx: f32,
    pub miny: f32,
    pub maxy: f32,
    pub minz: f32,
    pub maxz: f32,
}
import "golang.org/x/sys/windows"

type D3DCLIPSTATUS struct {
	dwFlags uint32
	dwStatus uint32
	minx float32
	maxx float32
	miny float32
	maxy float32
	minz float32
	maxz float32
}
type
  D3DCLIPSTATUS = record
    dwFlags: DWORD;
    dwStatus: DWORD;
    minx: Single;
    maxx: Single;
    miny: Single;
    maxy: Single;
    minz: Single;
    maxz: Single;
  end;
const D3DCLIPSTATUS = extern struct {
    dwFlags: u32,
    dwStatus: u32,
    minx: f32,
    maxx: f32,
    miny: f32,
    maxy: f32,
    minz: f32,
    maxz: f32,
};
type
  D3DCLIPSTATUS {.bycopy.} = object
    dwFlags: uint32
    dwStatus: uint32
    minx: float32
    maxx: float32
    miny: float32
    maxy: float32
    minz: float32
    maxz: float32
struct D3DCLIPSTATUS
{
    uint dwFlags;
    uint dwStatus;
    float minx;
    float maxx;
    float miny;
    float maxy;
    float minz;
    float maxz;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3DCLIPSTATUS サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwStatus : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; minx : FLOAT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; maxx : FLOAT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; miny : FLOAT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; maxy : FLOAT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; minz : FLOAT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; maxz : FLOAT (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3DCLIPSTATUS
    #field int dwFlags
    #field int dwStatus
    #field float minx
    #field float maxx
    #field float miny
    #field float maxy
    #field float minz
    #field float maxz
#endstruct

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