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

DXGI_OUTDUPL_FRAME_INFO

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

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

フィールド

フィールドサイズx64x86説明
LastPresentTimeLONGLONG8+0+0直近にデスクトップが更新された時刻(QPC値)。
LastMouseUpdateTimeLONGLONG8+8+8直近にマウスが更新された時刻(QPC値)。
AccumulatedFramesDWORD4+16+16前回取得以降に蓄積されたフレーム数。
RectsCoalescedBOOL4+20+20ダーティ矩形が結合されたかを示すブール値。
ProtectedContentMaskedOutBOOL4+24+24保護コンテンツがマスクされたかを示すブール値。
PointerPositionDXGI_OUTDUPL_POINTER_POSITION12+28+28マウスポインターの位置情報を表すDXGI_OUTDUPL_POINTER_POSITION。
TotalMetadataBufferSizeDWORD4+40+40ムーブ矩形とダーティ矩形のメタデータ合計バイト数。
PointerShapeBufferSizeDWORD4+44+44ポインター形状データのバイト数。

各言語での定義

#include <windows.h>

// POINT  (x64 8 / x86 8 バイト)
typedef struct POINT {
    INT x;
    INT y;
} POINT;

// DXGI_OUTDUPL_POINTER_POSITION  (x64 12 / x86 12 バイト)
typedef struct DXGI_OUTDUPL_POINTER_POSITION {
    POINT Position;
    BOOL Visible;
} DXGI_OUTDUPL_POINTER_POSITION;

// DXGI_OUTDUPL_FRAME_INFO  (x64 48 / x86 48 バイト)
typedef struct DXGI_OUTDUPL_FRAME_INFO {
    LONGLONG LastPresentTime;
    LONGLONG LastMouseUpdateTime;
    DWORD AccumulatedFrames;
    BOOL RectsCoalesced;
    BOOL ProtectedContentMaskedOut;
    DXGI_OUTDUPL_POINTER_POSITION PointerPosition;
    DWORD TotalMetadataBufferSize;
    DWORD PointerShapeBufferSize;
} DXGI_OUTDUPL_FRAME_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POINT
{
    public int x;
    public int y;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXGI_OUTDUPL_POINTER_POSITION
{
    public POINT Position;
    [MarshalAs(UnmanagedType.Bool)] public bool Visible;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXGI_OUTDUPL_FRAME_INFO
{
    public long LastPresentTime;
    public long LastMouseUpdateTime;
    public uint AccumulatedFrames;
    [MarshalAs(UnmanagedType.Bool)] public bool RectsCoalesced;
    [MarshalAs(UnmanagedType.Bool)] public bool ProtectedContentMaskedOut;
    public DXGI_OUTDUPL_POINTER_POSITION PointerPosition;
    public uint TotalMetadataBufferSize;
    public uint PointerShapeBufferSize;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POINT
    Public x As Integer
    Public y As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXGI_OUTDUPL_POINTER_POSITION
    Public Position As POINT
    <MarshalAs(UnmanagedType.Bool)> Public Visible As Boolean
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXGI_OUTDUPL_FRAME_INFO
    Public LastPresentTime As Long
    Public LastMouseUpdateTime As Long
    Public AccumulatedFrames As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public RectsCoalesced As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public ProtectedContentMaskedOut As Boolean
    Public PointerPosition As DXGI_OUTDUPL_POINTER_POSITION
    Public TotalMetadataBufferSize As UInteger
    Public PointerShapeBufferSize As UInteger
End Structure
import ctypes
from ctypes import wintypes

class POINT(ctypes.Structure):
    _fields_ = [
        ("x", ctypes.c_int),
        ("y", ctypes.c_int),
    ]

class DXGI_OUTDUPL_POINTER_POSITION(ctypes.Structure):
    _fields_ = [
        ("Position", POINT),
        ("Visible", wintypes.BOOL),
    ]

class DXGI_OUTDUPL_FRAME_INFO(ctypes.Structure):
    _fields_ = [
        ("LastPresentTime", ctypes.c_longlong),
        ("LastMouseUpdateTime", ctypes.c_longlong),
        ("AccumulatedFrames", wintypes.DWORD),
        ("RectsCoalesced", wintypes.BOOL),
        ("ProtectedContentMaskedOut", wintypes.BOOL),
        ("PointerPosition", DXGI_OUTDUPL_POINTER_POSITION),
        ("TotalMetadataBufferSize", wintypes.DWORD),
        ("PointerShapeBufferSize", wintypes.DWORD),
    ]
#[repr(C)]
pub struct POINT {
    pub x: i32,
    pub y: i32,
}

#[repr(C)]
pub struct DXGI_OUTDUPL_POINTER_POSITION {
    pub Position: POINT,
    pub Visible: i32,
}

#[repr(C)]
pub struct DXGI_OUTDUPL_FRAME_INFO {
    pub LastPresentTime: i64,
    pub LastMouseUpdateTime: i64,
    pub AccumulatedFrames: u32,
    pub RectsCoalesced: i32,
    pub ProtectedContentMaskedOut: i32,
    pub PointerPosition: DXGI_OUTDUPL_POINTER_POSITION,
    pub TotalMetadataBufferSize: u32,
    pub PointerShapeBufferSize: u32,
}
import "golang.org/x/sys/windows"

type POINT struct {
	x int32
	y int32
}

type DXGI_OUTDUPL_POINTER_POSITION struct {
	Position POINT
	Visible int32
}

type DXGI_OUTDUPL_FRAME_INFO struct {
	LastPresentTime int64
	LastMouseUpdateTime int64
	AccumulatedFrames uint32
	RectsCoalesced int32
	ProtectedContentMaskedOut int32
	PointerPosition DXGI_OUTDUPL_POINTER_POSITION
	TotalMetadataBufferSize uint32
	PointerShapeBufferSize uint32
}
type
  POINT = record
    x: Integer;
    y: Integer;
  end;

  DXGI_OUTDUPL_POINTER_POSITION = record
    Position: POINT;
    Visible: BOOL;
  end;

  DXGI_OUTDUPL_FRAME_INFO = record
    LastPresentTime: Int64;
    LastMouseUpdateTime: Int64;
    AccumulatedFrames: DWORD;
    RectsCoalesced: BOOL;
    ProtectedContentMaskedOut: BOOL;
    PointerPosition: DXGI_OUTDUPL_POINTER_POSITION;
    TotalMetadataBufferSize: DWORD;
    PointerShapeBufferSize: DWORD;
  end;
const POINT = extern struct {
    x: i32,
    y: i32,
};

const DXGI_OUTDUPL_POINTER_POSITION = extern struct {
    Position: POINT,
    Visible: i32,
};

const DXGI_OUTDUPL_FRAME_INFO = extern struct {
    LastPresentTime: i64,
    LastMouseUpdateTime: i64,
    AccumulatedFrames: u32,
    RectsCoalesced: i32,
    ProtectedContentMaskedOut: i32,
    PointerPosition: DXGI_OUTDUPL_POINTER_POSITION,
    TotalMetadataBufferSize: u32,
    PointerShapeBufferSize: u32,
};
type
  POINT {.bycopy.} = object
    x: int32
    y: int32

  DXGI_OUTDUPL_POINTER_POSITION {.bycopy.} = object
    Position: POINT
    Visible: int32

  DXGI_OUTDUPL_FRAME_INFO {.bycopy.} = object
    LastPresentTime: int64
    LastMouseUpdateTime: int64
    AccumulatedFrames: uint32
    RectsCoalesced: int32
    ProtectedContentMaskedOut: int32
    PointerPosition: DXGI_OUTDUPL_POINTER_POSITION
    TotalMetadataBufferSize: uint32
    PointerShapeBufferSize: uint32
struct POINT
{
    int x;
    int y;
}

struct DXGI_OUTDUPL_POINTER_POSITION
{
    POINT Position;
    int Visible;
}

struct DXGI_OUTDUPL_FRAME_INFO
{
    long LastPresentTime;
    long LastMouseUpdateTime;
    uint AccumulatedFrames;
    int RectsCoalesced;
    int ProtectedContentMaskedOut;
    DXGI_OUTDUPL_POINTER_POSITION PointerPosition;
    uint TotalMetadataBufferSize;
    uint PointerShapeBufferSize;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXGI_OUTDUPL_FRAME_INFO サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; LastPresentTime : LONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; LastMouseUpdateTime : LONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; AccumulatedFrames : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; RectsCoalesced : BOOL (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ProtectedContentMaskedOut : BOOL (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; PointerPosition : DXGI_OUTDUPL_POINTER_POSITION (+28, 12byte)  varptr(st)+28 を基点に操作(12byte:入れ子/配列)
; TotalMetadataBufferSize : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; PointerShapeBufferSize : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global POINT
    #field int x
    #field int y
#endstruct

#defstruct global DXGI_OUTDUPL_POINTER_POSITION
    #field POINT Position
    #field bool Visible
#endstruct

#defstruct global DXGI_OUTDUPL_FRAME_INFO
    #field int64 LastPresentTime
    #field int64 LastMouseUpdateTime
    #field int AccumulatedFrames
    #field bool RectsCoalesced
    #field bool ProtectedContentMaskedOut
    #field DXGI_OUTDUPL_POINTER_POSITION PointerPosition
    #field int TotalMetadataBufferSize
    #field int PointerShapeBufferSize
#endstruct

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