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

DDOVERLAYFX

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

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

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0構造体サイズ(バイト数)。呼び出し前に設定する。
dwAlphaEdgeBlendBitDepthDWORD4+4+4エッジブレンド用アルファのビット深度を示す。
dwAlphaEdgeBlendDWORD4+8+8エッジブレンドに用いるアルファ値を示す。
dwReservedDWORD4+12+12予約フィールド。0とする。
dwAlphaDestConstBitDepthDWORD4+16+16転送先アルファ定数のビット深度を示す。
Anonymous1_Anonymous1_e__Union8/4+24+20転送先アルファ定数値または対応サーフェスを保持する共用体。
dwAlphaSrcConstBitDepthDWORD4+32+24転送元アルファ定数のビット深度を示す。
Anonymous2_Anonymous2_e__Union8/4+40+28転送元アルファ定数値または対応サーフェスを保持する共用体。
dckDestColorkeyDDCOLORKEY8+48+32転送先オーバーレイに適用するカラーキー(DDCOLORKEY)。
dckSrcColorkeyDDCOLORKEY8+56+40転送元オーバーレイに適用するカラーキー(DDCOLORKEY)。
dwDDFXDWORD4+64+48オーバーレイ更新に適用する効果フラグ(DDOVERFX_系)。
dwFlagsDWORD4+68+52現在未使用の予約フラグ。0とする。

共用体: _Anonymous1_e__Union x64 8B / x86 4B

フィールドサイズx64x86
dwAlphaDestConstDWORD4+0+0
lpDDSAlphaDestIDirectDrawSurface*8/4+0+0

共用体: _Anonymous2_e__Union x64 8B / x86 4B

フィールドサイズx64x86
dwAlphaSrcConstDWORD4+0+0
lpDDSAlphaSrcIDirectDrawSurface*8/4+0+0

各言語での定義

#include <windows.h>

// DDCOLORKEY  (x64 8 / x86 8 バイト)
typedef struct DDCOLORKEY {
    DWORD dwColorSpaceLowValue;
    DWORD dwColorSpaceHighValue;
} DDCOLORKEY;

// DDOVERLAYFX  (x64 72 / x86 56 バイト)
typedef struct DDOVERLAYFX {
    DWORD dwSize;
    DWORD dwAlphaEdgeBlendBitDepth;
    DWORD dwAlphaEdgeBlend;
    DWORD dwReserved;
    DWORD dwAlphaDestConstBitDepth;
    _Anonymous1_e__Union Anonymous1;
    DWORD dwAlphaSrcConstBitDepth;
    _Anonymous2_e__Union Anonymous2;
    DDCOLORKEY dckDestColorkey;
    DDCOLORKEY dckSrcColorkey;
    DWORD dwDDFX;
    DWORD dwFlags;
} DDOVERLAYFX;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDCOLORKEY
{
    public uint dwColorSpaceLowValue;
    public uint dwColorSpaceHighValue;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDOVERLAYFX
{
    public uint dwSize;
    public uint dwAlphaEdgeBlendBitDepth;
    public uint dwAlphaEdgeBlend;
    public uint dwReserved;
    public uint dwAlphaDestConstBitDepth;
    public _Anonymous1_e__Union Anonymous1;
    public uint dwAlphaSrcConstBitDepth;
    public _Anonymous2_e__Union Anonymous2;
    public DDCOLORKEY dckDestColorkey;
    public DDCOLORKEY dckSrcColorkey;
    public uint dwDDFX;
    public uint dwFlags;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDCOLORKEY
    Public dwColorSpaceLowValue As UInteger
    Public dwColorSpaceHighValue As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDOVERLAYFX
    Public dwSize As UInteger
    Public dwAlphaEdgeBlendBitDepth As UInteger
    Public dwAlphaEdgeBlend As UInteger
    Public dwReserved As UInteger
    Public dwAlphaDestConstBitDepth As UInteger
    Public Anonymous1 As _Anonymous1_e__Union
    Public dwAlphaSrcConstBitDepth As UInteger
    Public Anonymous2 As _Anonymous2_e__Union
    Public dckDestColorkey As DDCOLORKEY
    Public dckSrcColorkey As DDCOLORKEY
    Public dwDDFX As UInteger
    Public dwFlags As UInteger
End Structure
import ctypes
from ctypes import wintypes

class DDCOLORKEY(ctypes.Structure):
    _fields_ = [
        ("dwColorSpaceLowValue", wintypes.DWORD),
        ("dwColorSpaceHighValue", wintypes.DWORD),
    ]

class DDOVERLAYFX(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("dwAlphaEdgeBlendBitDepth", wintypes.DWORD),
        ("dwAlphaEdgeBlend", wintypes.DWORD),
        ("dwReserved", wintypes.DWORD),
        ("dwAlphaDestConstBitDepth", wintypes.DWORD),
        ("Anonymous1", _Anonymous1_e__Union),
        ("dwAlphaSrcConstBitDepth", wintypes.DWORD),
        ("Anonymous2", _Anonymous2_e__Union),
        ("dckDestColorkey", DDCOLORKEY),
        ("dckSrcColorkey", DDCOLORKEY),
        ("dwDDFX", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
    ]
#[repr(C)]
pub struct DDCOLORKEY {
    pub dwColorSpaceLowValue: u32,
    pub dwColorSpaceHighValue: u32,
}

#[repr(C)]
pub struct DDOVERLAYFX {
    pub dwSize: u32,
    pub dwAlphaEdgeBlendBitDepth: u32,
    pub dwAlphaEdgeBlend: u32,
    pub dwReserved: u32,
    pub dwAlphaDestConstBitDepth: u32,
    pub Anonymous1: _Anonymous1_e__Union,
    pub dwAlphaSrcConstBitDepth: u32,
    pub Anonymous2: _Anonymous2_e__Union,
    pub dckDestColorkey: DDCOLORKEY,
    pub dckSrcColorkey: DDCOLORKEY,
    pub dwDDFX: u32,
    pub dwFlags: u32,
}
import "golang.org/x/sys/windows"

type DDCOLORKEY struct {
	dwColorSpaceLowValue uint32
	dwColorSpaceHighValue uint32
}

type DDOVERLAYFX struct {
	dwSize uint32
	dwAlphaEdgeBlendBitDepth uint32
	dwAlphaEdgeBlend uint32
	dwReserved uint32
	dwAlphaDestConstBitDepth uint32
	Anonymous1 _Anonymous1_e__Union
	dwAlphaSrcConstBitDepth uint32
	Anonymous2 _Anonymous2_e__Union
	dckDestColorkey DDCOLORKEY
	dckSrcColorkey DDCOLORKEY
	dwDDFX uint32
	dwFlags uint32
}
type
  DDCOLORKEY = record
    dwColorSpaceLowValue: DWORD;
    dwColorSpaceHighValue: DWORD;
  end;

  DDOVERLAYFX = record
    dwSize: DWORD;
    dwAlphaEdgeBlendBitDepth: DWORD;
    dwAlphaEdgeBlend: DWORD;
    dwReserved: DWORD;
    dwAlphaDestConstBitDepth: DWORD;
    Anonymous1: _Anonymous1_e__Union;
    dwAlphaSrcConstBitDepth: DWORD;
    Anonymous2: _Anonymous2_e__Union;
    dckDestColorkey: DDCOLORKEY;
    dckSrcColorkey: DDCOLORKEY;
    dwDDFX: DWORD;
    dwFlags: DWORD;
  end;
const DDCOLORKEY = extern struct {
    dwColorSpaceLowValue: u32,
    dwColorSpaceHighValue: u32,
};

const DDOVERLAYFX = extern struct {
    dwSize: u32,
    dwAlphaEdgeBlendBitDepth: u32,
    dwAlphaEdgeBlend: u32,
    dwReserved: u32,
    dwAlphaDestConstBitDepth: u32,
    Anonymous1: _Anonymous1_e__Union,
    dwAlphaSrcConstBitDepth: u32,
    Anonymous2: _Anonymous2_e__Union,
    dckDestColorkey: DDCOLORKEY,
    dckSrcColorkey: DDCOLORKEY,
    dwDDFX: u32,
    dwFlags: u32,
};
type
  DDCOLORKEY {.bycopy.} = object
    dwColorSpaceLowValue: uint32
    dwColorSpaceHighValue: uint32

  DDOVERLAYFX {.bycopy.} = object
    dwSize: uint32
    dwAlphaEdgeBlendBitDepth: uint32
    dwAlphaEdgeBlend: uint32
    dwReserved: uint32
    dwAlphaDestConstBitDepth: uint32
    Anonymous1: _Anonymous1_e__Union
    dwAlphaSrcConstBitDepth: uint32
    Anonymous2: _Anonymous2_e__Union
    dckDestColorkey: DDCOLORKEY
    dckSrcColorkey: DDCOLORKEY
    dwDDFX: uint32
    dwFlags: uint32
struct DDCOLORKEY
{
    uint dwColorSpaceLowValue;
    uint dwColorSpaceHighValue;
}

struct DDOVERLAYFX
{
    uint dwSize;
    uint dwAlphaEdgeBlendBitDepth;
    uint dwAlphaEdgeBlend;
    uint dwReserved;
    uint dwAlphaDestConstBitDepth;
    _Anonymous1_e__Union Anonymous1;
    uint dwAlphaSrcConstBitDepth;
    _Anonymous2_e__Union Anonymous2;
    DDCOLORKEY dckDestColorkey;
    DDCOLORKEY dckSrcColorkey;
    uint dwDDFX;
    uint dwFlags;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DDOVERLAYFX サイズ: 56 バイト(x86)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwAlphaEdgeBlendBitDepth : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwAlphaEdgeBlend : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwReserved : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwAlphaDestConstBitDepth : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; Anonymous1 : _Anonymous1_e__Union (+20, 4byte)  varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; dwAlphaSrcConstBitDepth : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; Anonymous2 : _Anonymous2_e__Union (+28, 4byte)  varptr(st)+28 を基点に操作(4byte:入れ子/配列)
; dckDestColorkey : DDCOLORKEY (+32, 8byte)  varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; dckSrcColorkey : DDCOLORKEY (+40, 8byte)  varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; dwDDFX : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; dwFlags : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DDOVERLAYFX サイズ: 72 バイト(x64)
dim st, 18    ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwAlphaEdgeBlendBitDepth : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwAlphaEdgeBlend : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwReserved : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwAlphaDestConstBitDepth : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; Anonymous1 : _Anonymous1_e__Union (+24, 8byte)  varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; dwAlphaSrcConstBitDepth : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; Anonymous2 : _Anonymous2_e__Union (+40, 8byte)  varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; dckDestColorkey : DDCOLORKEY (+48, 8byte)  varptr(st)+48 を基点に操作(8byte:入れ子/配列)
; dckSrcColorkey : DDCOLORKEY (+56, 8byte)  varptr(st)+56 を基点に操作(8byte:入れ子/配列)
; dwDDFX : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; dwFlags : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DDCOLORKEY
    #field int dwColorSpaceLowValue
    #field int dwColorSpaceHighValue
#endstruct

#defstruct global DDOVERLAYFX
    #field int dwSize
    #field int dwAlphaEdgeBlendBitDepth
    #field int dwAlphaEdgeBlend
    #field int dwReserved
    #field int dwAlphaDestConstBitDepth
    #field byte Anonymous1 8
    #field int dwAlphaSrcConstBitDepth
    #field byte Anonymous2 8
    #field DDCOLORKEY dckDestColorkey
    #field DDCOLORKEY dckSrcColorkey
    #field int dwDDFX
    #field int dwFlags
#endstruct

stdim st, DDOVERLAYFX        ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。