ホーム › Graphics.Direct3D9 › D3DSURFACE_DESC
D3DSURFACE_DESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Format | D3DFORMAT | 4 | +0 | +0 | サーフェスのピクセル形式を示すD3DFORMAT。 |
| Type | D3DRESOURCETYPE | 4 | +4 | +4 | リソース種別を示すD3DRESOURCETYPE(サーフェス)。 |
| Usage | DWORD | 4 | +8 | +8 | サーフェスの使用法を制御するフラグ群。 |
| Pool | D3DPOOL | 4 | +12 | +12 | メモリプールの種別を示すD3DPOOL。 |
| MultiSampleType | D3DMULTISAMPLE_TYPE | 4 | +16 | +16 | マルチサンプリングの種別を示すD3DMULTISAMPLE_TYPE。 |
| MultiSampleQuality | DWORD | 4 | +20 | +20 | マルチサンプリングの品質レベル。 |
| Width | DWORD | 4 | +24 | +24 | サーフェスの幅(ピクセル単位)。 |
| Height | DWORD | 4 | +28 | +28 | サーフェスの高さ(ピクセル単位)。 |
各言語での定義
#include <windows.h>
// D3DSURFACE_DESC (x64 32 / x86 32 バイト)
typedef struct D3DSURFACE_DESC {
D3DFORMAT Format;
D3DRESOURCETYPE Type;
DWORD Usage;
D3DPOOL Pool;
D3DMULTISAMPLE_TYPE MultiSampleType;
DWORD MultiSampleQuality;
DWORD Width;
DWORD Height;
} D3DSURFACE_DESC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3DSURFACE_DESC
{
public uint Format;
public int Type;
public uint Usage;
public int Pool;
public int MultiSampleType;
public uint MultiSampleQuality;
public uint Width;
public uint Height;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3DSURFACE_DESC
Public Format As UInteger
Public Type As Integer
Public Usage As UInteger
Public Pool As Integer
Public MultiSampleType As Integer
Public MultiSampleQuality As UInteger
Public Width As UInteger
Public Height As UInteger
End Structureimport ctypes
from ctypes import wintypes
class D3DSURFACE_DESC(ctypes.Structure):
_fields_ = [
("Format", wintypes.DWORD),
("Type", ctypes.c_int),
("Usage", wintypes.DWORD),
("Pool", ctypes.c_int),
("MultiSampleType", ctypes.c_int),
("MultiSampleQuality", wintypes.DWORD),
("Width", wintypes.DWORD),
("Height", wintypes.DWORD),
]#[repr(C)]
pub struct D3DSURFACE_DESC {
pub Format: u32,
pub Type: i32,
pub Usage: u32,
pub Pool: i32,
pub MultiSampleType: i32,
pub MultiSampleQuality: u32,
pub Width: u32,
pub Height: u32,
}import "golang.org/x/sys/windows"
type D3DSURFACE_DESC struct {
Format uint32
Type int32
Usage uint32
Pool int32
MultiSampleType int32
MultiSampleQuality uint32
Width uint32
Height uint32
}type
D3DSURFACE_DESC = record
Format: DWORD;
Type: Integer;
Usage: DWORD;
Pool: Integer;
MultiSampleType: Integer;
MultiSampleQuality: DWORD;
Width: DWORD;
Height: DWORD;
end;const D3DSURFACE_DESC = extern struct {
Format: u32,
Type: i32,
Usage: u32,
Pool: i32,
MultiSampleType: i32,
MultiSampleQuality: u32,
Width: u32,
Height: u32,
};type
D3DSURFACE_DESC {.bycopy.} = object
Format: uint32
Type: int32
Usage: uint32
Pool: int32
MultiSampleType: int32
MultiSampleQuality: uint32
Width: uint32
Height: uint32struct D3DSURFACE_DESC
{
uint Format;
int Type;
uint Usage;
int Pool;
int MultiSampleType;
uint MultiSampleQuality;
uint Width;
uint Height;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3DSURFACE_DESC サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Format : D3DFORMAT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Type : D3DRESOURCETYPE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Usage : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Pool : D3DPOOL (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; MultiSampleType : D3DMULTISAMPLE_TYPE (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; MultiSampleQuality : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Width : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; Height : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3DSURFACE_DESC
#field int Format
#field int Type
#field int Usage
#field int Pool
#field int MultiSampleType
#field int MultiSampleQuality
#field int Width
#field int Height
#endstruct
stdim st, D3DSURFACE_DESC ; NSTRUCT 変数を確保
st->Format = 100
mes "Format=" + st->Format