ホーム › Graphics.DirectDraw › DDHALMODEINFO
DDHALMODEINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwWidth | DWORD | 4 | +0 | +0 | ディスプレイモードの幅(ピクセル)を示す。 |
| dwHeight | DWORD | 4 | +4 | +4 | ディスプレイモードの高さ(ピクセル)を示す。 |
| lPitch | INT | 4 | +8 | +8 | 1ラインのバイト数(ピッチ)を示す。 |
| dwBPP | DWORD | 4 | +12 | +12 | 1ピクセルあたりのビット数を示す。 |
| wFlags | WORD | 2 | +16 | +16 | モードの属性を示すDDMODEINFO_系フラグを示す。 |
| wRefreshRate | WORD | 2 | +18 | +18 | リフレッシュレート(Hz)を示す。0は既定値を意味する。 |
| dwRBitMask | DWORD | 4 | +20 | +20 | 赤成分のビットマスクを示す。 |
| dwGBitMask | DWORD | 4 | +24 | +24 | 緑成分のビットマスクを示す。 |
| dwBBitMask | DWORD | 4 | +28 | +28 | 青成分のビットマスクを示す。 |
| dwAlphaBitMask | DWORD | 4 | +32 | +32 | アルファ成分のビットマスクを示す。 |
各言語での定義
#include <windows.h>
// DDHALMODEINFO (x64 36 / x86 36 バイト)
typedef struct DDHALMODEINFO {
DWORD dwWidth;
DWORD dwHeight;
INT lPitch;
DWORD dwBPP;
WORD wFlags;
WORD wRefreshRate;
DWORD dwRBitMask;
DWORD dwGBitMask;
DWORD dwBBitMask;
DWORD dwAlphaBitMask;
} DDHALMODEINFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDHALMODEINFO
{
public uint dwWidth;
public uint dwHeight;
public int lPitch;
public uint dwBPP;
public ushort wFlags;
public ushort wRefreshRate;
public uint dwRBitMask;
public uint dwGBitMask;
public uint dwBBitMask;
public uint dwAlphaBitMask;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDHALMODEINFO
Public dwWidth As UInteger
Public dwHeight As UInteger
Public lPitch As Integer
Public dwBPP As UInteger
Public wFlags As UShort
Public wRefreshRate As UShort
Public dwRBitMask As UInteger
Public dwGBitMask As UInteger
Public dwBBitMask As UInteger
Public dwAlphaBitMask As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DDHALMODEINFO(ctypes.Structure):
_fields_ = [
("dwWidth", wintypes.DWORD),
("dwHeight", wintypes.DWORD),
("lPitch", ctypes.c_int),
("dwBPP", wintypes.DWORD),
("wFlags", ctypes.c_ushort),
("wRefreshRate", ctypes.c_ushort),
("dwRBitMask", wintypes.DWORD),
("dwGBitMask", wintypes.DWORD),
("dwBBitMask", wintypes.DWORD),
("dwAlphaBitMask", wintypes.DWORD),
]#[repr(C)]
pub struct DDHALMODEINFO {
pub dwWidth: u32,
pub dwHeight: u32,
pub lPitch: i32,
pub dwBPP: u32,
pub wFlags: u16,
pub wRefreshRate: u16,
pub dwRBitMask: u32,
pub dwGBitMask: u32,
pub dwBBitMask: u32,
pub dwAlphaBitMask: u32,
}import "golang.org/x/sys/windows"
type DDHALMODEINFO struct {
dwWidth uint32
dwHeight uint32
lPitch int32
dwBPP uint32
wFlags uint16
wRefreshRate uint16
dwRBitMask uint32
dwGBitMask uint32
dwBBitMask uint32
dwAlphaBitMask uint32
}type
DDHALMODEINFO = record
dwWidth: DWORD;
dwHeight: DWORD;
lPitch: Integer;
dwBPP: DWORD;
wFlags: Word;
wRefreshRate: Word;
dwRBitMask: DWORD;
dwGBitMask: DWORD;
dwBBitMask: DWORD;
dwAlphaBitMask: DWORD;
end;const DDHALMODEINFO = extern struct {
dwWidth: u32,
dwHeight: u32,
lPitch: i32,
dwBPP: u32,
wFlags: u16,
wRefreshRate: u16,
dwRBitMask: u32,
dwGBitMask: u32,
dwBBitMask: u32,
dwAlphaBitMask: u32,
};type
DDHALMODEINFO {.bycopy.} = object
dwWidth: uint32
dwHeight: uint32
lPitch: int32
dwBPP: uint32
wFlags: uint16
wRefreshRate: uint16
dwRBitMask: uint32
dwGBitMask: uint32
dwBBitMask: uint32
dwAlphaBitMask: uint32struct DDHALMODEINFO
{
uint dwWidth;
uint dwHeight;
int lPitch;
uint dwBPP;
ushort wFlags;
ushort wRefreshRate;
uint dwRBitMask;
uint dwGBitMask;
uint dwBBitMask;
uint dwAlphaBitMask;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DDHALMODEINFO サイズ: 36 バイト(x64)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; dwWidth : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwHeight : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lPitch : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwBPP : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; wFlags : WORD (+16, 2byte) wpoke st,16,値 / 値 = wpeek(st,16)
; wRefreshRate : WORD (+18, 2byte) wpoke st,18,値 / 値 = wpeek(st,18)
; dwRBitMask : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwGBitMask : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwBBitMask : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwAlphaBitMask : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DDHALMODEINFO
#field int dwWidth
#field int dwHeight
#field int lPitch
#field int dwBPP
#field short wFlags
#field short wRefreshRate
#field int dwRBitMask
#field int dwGBitMask
#field int dwBBitMask
#field int dwAlphaBitMask
#endstruct
stdim st, DDHALMODEINFO ; NSTRUCT 変数を確保
st->dwWidth = 100
mes "dwWidth=" + st->dwWidth