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

glGetMapfv

関数
エバリュエータマップの単精度パラメータを取得する。
DLLOPENGL32.dll呼出規約winapi

シグネチャ

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

void glGetMapfv(
    DWORD target,
    DWORD query,
    FLOAT* v
);

パラメーター

名前方向
targetDWORDin
queryDWORDin
vFLOAT*inout

戻り値の型: void

各言語での呼び出し定義

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

void glGetMapfv(
    DWORD target,
    DWORD query,
    FLOAT* v
);
[DllImport("OPENGL32.dll", ExactSpelling = true)]
static extern void glGetMapfv(
    uint target,   // DWORD
    uint query,   // DWORD
    ref float v   // FLOAT* in/out
);
<DllImport("OPENGL32.dll", ExactSpelling:=True)>
Public Shared Sub glGetMapfv(
    target As UInteger,   ' DWORD
    query As UInteger,   ' DWORD
    ByRef v As Single   ' FLOAT* in/out
)
End Sub
' target : DWORD
' query : DWORD
' v : FLOAT* in/out
Declare PtrSafe Sub glGetMapfv Lib "opengl32" ( _
    ByVal target As Long, _
    ByVal query As Long, _
    ByRef v As Single)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

glGetMapfv = ctypes.windll.opengl32.glGetMapfv
glGetMapfv.restype = None
glGetMapfv.argtypes = [
    wintypes.DWORD,  # target : DWORD
    wintypes.DWORD,  # query : DWORD
    ctypes.POINTER(ctypes.c_float),  # v : FLOAT* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('OPENGL32.dll')
glGetMapfv = Fiddle::Function.new(
  lib['glGetMapfv'],
  [
    -Fiddle::TYPE_INT,  # target : DWORD
    -Fiddle::TYPE_INT,  # query : DWORD
    Fiddle::TYPE_VOIDP,  # v : FLOAT* in/out
  ],
  Fiddle::TYPE_VOID)
#[link(name = "opengl32")]
extern "system" {
    fn glGetMapfv(
        target: u32,  // DWORD
        query: u32,  // DWORD
        v: *mut f32  // FLOAT* in/out
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("OPENGL32.dll")]
public static extern void glGetMapfv(uint target, uint query, ref float v);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OPENGL32_glGetMapfv' -Namespace Win32 -PassThru
# $api::glGetMapfv(target, query, v)
#uselib "OPENGL32.dll"
#func global glGetMapfv "glGetMapfv" sptr, sptr, sptr
; glGetMapfv target, query, varptr(v)
; target : DWORD -> "sptr"
; query : DWORD -> "sptr"
; v : FLOAT* in/out -> "sptr"
出力引数:
#uselib "OPENGL32.dll"
#func global glGetMapfv "glGetMapfv" int, int, var
; glGetMapfv target, query, v
; target : DWORD -> "int"
; query : DWORD -> "int"
; v : FLOAT* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void glGetMapfv(DWORD target, DWORD query, FLOAT* v)
#uselib "OPENGL32.dll"
#func global glGetMapfv "glGetMapfv" int, int, var
; glGetMapfv target, query, v
; target : DWORD -> "int"
; query : DWORD -> "int"
; v : FLOAT* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglGetMapfv = opengl32.NewProc("glGetMapfv")
)

// target (DWORD), query (DWORD), v (FLOAT* in/out)
r1, _, err := procglGetMapfv.Call(
	uintptr(target),
	uintptr(query),
	uintptr(v),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure glGetMapfv(
  target: DWORD;   // DWORD
  query: DWORD;   // DWORD
  v: Pointer   // FLOAT* in/out
); stdcall;
  external 'OPENGL32.dll' name 'glGetMapfv';
result := DllCall("OPENGL32\glGetMapfv"
    , "UInt", target   ; DWORD
    , "UInt", query   ; DWORD
    , "Ptr", v   ; FLOAT* in/out
    , "Int")   ; return: void
●glGetMapfv(target, query, v) = DLL("OPENGL32.dll", "int glGetMapfv(dword, dword, void*)")
# 呼び出し: glGetMapfv(target, query, v)
# target : DWORD -> "dword"
# query : DWORD -> "dword"
# v : FLOAT* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。