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

DDVIDEOPORTBANDWIDTH

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

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

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0構造体サイズ(バイト数)。呼び出し前に設定する。
dwCapsDWORD4+4+4帯域情報に関する能力フラグを示す。
dwOverlayDWORD4+8+8オーバーレイ表示時に必要な帯域(オーバーレイ幅)を示す。
dwColorkeyDWORD4+12+12カラーキー使用時に必要な帯域を示す。
dwYInterpolateDWORD4+16+16Y補間使用時に必要な帯域を示す。
dwYInterpAndColorkeyDWORD4+20+20Y補間とカラーキー併用時に必要な帯域を示す。
dwReserved1UINT_PTR8/4+24+24予約フィールド。0とする。
dwReserved2UINT_PTR8/4+32+28予約フィールド。0とする。

各言語での定義

#include <windows.h>

// DDVIDEOPORTBANDWIDTH  (x64 40 / x86 32 バイト)
typedef struct DDVIDEOPORTBANDWIDTH {
    DWORD dwSize;
    DWORD dwCaps;
    DWORD dwOverlay;
    DWORD dwColorkey;
    DWORD dwYInterpolate;
    DWORD dwYInterpAndColorkey;
    UINT_PTR dwReserved1;
    UINT_PTR dwReserved2;
} DDVIDEOPORTBANDWIDTH;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDVIDEOPORTBANDWIDTH
{
    public uint dwSize;
    public uint dwCaps;
    public uint dwOverlay;
    public uint dwColorkey;
    public uint dwYInterpolate;
    public uint dwYInterpAndColorkey;
    public UIntPtr dwReserved1;
    public UIntPtr dwReserved2;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDVIDEOPORTBANDWIDTH
    Public dwSize As UInteger
    Public dwCaps As UInteger
    Public dwOverlay As UInteger
    Public dwColorkey As UInteger
    Public dwYInterpolate As UInteger
    Public dwYInterpAndColorkey As UInteger
    Public dwReserved1 As UIntPtr
    Public dwReserved2 As UIntPtr
End Structure
import ctypes
from ctypes import wintypes

class DDVIDEOPORTBANDWIDTH(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("dwCaps", wintypes.DWORD),
        ("dwOverlay", wintypes.DWORD),
        ("dwColorkey", wintypes.DWORD),
        ("dwYInterpolate", wintypes.DWORD),
        ("dwYInterpAndColorkey", wintypes.DWORD),
        ("dwReserved1", ctypes.c_size_t),
        ("dwReserved2", ctypes.c_size_t),
    ]
#[repr(C)]
pub struct DDVIDEOPORTBANDWIDTH {
    pub dwSize: u32,
    pub dwCaps: u32,
    pub dwOverlay: u32,
    pub dwColorkey: u32,
    pub dwYInterpolate: u32,
    pub dwYInterpAndColorkey: u32,
    pub dwReserved1: usize,
    pub dwReserved2: usize,
}
import "golang.org/x/sys/windows"

type DDVIDEOPORTBANDWIDTH struct {
	dwSize uint32
	dwCaps uint32
	dwOverlay uint32
	dwColorkey uint32
	dwYInterpolate uint32
	dwYInterpAndColorkey uint32
	dwReserved1 uintptr
	dwReserved2 uintptr
}
type
  DDVIDEOPORTBANDWIDTH = record
    dwSize: DWORD;
    dwCaps: DWORD;
    dwOverlay: DWORD;
    dwColorkey: DWORD;
    dwYInterpolate: DWORD;
    dwYInterpAndColorkey: DWORD;
    dwReserved1: NativeUInt;
    dwReserved2: NativeUInt;
  end;
const DDVIDEOPORTBANDWIDTH = extern struct {
    dwSize: u32,
    dwCaps: u32,
    dwOverlay: u32,
    dwColorkey: u32,
    dwYInterpolate: u32,
    dwYInterpAndColorkey: u32,
    dwReserved1: usize,
    dwReserved2: usize,
};
type
  DDVIDEOPORTBANDWIDTH {.bycopy.} = object
    dwSize: uint32
    dwCaps: uint32
    dwOverlay: uint32
    dwColorkey: uint32
    dwYInterpolate: uint32
    dwYInterpAndColorkey: uint32
    dwReserved1: uint
    dwReserved2: uint
struct DDVIDEOPORTBANDWIDTH
{
    uint dwSize;
    uint dwCaps;
    uint dwOverlay;
    uint dwColorkey;
    uint dwYInterpolate;
    uint dwYInterpAndColorkey;
    size_t dwReserved1;
    size_t dwReserved2;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DDVIDEOPORTBANDWIDTH サイズ: 32 バイト(x86)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwCaps : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwOverlay : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwColorkey : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwYInterpolate : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwYInterpAndColorkey : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwReserved1 : UINT_PTR (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwReserved2 : UINT_PTR (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DDVIDEOPORTBANDWIDTH サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwCaps : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwOverlay : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwColorkey : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwYInterpolate : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwYInterpAndColorkey : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwReserved1 : UINT_PTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; dwReserved2 : UINT_PTR (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DDVIDEOPORTBANDWIDTH
    #field int dwSize
    #field int dwCaps
    #field int dwOverlay
    #field int dwColorkey
    #field int dwYInterpolate
    #field int dwYInterpAndColorkey
    #field intptr dwReserved1
    #field intptr dwReserved2
#endstruct

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