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