ホーム › Graphics.OpenGL › glTexParameterf
glTexParameterf
関数テクスチャパラメータを単精度値で設定する。
シグネチャ
// OPENGL32.dll
#include <windows.h>
void glTexParameterf(
DWORD target,
DWORD pname,
FLOAT param2
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| target | DWORD | in |
| pname | DWORD | in |
| param2 | FLOAT | in |
戻り値の型: void
各言語での呼び出し定義
// OPENGL32.dll
#include <windows.h>
void glTexParameterf(
DWORD target,
DWORD pname,
FLOAT param2
);[DllImport("OPENGL32.dll", ExactSpelling = true)]
static extern void glTexParameterf(
uint target, // DWORD
uint pname, // DWORD
float param2 // FLOAT
);<DllImport("OPENGL32.dll", ExactSpelling:=True)>
Public Shared Sub glTexParameterf(
target As UInteger, ' DWORD
pname As UInteger, ' DWORD
param2 As Single ' FLOAT
)
End Sub' target : DWORD
' pname : DWORD
' param2 : FLOAT
Declare PtrSafe Sub glTexParameterf Lib "opengl32" ( _
ByVal target As Long, _
ByVal pname As Long, _
ByVal param2 As Single)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
glTexParameterf = ctypes.windll.opengl32.glTexParameterf
glTexParameterf.restype = None
glTexParameterf.argtypes = [
wintypes.DWORD, # target : DWORD
wintypes.DWORD, # pname : DWORD
ctypes.c_float, # param2 : FLOAT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('OPENGL32.dll')
glTexParameterf = Fiddle::Function.new(
lib['glTexParameterf'],
[
-Fiddle::TYPE_INT, # target : DWORD
-Fiddle::TYPE_INT, # pname : DWORD
Fiddle::TYPE_FLOAT, # param2 : FLOAT
],
Fiddle::TYPE_VOID)#[link(name = "opengl32")]
extern "system" {
fn glTexParameterf(
target: u32, // DWORD
pname: u32, // DWORD
param2: f32 // FLOAT
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("OPENGL32.dll")]
public static extern void glTexParameterf(uint target, uint pname, float param2);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OPENGL32_glTexParameterf' -Namespace Win32 -PassThru
# $api::glTexParameterf(target, pname, param2)#uselib "OPENGL32.dll"
#func global glTexParameterf "glTexParameterf" sptr, sptr, float
; glTexParameterf target, pname, param2
; target : DWORD -> "sptr"
; pname : DWORD -> "sptr"
; param2 : FLOAT -> "float"#uselib "OPENGL32.dll"
#func global glTexParameterf "glTexParameterf" int, int, float
; glTexParameterf target, pname, param2
; target : DWORD -> "int"
; pname : DWORD -> "int"
; param2 : FLOAT -> "float"; void glTexParameterf(DWORD target, DWORD pname, FLOAT param2)
#uselib "OPENGL32.dll"
#func global glTexParameterf "glTexParameterf" int, int, float
; glTexParameterf target, pname, param2
; target : DWORD -> "int"
; pname : DWORD -> "int"
; param2 : FLOAT -> "float"import (
"math"
"golang.org/x/sys/windows"
"unsafe"
)
var (
opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
procglTexParameterf = opengl32.NewProc("glTexParameterf")
)
// target (DWORD), pname (DWORD), param2 (FLOAT)
r1, _, err := procglTexParameterf.Call(
uintptr(target),
uintptr(pname),
uintptr(math.Float32bits(param2)),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // void
// 注意: float/double 引数は proc.Call では XMM レジスタに渡せません。
// windows.SyscallN(proc.Addr(), math.Float64bits(x), ...) もしくは cgo を使用してください。procedure glTexParameterf(
target: DWORD; // DWORD
pname: DWORD; // DWORD
param2: Single // FLOAT
); stdcall;
external 'OPENGL32.dll' name 'glTexParameterf';result := DllCall("OPENGL32\glTexParameterf"
, "UInt", target ; DWORD
, "UInt", pname ; DWORD
, "Float", param2 ; FLOAT
, "Int") ; return: void●glTexParameterf(target, pname, param2) = DLL("OPENGL32.dll", "int glTexParameterf(dword, dword, float)")
# 呼び出し: glTexParameterf(target, pname, param2)
# target : DWORD -> "dword"
# pname : DWORD -> "dword"
# param2 : FLOAT -> "float"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。