ホーム › Graphics.DirectDraw › DD_GETVPORTLINEDATA
DD_GETVPORTLINEDATA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| lpDD | DD_DIRECTDRAW_LOCAL* | 8/4 | +0 | +0 | 対象のDirectDrawローカルオブジェクトへのポインタ。 |
| lpVideoPort | DD_VIDEOPORT_LOCAL* | 8/4 | +8 | +4 | 対象のビデオポートローカルオブジェクトへのポインタ。 |
| dwLine | DWORD | 4 | +16 | +8 | 現在処理中の走査線番号を返す。 |
| ddRVal | HRESULT | 4 | +20 | +12 | 操作の結果を示すHRESULT。成功時はDD_OK。 |
| GetVideoPortLine | void* | 8/4 | +24 | +16 | ビデオポート走査線取得処理を行うコールバック関数へのポインタ。 |
各言語での定義
#include <windows.h>
// DD_GETVPORTLINEDATA (x64 32 / x86 20 バイト)
typedef struct DD_GETVPORTLINEDATA {
DD_DIRECTDRAW_LOCAL* lpDD;
DD_VIDEOPORT_LOCAL* lpVideoPort;
DWORD dwLine;
HRESULT ddRVal;
void* GetVideoPortLine;
} DD_GETVPORTLINEDATA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DD_GETVPORTLINEDATA
{
public IntPtr lpDD;
public IntPtr lpVideoPort;
public uint dwLine;
public int ddRVal;
public IntPtr GetVideoPortLine;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DD_GETVPORTLINEDATA
Public lpDD As IntPtr
Public lpVideoPort As IntPtr
Public dwLine As UInteger
Public ddRVal As Integer
Public GetVideoPortLine As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class DD_GETVPORTLINEDATA(ctypes.Structure):
_fields_ = [
("lpDD", ctypes.c_void_p),
("lpVideoPort", ctypes.c_void_p),
("dwLine", wintypes.DWORD),
("ddRVal", ctypes.c_int),
("GetVideoPortLine", ctypes.c_void_p),
]#[repr(C)]
pub struct DD_GETVPORTLINEDATA {
pub lpDD: *mut core::ffi::c_void,
pub lpVideoPort: *mut core::ffi::c_void,
pub dwLine: u32,
pub ddRVal: i32,
pub GetVideoPortLine: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type DD_GETVPORTLINEDATA struct {
lpDD uintptr
lpVideoPort uintptr
dwLine uint32
ddRVal int32
GetVideoPortLine uintptr
}type
DD_GETVPORTLINEDATA = record
lpDD: Pointer;
lpVideoPort: Pointer;
dwLine: DWORD;
ddRVal: Integer;
GetVideoPortLine: Pointer;
end;const DD_GETVPORTLINEDATA = extern struct {
lpDD: ?*anyopaque,
lpVideoPort: ?*anyopaque,
dwLine: u32,
ddRVal: i32,
GetVideoPortLine: ?*anyopaque,
};type
DD_GETVPORTLINEDATA {.bycopy.} = object
lpDD: pointer
lpVideoPort: pointer
dwLine: uint32
ddRVal: int32
GetVideoPortLine: pointerstruct DD_GETVPORTLINEDATA
{
void* lpDD;
void* lpVideoPort;
uint dwLine;
int ddRVal;
void* GetVideoPortLine;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DD_GETVPORTLINEDATA サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; lpDD : DD_DIRECTDRAW_LOCAL* (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; lpVideoPort : DD_VIDEOPORT_LOCAL* (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; dwLine : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ddRVal : HRESULT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; GetVideoPortLine : void* (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DD_GETVPORTLINEDATA サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; lpDD : DD_DIRECTDRAW_LOCAL* (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; lpVideoPort : DD_VIDEOPORT_LOCAL* (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; dwLine : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ddRVal : HRESULT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; GetVideoPortLine : void* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DD_GETVPORTLINEDATA
#field intptr lpDD
#field intptr lpVideoPort
#field int dwLine
#field int ddRVal
#field intptr GetVideoPortLine
#endstruct
stdim st, DD_GETVPORTLINEDATA ; NSTRUCT 変数を確保
st->dwLine = 100
mes "dwLine=" + st->dwLine