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

gluPwlCurve

関数
トリミング用の折れ線(区分線形)曲線を定義する。
DLLGLU32.dll呼出規約winapi

シグネチャ

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

void gluPwlCurve(
    GLUnurbs* nobj,
    INT count,
    FLOAT* array,
    INT stride,
    DWORD type
);

パラメーター

名前方向
nobjGLUnurbs*inout
countINTin
arrayFLOAT*inout
strideINTin
typeDWORDin

戻り値の型: void

各言語での呼び出し定義

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

void gluPwlCurve(
    GLUnurbs* nobj,
    INT count,
    FLOAT* array,
    INT stride,
    DWORD type
);
[DllImport("GLU32.dll", ExactSpelling = true)]
static extern void gluPwlCurve(
    ref IntPtr nobj,   // GLUnurbs* in/out
    int count,   // INT
    ref float array,   // FLOAT* in/out
    int stride,   // INT
    uint type   // DWORD
);
<DllImport("GLU32.dll", ExactSpelling:=True)>
Public Shared Sub gluPwlCurve(
    ByRef nobj As IntPtr,   ' GLUnurbs* in/out
    count As Integer,   ' INT
    ByRef array As Single,   ' FLOAT* in/out
    stride As Integer,   ' INT
    type As UInteger   ' DWORD
)
End Sub
' nobj : GLUnurbs* in/out
' count : INT
' array : FLOAT* in/out
' stride : INT
' type : DWORD
Declare PtrSafe Sub gluPwlCurve Lib "glu32" ( _
    ByRef nobj As LongPtr, _
    ByVal count As Long, _
    ByRef array As Single, _
    ByVal stride As Long, _
    ByVal type As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

gluPwlCurve = ctypes.windll.glu32.gluPwlCurve
gluPwlCurve.restype = None
gluPwlCurve.argtypes = [
    ctypes.c_void_p,  # nobj : GLUnurbs* in/out
    ctypes.c_int,  # count : INT
    ctypes.POINTER(ctypes.c_float),  # array : FLOAT* in/out
    ctypes.c_int,  # stride : INT
    wintypes.DWORD,  # type : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	glu32 = windows.NewLazySystemDLL("GLU32.dll")
	procgluPwlCurve = glu32.NewProc("gluPwlCurve")
)

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