ホーム › Graphics.OpenGL › glMap1f
glMap1f
関数1次元エバリュエータの単精度制御点を定義する。
シグネチャ
// OPENGL32.dll
#include <windows.h>
void glMap1f(
DWORD target,
FLOAT u1,
FLOAT u2,
INT stride,
INT order,
const FLOAT* points
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| target | DWORD | in |
| u1 | FLOAT | in |
| u2 | FLOAT | in |
| stride | INT | in |
| order | INT | in |
| points | FLOAT* | in |
戻り値の型: void
各言語での呼び出し定義
// OPENGL32.dll
#include <windows.h>
void glMap1f(
DWORD target,
FLOAT u1,
FLOAT u2,
INT stride,
INT order,
const FLOAT* points
);[DllImport("OPENGL32.dll", ExactSpelling = true)]
static extern void glMap1f(
uint target, // DWORD
float u1, // FLOAT
float u2, // FLOAT
int stride, // INT
int order, // INT
ref float points // FLOAT*
);<DllImport("OPENGL32.dll", ExactSpelling:=True)>
Public Shared Sub glMap1f(
target As UInteger, ' DWORD
u1 As Single, ' FLOAT
u2 As Single, ' FLOAT
stride As Integer, ' INT
order As Integer, ' INT
ByRef points As Single ' FLOAT*
)
End Sub' target : DWORD
' u1 : FLOAT
' u2 : FLOAT
' stride : INT
' order : INT
' points : FLOAT*
Declare PtrSafe Sub glMap1f Lib "opengl32" ( _
ByVal target As Long, _
ByVal u1 As Single, _
ByVal u2 As Single, _
ByVal stride As Long, _
ByVal order As Long, _
ByRef points As Single)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
glMap1f = ctypes.windll.opengl32.glMap1f
glMap1f.restype = None
glMap1f.argtypes = [
wintypes.DWORD, # target : DWORD
ctypes.c_float, # u1 : FLOAT
ctypes.c_float, # u2 : FLOAT
ctypes.c_int, # stride : INT
ctypes.c_int, # order : INT
ctypes.POINTER(ctypes.c_float), # points : FLOAT*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('OPENGL32.dll')
glMap1f = Fiddle::Function.new(
lib['glMap1f'],
[
-Fiddle::TYPE_INT, # target : DWORD
Fiddle::TYPE_FLOAT, # u1 : FLOAT
Fiddle::TYPE_FLOAT, # u2 : FLOAT
Fiddle::TYPE_INT, # stride : INT
Fiddle::TYPE_INT, # order : INT
Fiddle::TYPE_VOIDP, # points : FLOAT*
],
Fiddle::TYPE_VOID)#[link(name = "opengl32")]
extern "system" {
fn glMap1f(
target: u32, // DWORD
u1: f32, // FLOAT
u2: f32, // FLOAT
stride: i32, // INT
order: i32, // INT
points: *const f32 // FLOAT*
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("OPENGL32.dll")]
public static extern void glMap1f(uint target, float u1, float u2, int stride, int order, ref float points);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OPENGL32_glMap1f' -Namespace Win32 -PassThru
# $api::glMap1f(target, u1, u2, stride, order, points)#uselib "OPENGL32.dll"
#func global glMap1f "glMap1f" sptr, float, float, sptr, sptr, sptr
; glMap1f target, u1, u2, stride, order, varptr(points)
; target : DWORD -> "sptr"
; u1 : FLOAT -> "float"
; u2 : FLOAT -> "float"
; stride : INT -> "sptr"
; order : INT -> "sptr"
; points : FLOAT* -> "sptr"出力引数:
#uselib "OPENGL32.dll" #func global glMap1f "glMap1f" int, float, float, int, int, var ; glMap1f target, u1, u2, stride, order, points ; target : DWORD -> "int" ; u1 : FLOAT -> "float" ; u2 : FLOAT -> "float" ; stride : INT -> "int" ; order : INT -> "int" ; points : FLOAT* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "OPENGL32.dll" #func global glMap1f "glMap1f" int, float, float, int, int, sptr ; glMap1f target, u1, u2, stride, order, varptr(points) ; target : DWORD -> "int" ; u1 : FLOAT -> "float" ; u2 : FLOAT -> "float" ; stride : INT -> "int" ; order : INT -> "int" ; points : FLOAT* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void glMap1f(DWORD target, FLOAT u1, FLOAT u2, INT stride, INT order, FLOAT* points) #uselib "OPENGL32.dll" #func global glMap1f "glMap1f" int, float, float, int, int, var ; glMap1f target, u1, u2, stride, order, points ; target : DWORD -> "int" ; u1 : FLOAT -> "float" ; u2 : FLOAT -> "float" ; stride : INT -> "int" ; order : INT -> "int" ; points : FLOAT* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void glMap1f(DWORD target, FLOAT u1, FLOAT u2, INT stride, INT order, FLOAT* points) #uselib "OPENGL32.dll" #func global glMap1f "glMap1f" int, float, float, int, int, intptr ; glMap1f target, u1, u2, stride, order, varptr(points) ; target : DWORD -> "int" ; u1 : FLOAT -> "float" ; u2 : FLOAT -> "float" ; stride : INT -> "int" ; order : INT -> "int" ; points : FLOAT* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"math"
"golang.org/x/sys/windows"
"unsafe"
)
var (
opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
procglMap1f = opengl32.NewProc("glMap1f")
)
// target (DWORD), u1 (FLOAT), u2 (FLOAT), stride (INT), order (INT), points (FLOAT*)
r1, _, err := procglMap1f.Call(
uintptr(target),
uintptr(math.Float32bits(u1)),
uintptr(math.Float32bits(u2)),
uintptr(stride),
uintptr(order),
uintptr(points),
)
_ = 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 glMap1f(
target: DWORD; // DWORD
u1: Single; // FLOAT
u2: Single; // FLOAT
stride: Integer; // INT
order: Integer; // INT
points: Pointer // FLOAT*
); stdcall;
external 'OPENGL32.dll' name 'glMap1f';result := DllCall("OPENGL32\glMap1f"
, "UInt", target ; DWORD
, "Float", u1 ; FLOAT
, "Float", u2 ; FLOAT
, "Int", stride ; INT
, "Int", order ; INT
, "Ptr", points ; FLOAT*
, "Int") ; return: void●glMap1f(target, u1, u2, stride, order, points) = DLL("OPENGL32.dll", "int glMap1f(dword, float, float, int, int, void*)")
# 呼び出し: glMap1f(target, u1, u2, stride, order, points)
# target : DWORD -> "dword"
# u1 : FLOAT -> "float"
# u2 : FLOAT -> "float"
# stride : INT -> "int"
# order : INT -> "int"
# points : FLOAT* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。