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

DXGI_FRAME_STATISTICS_MEDIA

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

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

フィールド

フィールドサイズx64x86説明
PresentCountDWORD4+0+0

コンピューターの起動以降に、イメージがモニターに表示された累計回数を表す値です。

メモ イメージがモニターに表示された回数は、必ずしも IDXGISwapChain::Present または IDXGISwapChain1::Present1 を呼び出した回数と同じとは限りません。
PresentRefreshCountDWORD4+4+4最後のイメージがモニターに表示された時点までに、コンピューターの起動以降 (ウィンドウ モードの場合はスワップ チェーンの作成以降) に発生した v-blank の累計数を表す値です。
SyncRefreshCountDWORD4+8+8スケジューラーが QueryPerformanceCounter を呼び出してマシン時間を最後にサンプリングした時点までに、コンピューターの起動以降 (ウィンドウ モードの場合はスワップ チェーンの作成以降) に発生した v-blank の累計数を表す値です。
SyncQPCTimeLONGLONG8+16+16高分解能パフォーマンス カウンター タイマーを表す値です。 この値は、QueryPerformanceCounter 関数が返す値と同じです。
SyncGPUTimeLONGLONG8+24+24予約済みです。常に 0 を返します。
CompositionModeDXGI_FRAME_PRESENTATION_MODE4+32+32コンポジションの表示モードを示す値です。この値は、アプリがデコード スワップ チェーンを引き続き使用すべきかどうかを判断するために使用します。DXGI_FRAME_PRESENTATION_MODE を参照してください。
ApprovedPresentDurationDWORD4+36+36

アプリのカスタム表示時間の要求がシステムに承認された場合、このフィールドには承認されたカスタム表示時間が設定されます。

アプリのカスタム表示時間の要求が承認されなかった場合、このフィールドには 0 が設定されます。

公式ドキュメント

アプリのカスタム表示時間 (カスタム リフレッシュ レート) に対するシステムの承認を確認するために使用します。承認はフレームごとに継続的に確認する必要があります。

解説(Remarks)

この構造体は GetFrameStatisticsMedia メソッドで使用します。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// DXGI_FRAME_STATISTICS_MEDIA  (x64 40 / x86 40 バイト)
typedef struct DXGI_FRAME_STATISTICS_MEDIA {
    DWORD PresentCount;
    DWORD PresentRefreshCount;
    DWORD SyncRefreshCount;
    LONGLONG SyncQPCTime;
    LONGLONG SyncGPUTime;
    DXGI_FRAME_PRESENTATION_MODE CompositionMode;
    DWORD ApprovedPresentDuration;
} DXGI_FRAME_STATISTICS_MEDIA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXGI_FRAME_STATISTICS_MEDIA
{
    public uint PresentCount;
    public uint PresentRefreshCount;
    public uint SyncRefreshCount;
    public long SyncQPCTime;
    public long SyncGPUTime;
    public int CompositionMode;
    public uint ApprovedPresentDuration;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXGI_FRAME_STATISTICS_MEDIA
    Public PresentCount As UInteger
    Public PresentRefreshCount As UInteger
    Public SyncRefreshCount As UInteger
    Public SyncQPCTime As Long
    Public SyncGPUTime As Long
    Public CompositionMode As Integer
    Public ApprovedPresentDuration As UInteger
End Structure
import ctypes
from ctypes import wintypes

class DXGI_FRAME_STATISTICS_MEDIA(ctypes.Structure):
    _fields_ = [
        ("PresentCount", wintypes.DWORD),
        ("PresentRefreshCount", wintypes.DWORD),
        ("SyncRefreshCount", wintypes.DWORD),
        ("SyncQPCTime", ctypes.c_longlong),
        ("SyncGPUTime", ctypes.c_longlong),
        ("CompositionMode", ctypes.c_int),
        ("ApprovedPresentDuration", wintypes.DWORD),
    ]
#[repr(C)]
pub struct DXGI_FRAME_STATISTICS_MEDIA {
    pub PresentCount: u32,
    pub PresentRefreshCount: u32,
    pub SyncRefreshCount: u32,
    pub SyncQPCTime: i64,
    pub SyncGPUTime: i64,
    pub CompositionMode: i32,
    pub ApprovedPresentDuration: u32,
}
import "golang.org/x/sys/windows"

type DXGI_FRAME_STATISTICS_MEDIA struct {
	PresentCount uint32
	PresentRefreshCount uint32
	SyncRefreshCount uint32
	SyncQPCTime int64
	SyncGPUTime int64
	CompositionMode int32
	ApprovedPresentDuration uint32
}
type
  DXGI_FRAME_STATISTICS_MEDIA = record
    PresentCount: DWORD;
    PresentRefreshCount: DWORD;
    SyncRefreshCount: DWORD;
    SyncQPCTime: Int64;
    SyncGPUTime: Int64;
    CompositionMode: Integer;
    ApprovedPresentDuration: DWORD;
  end;
const DXGI_FRAME_STATISTICS_MEDIA = extern struct {
    PresentCount: u32,
    PresentRefreshCount: u32,
    SyncRefreshCount: u32,
    SyncQPCTime: i64,
    SyncGPUTime: i64,
    CompositionMode: i32,
    ApprovedPresentDuration: u32,
};
type
  DXGI_FRAME_STATISTICS_MEDIA {.bycopy.} = object
    PresentCount: uint32
    PresentRefreshCount: uint32
    SyncRefreshCount: uint32
    SyncQPCTime: int64
    SyncGPUTime: int64
    CompositionMode: int32
    ApprovedPresentDuration: uint32
struct DXGI_FRAME_STATISTICS_MEDIA
{
    uint PresentCount;
    uint PresentRefreshCount;
    uint SyncRefreshCount;
    long SyncQPCTime;
    long SyncGPUTime;
    int CompositionMode;
    uint ApprovedPresentDuration;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXGI_FRAME_STATISTICS_MEDIA サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; PresentCount : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; PresentRefreshCount : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; SyncRefreshCount : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; SyncQPCTime : LONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; SyncGPUTime : LONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; CompositionMode : DXGI_FRAME_PRESENTATION_MODE (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ApprovedPresentDuration : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DXGI_FRAME_STATISTICS_MEDIA
    #field int PresentCount
    #field int PresentRefreshCount
    #field int SyncRefreshCount
    #field int64 SyncQPCTime
    #field int64 SyncGPUTime
    #field int CompositionMode
    #field int ApprovedPresentDuration
#endstruct

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