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

D3D10GetPixelShaderProfile

関数
デバイスがサポートする最高のピクセルシェーダープロファイルを取得する。
DLLd3d10.dll呼出規約winapi

シグネチャ

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

LPSTR D3D10GetPixelShaderProfile(
    ID3D10Device* pDevice
);

パラメーター

名前方向説明
pDeviceID3D10Device*in対応プロファイルを問い合わせる対象のID3D10Device。

戻り値の型: LPSTR

各言語での呼び出し定義

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

LPSTR D3D10GetPixelShaderProfile(
    ID3D10Device* pDevice
);
[DllImport("d3d10.dll", ExactSpelling = true)]
static extern IntPtr D3D10GetPixelShaderProfile(
    IntPtr pDevice   // ID3D10Device*
);
<DllImport("d3d10.dll", ExactSpelling:=True)>
Public Shared Function D3D10GetPixelShaderProfile(
    pDevice As IntPtr   ' ID3D10Device*
) As IntPtr
End Function
' pDevice : ID3D10Device*
Declare PtrSafe Function D3D10GetPixelShaderProfile Lib "d3d10" ( _
    ByVal pDevice As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

D3D10GetPixelShaderProfile = ctypes.windll.d3d10.D3D10GetPixelShaderProfile
D3D10GetPixelShaderProfile.restype = wintypes.LPSTR
D3D10GetPixelShaderProfile.argtypes = [
    ctypes.c_void_p,  # pDevice : ID3D10Device*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('d3d10.dll')
D3D10GetPixelShaderProfile = Fiddle::Function.new(
  lib['D3D10GetPixelShaderProfile'],
  [
    Fiddle::TYPE_VOIDP,  # pDevice : ID3D10Device*
  ],
  Fiddle::TYPE_VOIDP)
#[link(name = "d3d10")]
extern "system" {
    fn D3D10GetPixelShaderProfile(
        pDevice: *mut core::ffi::c_void  // ID3D10Device*
    ) -> *mut u8;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("d3d10.dll")]
public static extern IntPtr D3D10GetPixelShaderProfile(IntPtr pDevice);
"@
$api = Add-Type -MemberDefinition $sig -Name 'd3d10_D3D10GetPixelShaderProfile' -Namespace Win32 -PassThru
# $api::D3D10GetPixelShaderProfile(pDevice)
#uselib "d3d10.dll"
#func global D3D10GetPixelShaderProfile "D3D10GetPixelShaderProfile" sptr
; D3D10GetPixelShaderProfile pDevice   ; 戻り値は stat
; pDevice : ID3D10Device* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "d3d10.dll"
#cfunc global D3D10GetPixelShaderProfile "D3D10GetPixelShaderProfile" sptr
; res = D3D10GetPixelShaderProfile(pDevice)
; pDevice : ID3D10Device* -> "sptr"
; LPSTR D3D10GetPixelShaderProfile(ID3D10Device* pDevice)
#uselib "d3d10.dll"
#cfunc global D3D10GetPixelShaderProfile "D3D10GetPixelShaderProfile" intptr
; res = D3D10GetPixelShaderProfile(pDevice)
; pDevice : ID3D10Device* -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	d3d10 = windows.NewLazySystemDLL("d3d10.dll")
	procD3D10GetPixelShaderProfile = d3d10.NewProc("D3D10GetPixelShaderProfile")
)

// pDevice (ID3D10Device*)
r1, _, err := procD3D10GetPixelShaderProfile.Call(
	uintptr(pDevice),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // LPSTR
function D3D10GetPixelShaderProfile(
  pDevice: Pointer   // ID3D10Device*
): PAnsiChar; stdcall;
  external 'd3d10.dll' name 'D3D10GetPixelShaderProfile';
result := DllCall("d3d10\D3D10GetPixelShaderProfile"
    , "Ptr", pDevice   ; ID3D10Device*
    , "Ptr")   ; return: LPSTR
●D3D10GetPixelShaderProfile(pDevice) = DLL("d3d10.dll", "char* D3D10GetPixelShaderProfile(void*)")
# 呼び出し: D3D10GetPixelShaderProfile(pDevice)
# pDevice : ID3D10Device* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "d3d10" fn D3D10GetPixelShaderProfile(
    pDevice: ?*anyopaque // ID3D10Device*
) callconv(std.os.windows.WINAPI) [*c]const u8;
proc D3D10GetPixelShaderProfile(
    pDevice: pointer  # ID3D10Device*
): cstring {.importc: "D3D10GetPixelShaderProfile", stdcall, dynlib: "d3d10.dll".}
pragma(lib, "d3d10");
extern(Windows)
const(char)* D3D10GetPixelShaderProfile(
    void* pDevice   // ID3D10Device*
);
ccall((:D3D10GetPixelShaderProfile, "d3d10.dll"), stdcall, Cstring,
      (Ptr{Cvoid},),
      pDevice)
# pDevice : ID3D10Device* -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
const char* D3D10GetPixelShaderProfile(
    void* pDevice);
]]
local d3d10 = ffi.load("d3d10")
-- d3d10.D3D10GetPixelShaderProfile(pDevice)
-- pDevice : ID3D10Device*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('d3d10.dll');
const D3D10GetPixelShaderProfile = lib.func('__stdcall', 'D3D10GetPixelShaderProfile', 'void *', ['void *']);
// D3D10GetPixelShaderProfile(pDevice)
// pDevice : ID3D10Device* -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("d3d10.dll", {
  D3D10GetPixelShaderProfile: { parameters: ["pointer"], result: "pointer" },
});
// lib.symbols.D3D10GetPixelShaderProfile(pDevice)
// pDevice : ID3D10Device* -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
const char* D3D10GetPixelShaderProfile(
    void* pDevice);
C, "d3d10.dll");
// $ffi->D3D10GetPixelShaderProfile(pDevice);
// pDevice : ID3D10Device*
// 構造体/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 D3d10 extends StdCallLibrary {
    D3d10 INSTANCE = Native.load("d3d10", D3d10.class);
    Pointer D3D10GetPixelShaderProfile(
        Pointer pDevice   // ID3D10Device*
    );
}
@[Link("d3d10")]
lib Libd3d10
  fun D3D10GetPixelShaderProfile = D3D10GetPixelShaderProfile(
    pDevice : Void*   # ID3D10Device*
  ) : UInt8*
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef D3D10GetPixelShaderProfileNative = Pointer<Utf8> Function(Pointer<Void>);
typedef D3D10GetPixelShaderProfileDart = Pointer<Utf8> Function(Pointer<Void>);
final D3D10GetPixelShaderProfile = DynamicLibrary.open('d3d10.dll')
    .lookupFunction<D3D10GetPixelShaderProfileNative, D3D10GetPixelShaderProfileDart>('D3D10GetPixelShaderProfile');
// pDevice : ID3D10Device* -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function D3D10GetPixelShaderProfile(
  pDevice: Pointer   // ID3D10Device*
): PAnsiChar; stdcall;
  external 'd3d10.dll' name 'D3D10GetPixelShaderProfile';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "D3D10GetPixelShaderProfile"
  c_D3D10GetPixelShaderProfile :: Ptr () -> IO CString
-- pDevice : ID3D10Device* -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let d3d10getpixelshaderprofile =
  foreign "D3D10GetPixelShaderProfile"
    ((ptr void) @-> returning string)
(* pDevice : ID3D10Device* -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library d3d10 (t "d3d10.dll"))
(cffi:use-foreign-library d3d10)

(cffi:defcfun ("D3D10GetPixelShaderProfile" d3-d10-get-pixel-shader-profile :convention :stdcall) :string
  (p-device :pointer))   ; ID3D10Device*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $D3D10GetPixelShaderProfile = Win32::API::More->new('d3d10',
    'LPSTR D3D10GetPixelShaderProfile(LPVOID pDevice)');
# my $ret = $D3D10GetPixelShaderProfile->Call($pDevice);
# pDevice : ID3D10Device* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型