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

D3DPERF_QueryRepeatFrame

関数
プロファイラが現在のフレームの再描画を要求しているか問い合わせる。
DLLd3d9.dll呼出規約winapi

シグネチャ

// d3d9.dll
#include <windows.h>

BOOL D3DPERF_QueryRepeatFrame(void);

パラメーターなし。戻り値: BOOL

各言語での呼び出し定義

// d3d9.dll
#include <windows.h>

BOOL D3DPERF_QueryRepeatFrame(void);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("d3d9.dll", ExactSpelling = true)]
static extern bool D3DPERF_QueryRepeatFrame();
<DllImport("d3d9.dll", ExactSpelling:=True)>
Public Shared Function D3DPERF_QueryRepeatFrame() As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
Declare PtrSafe Function D3DPERF_QueryRepeatFrame Lib "d3d9" () As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

D3DPERF_QueryRepeatFrame = ctypes.windll.d3d9.D3DPERF_QueryRepeatFrame
D3DPERF_QueryRepeatFrame.restype = wintypes.BOOL
D3DPERF_QueryRepeatFrame.argtypes = []
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('d3d9.dll')
D3DPERF_QueryRepeatFrame = Fiddle::Function.new(
  lib['D3DPERF_QueryRepeatFrame'],
  [],
  Fiddle::TYPE_INT)
#[link(name = "d3d9")]
extern "system" {
    fn D3DPERF_QueryRepeatFrame() -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("d3d9.dll")]
public static extern bool D3DPERF_QueryRepeatFrame();
"@
$api = Add-Type -MemberDefinition $sig -Name 'd3d9_D3DPERF_QueryRepeatFrame' -Namespace Win32 -PassThru
# $api::D3DPERF_QueryRepeatFrame()
#uselib "d3d9.dll"
#func global D3DPERF_QueryRepeatFrame "D3DPERF_QueryRepeatFrame"
; D3DPERF_QueryRepeatFrame   ; 戻り値は stat
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "d3d9.dll"
#cfunc global D3DPERF_QueryRepeatFrame "D3DPERF_QueryRepeatFrame"
; res = D3DPERF_QueryRepeatFrame()
; BOOL D3DPERF_QueryRepeatFrame()
#uselib "d3d9.dll"
#cfunc global D3DPERF_QueryRepeatFrame "D3DPERF_QueryRepeatFrame"
; res = D3DPERF_QueryRepeatFrame()
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	d3d9 = windows.NewLazySystemDLL("d3d9.dll")
	procD3DPERF_QueryRepeatFrame = d3d9.NewProc("D3DPERF_QueryRepeatFrame")
)

r1, _, err := procD3DPERF_QueryRepeatFrame.Call()
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function D3DPERF_QueryRepeatFrame: BOOL; stdcall;
  external 'd3d9.dll' name 'D3DPERF_QueryRepeatFrame';
result := DllCall("d3d9\D3DPERF_QueryRepeatFrame", "Int")
●D3DPERF_QueryRepeatFrame() = DLL("d3d9.dll", "bool D3DPERF_QueryRepeatFrame()")
# 呼び出し: D3DPERF_QueryRepeatFrame()
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "d3d9" fn D3DPERF_QueryRepeatFrame() callconv(std.os.windows.WINAPI) i32;
proc D3DPERF_QueryRepeatFrame(): int32 {.importc: "D3DPERF_QueryRepeatFrame", stdcall, dynlib: "d3d9.dll".}
pragma(lib, "d3d9");
extern(Windows)
int D3DPERF_QueryRepeatFrame();
ccall((:D3DPERF_QueryRepeatFrame, "d3d9.dll"), stdcall, Int32,
      (),
      )
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t D3DPERF_QueryRepeatFrame(void);
]]
local d3d9 = ffi.load("d3d9")
-- d3d9.D3DPERF_QueryRepeatFrame()
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('d3d9.dll');
const D3DPERF_QueryRepeatFrame = lib.func('__stdcall', 'D3DPERF_QueryRepeatFrame', 'int32_t', []);
// D3DPERF_QueryRepeatFrame()
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("d3d9.dll", {
  D3DPERF_QueryRepeatFrame: { parameters: [], result: "i32" },
});
// lib.symbols.D3DPERF_QueryRepeatFrame()
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t D3DPERF_QueryRepeatFrame(void);
C, "d3d9.dll");
// $ffi->D3DPERF_QueryRepeatFrame();
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface D3d9 extends StdCallLibrary {
    D3d9 INSTANCE = Native.load("d3d9", D3d9.class);
    boolean D3DPERF_QueryRepeatFrame();
}
@[Link("d3d9")]
lib Libd3d9
  fun D3DPERF_QueryRepeatFrame = D3DPERF_QueryRepeatFrame() : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef D3DPERF_QueryRepeatFrameNative = Int32 Function();
typedef D3DPERF_QueryRepeatFrameDart = int Function();
final D3DPERF_QueryRepeatFrame = DynamicLibrary.open('d3d9.dll')
    .lookupFunction<D3DPERF_QueryRepeatFrameNative, D3DPERF_QueryRepeatFrameDart>('D3DPERF_QueryRepeatFrame');
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function D3DPERF_QueryRepeatFrame: BOOL; stdcall;
  external 'd3d9.dll' name 'D3DPERF_QueryRepeatFrame';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "D3DPERF_QueryRepeatFrame"
  c_D3DPERF_QueryRepeatFrame :: IO CInt
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let d3dperf_queryrepeatframe =
  foreign "D3DPERF_QueryRepeatFrame"
    (void @-> returning int32_t)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library d3d9 (t "d3d9.dll"))
(cffi:use-foreign-library d3d9)

(cffi:defcfun ("D3DPERF_QueryRepeatFrame" d3-dperf-query-repeat-frame :convention :stdcall) :int32)
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $D3DPERF_QueryRepeatFrame = Win32::API::More->new('d3d9',
    'BOOL D3DPERF_QueryRepeatFrame()');
# my $ret = $D3DPERF_QueryRepeatFrame->Call();
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。