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

DXAPI_INTERFACE

構造体
サイズx64: 136 バイト / x86: 68 バイト

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

フィールド

フィールドサイズx64x86説明
SizeWORD2+0+0この構造体のサイズをバイト単位で示す。
VersionWORD2+2+2このインターフェイスのバージョン番号。
Contextvoid*8/4+8+4コールバックに渡されるコンテキストポインタ。
InterfaceReferencevoid*8/4+16+8インターフェイスの参照カウントを増やす関数へのポインタ。
InterfaceDereferencevoid*8/4+24+12インターフェイスの参照カウントを減らす関数へのポインタ。
DxGetIrqInfoPDX_GETIRQINFO8/4+32+16割り込み情報を取得する関数へのポインタ。
DxEnableIrqPDX_ENABLEIRQ8/4+40+20割り込みを有効化する関数へのポインタ。
DxSkipNextFieldPDX_SKIPNEXTFIELD8/4+48+24次フィールドをスキップする関数へのポインタ。
DxBobNextFieldPDX_BOBNEXTFIELD8/4+56+28次フィールドをBob表示する関数へのポインタ。
DxSetStatePDX_SETSTATE8/4+64+32状態を設定する関数へのポインタ。
DxLockPDX_LOCK8/4+72+36サーフェスをロックする関数へのポインタ。
DxFlipOverlayPDX_FLIPOVERLAY8/4+80+40オーバーレイをフリップする関数へのポインタ。
DxFlipVideoPortPDX_FLIPVIDEOPORT8/4+88+44ビデオポートをフリップする関数へのポインタ。
DxGetPolarityPDX_GETPOLARITY8/4+96+48現在のフィールド極性を取得する関数へのポインタ。
DxGetCurrentAutoflipPDX_GETCURRENTAUTOFLIP8/4+104+52現在の自動フリップ状態を取得する関数へのポインタ。
DxGetPreviousAutoflipPDX_GETPREVIOUSAUTOFLIP8/4+112+56直前の自動フリップ状態を取得する関数へのポインタ。
DxTransferPDX_TRANSFER8/4+120+60データ転送を実行する関数へのポインタ。
DxGetTransferStatusPDX_GETTRANSFERSTATUS8/4+128+64転送状態を取得する関数へのポインタ。

各言語での定義

#include <windows.h>

// DXAPI_INTERFACE  (x64 136 / x86 68 バイト)
typedef struct DXAPI_INTERFACE {
    WORD Size;
    WORD Version;
    void* Context;
    void* InterfaceReference;
    void* InterfaceDereference;
    PDX_GETIRQINFO DxGetIrqInfo;
    PDX_ENABLEIRQ DxEnableIrq;
    PDX_SKIPNEXTFIELD DxSkipNextField;
    PDX_BOBNEXTFIELD DxBobNextField;
    PDX_SETSTATE DxSetState;
    PDX_LOCK DxLock;
    PDX_FLIPOVERLAY DxFlipOverlay;
    PDX_FLIPVIDEOPORT DxFlipVideoPort;
    PDX_GETPOLARITY DxGetPolarity;
    PDX_GETCURRENTAUTOFLIP DxGetCurrentAutoflip;
    PDX_GETPREVIOUSAUTOFLIP DxGetPreviousAutoflip;
    PDX_TRANSFER DxTransfer;
    PDX_GETTRANSFERSTATUS DxGetTransferStatus;
} DXAPI_INTERFACE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXAPI_INTERFACE
{
    public ushort Size;
    public ushort Version;
    public IntPtr Context;
    public IntPtr InterfaceReference;
    public IntPtr InterfaceDereference;
    public IntPtr DxGetIrqInfo;
    public IntPtr DxEnableIrq;
    public IntPtr DxSkipNextField;
    public IntPtr DxBobNextField;
    public IntPtr DxSetState;
    public IntPtr DxLock;
    public IntPtr DxFlipOverlay;
    public IntPtr DxFlipVideoPort;
    public IntPtr DxGetPolarity;
    public IntPtr DxGetCurrentAutoflip;
    public IntPtr DxGetPreviousAutoflip;
    public IntPtr DxTransfer;
    public IntPtr DxGetTransferStatus;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXAPI_INTERFACE
    Public Size As UShort
    Public Version As UShort
    Public Context As IntPtr
    Public InterfaceReference As IntPtr
    Public InterfaceDereference As IntPtr
    Public DxGetIrqInfo As IntPtr
    Public DxEnableIrq As IntPtr
    Public DxSkipNextField As IntPtr
    Public DxBobNextField As IntPtr
    Public DxSetState As IntPtr
    Public DxLock As IntPtr
    Public DxFlipOverlay As IntPtr
    Public DxFlipVideoPort As IntPtr
    Public DxGetPolarity As IntPtr
    Public DxGetCurrentAutoflip As IntPtr
    Public DxGetPreviousAutoflip As IntPtr
    Public DxTransfer As IntPtr
    Public DxGetTransferStatus As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class DXAPI_INTERFACE(ctypes.Structure):
    _fields_ = [
        ("Size", ctypes.c_ushort),
        ("Version", ctypes.c_ushort),
        ("Context", ctypes.c_void_p),
        ("InterfaceReference", ctypes.c_void_p),
        ("InterfaceDereference", ctypes.c_void_p),
        ("DxGetIrqInfo", ctypes.c_void_p),
        ("DxEnableIrq", ctypes.c_void_p),
        ("DxSkipNextField", ctypes.c_void_p),
        ("DxBobNextField", ctypes.c_void_p),
        ("DxSetState", ctypes.c_void_p),
        ("DxLock", ctypes.c_void_p),
        ("DxFlipOverlay", ctypes.c_void_p),
        ("DxFlipVideoPort", ctypes.c_void_p),
        ("DxGetPolarity", ctypes.c_void_p),
        ("DxGetCurrentAutoflip", ctypes.c_void_p),
        ("DxGetPreviousAutoflip", ctypes.c_void_p),
        ("DxTransfer", ctypes.c_void_p),
        ("DxGetTransferStatus", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct DXAPI_INTERFACE {
    pub Size: u16,
    pub Version: u16,
    pub Context: *mut core::ffi::c_void,
    pub InterfaceReference: *mut core::ffi::c_void,
    pub InterfaceDereference: *mut core::ffi::c_void,
    pub DxGetIrqInfo: *mut core::ffi::c_void,
    pub DxEnableIrq: *mut core::ffi::c_void,
    pub DxSkipNextField: *mut core::ffi::c_void,
    pub DxBobNextField: *mut core::ffi::c_void,
    pub DxSetState: *mut core::ffi::c_void,
    pub DxLock: *mut core::ffi::c_void,
    pub DxFlipOverlay: *mut core::ffi::c_void,
    pub DxFlipVideoPort: *mut core::ffi::c_void,
    pub DxGetPolarity: *mut core::ffi::c_void,
    pub DxGetCurrentAutoflip: *mut core::ffi::c_void,
    pub DxGetPreviousAutoflip: *mut core::ffi::c_void,
    pub DxTransfer: *mut core::ffi::c_void,
    pub DxGetTransferStatus: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type DXAPI_INTERFACE struct {
	Size uint16
	Version uint16
	Context uintptr
	InterfaceReference uintptr
	InterfaceDereference uintptr
	DxGetIrqInfo uintptr
	DxEnableIrq uintptr
	DxSkipNextField uintptr
	DxBobNextField uintptr
	DxSetState uintptr
	DxLock uintptr
	DxFlipOverlay uintptr
	DxFlipVideoPort uintptr
	DxGetPolarity uintptr
	DxGetCurrentAutoflip uintptr
	DxGetPreviousAutoflip uintptr
	DxTransfer uintptr
	DxGetTransferStatus uintptr
}
type
  DXAPI_INTERFACE = record
    Size: Word;
    Version: Word;
    Context: Pointer;
    InterfaceReference: Pointer;
    InterfaceDereference: Pointer;
    DxGetIrqInfo: Pointer;
    DxEnableIrq: Pointer;
    DxSkipNextField: Pointer;
    DxBobNextField: Pointer;
    DxSetState: Pointer;
    DxLock: Pointer;
    DxFlipOverlay: Pointer;
    DxFlipVideoPort: Pointer;
    DxGetPolarity: Pointer;
    DxGetCurrentAutoflip: Pointer;
    DxGetPreviousAutoflip: Pointer;
    DxTransfer: Pointer;
    DxGetTransferStatus: Pointer;
  end;
const DXAPI_INTERFACE = extern struct {
    Size: u16,
    Version: u16,
    Context: ?*anyopaque,
    InterfaceReference: ?*anyopaque,
    InterfaceDereference: ?*anyopaque,
    DxGetIrqInfo: ?*anyopaque,
    DxEnableIrq: ?*anyopaque,
    DxSkipNextField: ?*anyopaque,
    DxBobNextField: ?*anyopaque,
    DxSetState: ?*anyopaque,
    DxLock: ?*anyopaque,
    DxFlipOverlay: ?*anyopaque,
    DxFlipVideoPort: ?*anyopaque,
    DxGetPolarity: ?*anyopaque,
    DxGetCurrentAutoflip: ?*anyopaque,
    DxGetPreviousAutoflip: ?*anyopaque,
    DxTransfer: ?*anyopaque,
    DxGetTransferStatus: ?*anyopaque,
};
type
  DXAPI_INTERFACE {.bycopy.} = object
    Size: uint16
    Version: uint16
    Context: pointer
    InterfaceReference: pointer
    InterfaceDereference: pointer
    DxGetIrqInfo: pointer
    DxEnableIrq: pointer
    DxSkipNextField: pointer
    DxBobNextField: pointer
    DxSetState: pointer
    DxLock: pointer
    DxFlipOverlay: pointer
    DxFlipVideoPort: pointer
    DxGetPolarity: pointer
    DxGetCurrentAutoflip: pointer
    DxGetPreviousAutoflip: pointer
    DxTransfer: pointer
    DxGetTransferStatus: pointer
struct DXAPI_INTERFACE
{
    ushort Size;
    ushort Version;
    void* Context;
    void* InterfaceReference;
    void* InterfaceDereference;
    void* DxGetIrqInfo;
    void* DxEnableIrq;
    void* DxSkipNextField;
    void* DxBobNextField;
    void* DxSetState;
    void* DxLock;
    void* DxFlipOverlay;
    void* DxFlipVideoPort;
    void* DxGetPolarity;
    void* DxGetCurrentAutoflip;
    void* DxGetPreviousAutoflip;
    void* DxTransfer;
    void* DxGetTransferStatus;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DXAPI_INTERFACE サイズ: 68 バイト(x86)
dim st, 17    ; 4byte整数×17(構造体サイズ 68 / 4 切り上げ)
; Size : WORD (+0, 2byte)  wpoke st,0,値  /  値 = wpeek(st,0)
; Version : WORD (+2, 2byte)  wpoke st,2,値  /  値 = wpeek(st,2)
; Context : void* (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; InterfaceReference : void* (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; InterfaceDereference : void* (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; DxGetIrqInfo : PDX_GETIRQINFO (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; DxEnableIrq : PDX_ENABLEIRQ (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; DxSkipNextField : PDX_SKIPNEXTFIELD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; DxBobNextField : PDX_BOBNEXTFIELD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; DxSetState : PDX_SETSTATE (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; DxLock : PDX_LOCK (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; DxFlipOverlay : PDX_FLIPOVERLAY (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; DxFlipVideoPort : PDX_FLIPVIDEOPORT (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; DxGetPolarity : PDX_GETPOLARITY (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; DxGetCurrentAutoflip : PDX_GETCURRENTAUTOFLIP (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; DxGetPreviousAutoflip : PDX_GETPREVIOUSAUTOFLIP (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; DxTransfer : PDX_TRANSFER (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; DxGetTransferStatus : PDX_GETTRANSFERSTATUS (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXAPI_INTERFACE サイズ: 136 バイト(x64)
dim st, 34    ; 4byte整数×34(構造体サイズ 136 / 4 切り上げ)
; Size : WORD (+0, 2byte)  wpoke st,0,値  /  値 = wpeek(st,0)
; Version : WORD (+2, 2byte)  wpoke st,2,値  /  値 = wpeek(st,2)
; Context : void* (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; InterfaceReference : void* (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; InterfaceDereference : void* (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; DxGetIrqInfo : PDX_GETIRQINFO (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; DxEnableIrq : PDX_ENABLEIRQ (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; DxSkipNextField : PDX_SKIPNEXTFIELD (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; DxBobNextField : PDX_BOBNEXTFIELD (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; DxSetState : PDX_SETSTATE (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; DxLock : PDX_LOCK (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; DxFlipOverlay : PDX_FLIPOVERLAY (+80, 8byte)  qpoke st,80,値 / qpeek(st,80)  ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; DxFlipVideoPort : PDX_FLIPVIDEOPORT (+88, 8byte)  qpoke st,88,値 / qpeek(st,88)  ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; DxGetPolarity : PDX_GETPOLARITY (+96, 8byte)  qpoke st,96,値 / qpeek(st,96)  ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; DxGetCurrentAutoflip : PDX_GETCURRENTAUTOFLIP (+104, 8byte)  qpoke st,104,値 / qpeek(st,104)  ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; DxGetPreviousAutoflip : PDX_GETPREVIOUSAUTOFLIP (+112, 8byte)  qpoke st,112,値 / qpeek(st,112)  ※IronHSPのみ。3.7/3.8は lpoke st,112,下位 : lpoke st,116,上位
; DxTransfer : PDX_TRANSFER (+120, 8byte)  qpoke st,120,値 / qpeek(st,120)  ※IronHSPのみ。3.7/3.8は lpoke st,120,下位 : lpoke st,124,上位
; DxGetTransferStatus : PDX_GETTRANSFERSTATUS (+128, 8byte)  qpoke st,128,値 / qpeek(st,128)  ※IronHSPのみ。3.7/3.8は lpoke st,128,下位 : lpoke st,132,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DXAPI_INTERFACE
    #field short Size
    #field short Version
    #field intptr Context
    #field intptr InterfaceReference
    #field intptr InterfaceDereference
    #field intptr DxGetIrqInfo
    #field intptr DxEnableIrq
    #field intptr DxSkipNextField
    #field intptr DxBobNextField
    #field intptr DxSetState
    #field intptr DxLock
    #field intptr DxFlipOverlay
    #field intptr DxFlipVideoPort
    #field intptr DxGetPolarity
    #field intptr DxGetCurrentAutoflip
    #field intptr DxGetPreviousAutoflip
    #field intptr DxTransfer
    #field intptr DxGetTransferStatus
#endstruct

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