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

DD_UPDATEOVERLAYDATA

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

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

フィールド

フィールドサイズx64x86説明
lpDDDD_DIRECTDRAW_GLOBAL*8/4+0+0対象のDirectDrawグローバルオブジェクトへのポインタ。
lpDDDestSurfaceDD_SURFACE_LOCAL*8/4+8+4オーバーレイの表示先サーフェスへのポインタ。
rDestRECTL16+16+8オーバーレイ表示先の矩形を示すRECTL。
lpDDSrcSurfaceDD_SURFACE_LOCAL*8/4+32+24オーバーレイ元サーフェスへのポインタ。NULL可。
rSrcRECTL16+40+28オーバーレイ元の矩形を示すRECTL。
dwFlagsDWORD4+56+44オーバーレイ更新動作を制御するDDOVER_系フラグ。
overlayFXDDOVERLAYFX72/56+64+48オーバーレイの特殊効果パラメータを示すDDOVERLAYFX。
ddRValHRESULT4+136+104操作の結果を示すHRESULT。成功時はDD_OK。
UpdateOverlayvoid*8/4+144+108オーバーレイ更新処理を行うコールバック関数へのポインタ。

各言語での定義

#include <windows.h>

// RECTL  (x64 16 / x86 16 バイト)
typedef struct RECTL {
    INT left;
    INT top;
    INT right;
    INT bottom;
} RECTL;

// 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;

// DD_UPDATEOVERLAYDATA  (x64 152 / x86 112 バイト)
typedef struct DD_UPDATEOVERLAYDATA {
    DD_DIRECTDRAW_GLOBAL* lpDD;
    DD_SURFACE_LOCAL* lpDDDestSurface;
    RECTL rDest;
    DD_SURFACE_LOCAL* lpDDSrcSurface;
    RECTL rSrc;
    DWORD dwFlags;
    DDOVERLAYFX overlayFX;
    HRESULT ddRVal;
    void* UpdateOverlay;
} DD_UPDATEOVERLAYDATA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECTL
{
    public int left;
    public int top;
    public int right;
    public int bottom;
}

[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;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DD_UPDATEOVERLAYDATA
{
    public IntPtr lpDD;
    public IntPtr lpDDDestSurface;
    public RECTL rDest;
    public IntPtr lpDDSrcSurface;
    public RECTL rSrc;
    public uint dwFlags;
    public DDOVERLAYFX overlayFX;
    public int ddRVal;
    public IntPtr UpdateOverlay;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECTL
    Public left As Integer
    Public top As Integer
    Public right As Integer
    Public bottom As Integer
End Structure

<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

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DD_UPDATEOVERLAYDATA
    Public lpDD As IntPtr
    Public lpDDDestSurface As IntPtr
    Public rDest As RECTL
    Public lpDDSrcSurface As IntPtr
    Public rSrc As RECTL
    Public dwFlags As UInteger
    Public overlayFX As DDOVERLAYFX
    Public ddRVal As Integer
    Public UpdateOverlay As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class RECTL(ctypes.Structure):
    _fields_ = [
        ("left", ctypes.c_int),
        ("top", ctypes.c_int),
        ("right", ctypes.c_int),
        ("bottom", ctypes.c_int),
    ]

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),
    ]

class DD_UPDATEOVERLAYDATA(ctypes.Structure):
    _fields_ = [
        ("lpDD", ctypes.c_void_p),
        ("lpDDDestSurface", ctypes.c_void_p),
        ("rDest", RECTL),
        ("lpDDSrcSurface", ctypes.c_void_p),
        ("rSrc", RECTL),
        ("dwFlags", wintypes.DWORD),
        ("overlayFX", DDOVERLAYFX),
        ("ddRVal", ctypes.c_int),
        ("UpdateOverlay", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct RECTL {
    pub left: i32,
    pub top: i32,
    pub right: i32,
    pub bottom: i32,
}

#[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,
}

#[repr(C)]
pub struct DD_UPDATEOVERLAYDATA {
    pub lpDD: *mut core::ffi::c_void,
    pub lpDDDestSurface: *mut core::ffi::c_void,
    pub rDest: RECTL,
    pub lpDDSrcSurface: *mut core::ffi::c_void,
    pub rSrc: RECTL,
    pub dwFlags: u32,
    pub overlayFX: DDOVERLAYFX,
    pub ddRVal: i32,
    pub UpdateOverlay: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type RECTL struct {
	left int32
	top int32
	right int32
	bottom int32
}

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 DD_UPDATEOVERLAYDATA struct {
	lpDD uintptr
	lpDDDestSurface uintptr
	rDest RECTL
	lpDDSrcSurface uintptr
	rSrc RECTL
	dwFlags uint32
	overlayFX DDOVERLAYFX
	ddRVal int32
	UpdateOverlay uintptr
}
type
  RECTL = record
    left: Integer;
    top: Integer;
    right: Integer;
    bottom: Integer;
  end;

  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;

  DD_UPDATEOVERLAYDATA = record
    lpDD: Pointer;
    lpDDDestSurface: Pointer;
    rDest: RECTL;
    lpDDSrcSurface: Pointer;
    rSrc: RECTL;
    dwFlags: DWORD;
    overlayFX: DDOVERLAYFX;
    ddRVal: Integer;
    UpdateOverlay: Pointer;
  end;
const RECTL = extern struct {
    left: i32,
    top: i32,
    right: i32,
    bottom: i32,
};

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,
};

const DD_UPDATEOVERLAYDATA = extern struct {
    lpDD: ?*anyopaque,
    lpDDDestSurface: ?*anyopaque,
    rDest: RECTL,
    lpDDSrcSurface: ?*anyopaque,
    rSrc: RECTL,
    dwFlags: u32,
    overlayFX: DDOVERLAYFX,
    ddRVal: i32,
    UpdateOverlay: ?*anyopaque,
};
type
  RECTL {.bycopy.} = object
    left: int32
    top: int32
    right: int32
    bottom: int32

  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

  DD_UPDATEOVERLAYDATA {.bycopy.} = object
    lpDD: pointer
    lpDDDestSurface: pointer
    rDest: RECTL
    lpDDSrcSurface: pointer
    rSrc: RECTL
    dwFlags: uint32
    overlayFX: DDOVERLAYFX
    ddRVal: int32
    UpdateOverlay: pointer
struct RECTL
{
    int left;
    int top;
    int right;
    int bottom;
}

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;
}

struct DD_UPDATEOVERLAYDATA
{
    void* lpDD;
    void* lpDDDestSurface;
    RECTL rDest;
    void* lpDDSrcSurface;
    RECTL rSrc;
    uint dwFlags;
    DDOVERLAYFX overlayFX;
    int ddRVal;
    void* UpdateOverlay;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DD_UPDATEOVERLAYDATA サイズ: 112 バイト(x86)
dim st, 28    ; 4byte整数×28(構造体サイズ 112 / 4 切り上げ)
; lpDD : DD_DIRECTDRAW_GLOBAL* (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; lpDDDestSurface : DD_SURFACE_LOCAL* (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; rDest : RECTL (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; lpDDSrcSurface : DD_SURFACE_LOCAL* (+24, 4byte)  varptr(st)+24 を基点に操作(4byte:入れ子/配列)
; rSrc : RECTL (+28, 16byte)  varptr(st)+28 を基点に操作(16byte:入れ子/配列)
; dwFlags : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; overlayFX : DDOVERLAYFX (+48, 56byte)  varptr(st)+48 を基点に操作(56byte:入れ子/配列)
; ddRVal : HRESULT (+104, 4byte)  st.26 = 値  /  値 = st.26   (lpoke/lpeek も可)
; UpdateOverlay : void* (+108, 4byte)  st.27 = 値  /  値 = st.27   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DD_UPDATEOVERLAYDATA サイズ: 152 バイト(x64)
dim st, 38    ; 4byte整数×38(構造体サイズ 152 / 4 切り上げ)
; lpDD : DD_DIRECTDRAW_GLOBAL* (+0, 8byte)  varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; lpDDDestSurface : DD_SURFACE_LOCAL* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; rDest : RECTL (+16, 16byte)  varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; lpDDSrcSurface : DD_SURFACE_LOCAL* (+32, 8byte)  varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; rSrc : RECTL (+40, 16byte)  varptr(st)+40 を基点に操作(16byte:入れ子/配列)
; dwFlags : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; overlayFX : DDOVERLAYFX (+64, 72byte)  varptr(st)+64 を基点に操作(72byte:入れ子/配列)
; ddRVal : HRESULT (+136, 4byte)  st.34 = 値  /  値 = st.34   (lpoke/lpeek も可)
; UpdateOverlay : void* (+144, 8byte)  qpoke st,144,値 / qpeek(st,144)  ※IronHSPのみ。3.7/3.8は lpoke st,144,下位 : lpoke st,148,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global RECTL
    #field int left
    #field int top
    #field int right
    #field int bottom
#endstruct

#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

#defstruct global DD_UPDATEOVERLAYDATA
    #field intptr lpDD
    #field intptr lpDDDestSurface
    #field RECTL rDest
    #field intptr lpDDSrcSurface
    #field RECTL rSrc
    #field int dwFlags
    #field DDOVERLAYFX overlayFX
    #field int ddRVal
    #field intptr UpdateOverlay
#endstruct

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