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

gluNurbsSurface

関数
ノットと制御点からNURBS曲面を定義する。
DLLGLU32.dll呼出規約winapi

シグネチャ

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

void gluNurbsSurface(
    GLUnurbs* nobj,
    INT sknot_count,
    FLOAT* sknot,
    INT tknot_count,
    FLOAT* tknot,
    INT s_stride,
    INT t_stride,
    FLOAT* ctlarray,
    INT sorder,
    INT torder,
    DWORD type
);

パラメーター

名前方向説明
nobjGLUnurbs*inout対象のNURBSレンダラオブジェクトへのポインタ。
sknot_countINTins方向のノット数。
sknotFLOAT*inouts方向のノット値配列へのポインタ。
tknot_countINTint方向のノット数。
tknotFLOAT*inoutt方向のノット値配列へのポインタ。
s_strideINTins方向に進む際の制御点間FLOAT要素数。
t_strideINTint方向に進む際の制御点間FLOAT要素数。
ctlarrayFLOAT*inout制御点座標を格納したFLOAT配列へのポインタ。
sorderINTins方向の曲面オーダー(次数+1)。
torderINTint方向の曲面オーダー(次数+1)。
typeDWORDin曲面データの種類。GLU_MAP2_VERTEX_3など。

戻り値の型: void

各言語での呼び出し定義

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

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

gluNurbsSurface = ctypes.windll.glu32.gluNurbsSurface
gluNurbsSurface.restype = None
gluNurbsSurface.argtypes = [
    ctypes.c_void_p,  # nobj : GLUnurbs* in/out
    ctypes.c_int,  # sknot_count : INT
    ctypes.POINTER(ctypes.c_float),  # sknot : FLOAT* in/out
    ctypes.c_int,  # tknot_count : INT
    ctypes.POINTER(ctypes.c_float),  # tknot : FLOAT* in/out
    ctypes.c_int,  # s_stride : INT
    ctypes.c_int,  # t_stride : INT
    ctypes.POINTER(ctypes.c_float),  # ctlarray : FLOAT* in/out
    ctypes.c_int,  # sorder : INT
    ctypes.c_int,  # torder : INT
    wintypes.DWORD,  # type : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	glu32 = windows.NewLazySystemDLL("GLU32.dll")
	procgluNurbsSurface = glu32.NewProc("gluNurbsSurface")
)

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

extern "glu32" fn gluNurbsSurface(
    nobj: [*c]isize, // GLUnurbs* in/out
    sknot_count: i32, // INT
    sknot: [*c]f32, // FLOAT* in/out
    tknot_count: i32, // INT
    tknot: [*c]f32, // FLOAT* in/out
    s_stride: i32, // INT
    t_stride: i32, // INT
    ctlarray: [*c]f32, // FLOAT* in/out
    sorder: i32, // INT
    torder: i32, // INT
    type: u32 // DWORD
) callconv(std.os.windows.WINAPI) void;
proc gluNurbsSurface(
    nobj: ptr int,  # GLUnurbs* in/out
    sknot_count: int32,  # INT
    sknot: ptr float32,  # FLOAT* in/out
    tknot_count: int32,  # INT
    tknot: ptr float32,  # FLOAT* in/out
    s_stride: int32,  # INT
    t_stride: int32,  # INT
    ctlarray: ptr float32,  # FLOAT* in/out
    sorder: int32,  # INT
    torder: int32,  # INT
    `type`: uint32  # DWORD
) {.importc: "gluNurbsSurface", stdcall, dynlib: "GLU32.dll".}
pragma(lib, "glu32");
extern(Windows)
void gluNurbsSurface(
    ptrdiff_t* nobj,   // GLUnurbs* in/out
    int sknot_count,   // INT
    float* sknot,   // FLOAT* in/out
    int tknot_count,   // INT
    float* tknot,   // FLOAT* in/out
    int s_stride,   // INT
    int t_stride,   // INT
    float* ctlarray,   // FLOAT* in/out
    int sorder,   // INT
    int torder,   // INT
    uint type   // DWORD
);
ccall((:gluNurbsSurface, "GLU32.dll"), stdcall, Cvoid,
      (Ptr{Int}, Int32, Ptr{Float32}, Int32, Ptr{Float32}, Int32, Int32, Ptr{Float32}, Int32, Int32, UInt32),
      nobj, sknot_count, sknot, tknot_count, tknot, s_stride, t_stride, ctlarray, sorder, torder, type)
# nobj : GLUnurbs* in/out -> Ptr{Int}
# sknot_count : INT -> Int32
# sknot : FLOAT* in/out -> Ptr{Float32}
# tknot_count : INT -> Int32
# tknot : FLOAT* in/out -> Ptr{Float32}
# s_stride : INT -> Int32
# t_stride : INT -> Int32
# ctlarray : FLOAT* in/out -> Ptr{Float32}
# sorder : INT -> Int32
# torder : INT -> Int32
# type : DWORD -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
void gluNurbsSurface(
    intptr_t* nobj,
    int32_t sknot_count,
    float* sknot,
    int32_t tknot_count,
    float* tknot,
    int32_t s_stride,
    int32_t t_stride,
    float* ctlarray,
    int32_t sorder,
    int32_t torder,
    uint32_t type);
]]
local glu32 = ffi.load("glu32")
-- glu32.gluNurbsSurface(nobj, sknot_count, sknot, tknot_count, tknot, s_stride, t_stride, ctlarray, sorder, torder, type)
-- nobj : GLUnurbs* in/out
-- sknot_count : INT
-- sknot : FLOAT* in/out
-- tknot_count : INT
-- tknot : FLOAT* in/out
-- s_stride : INT
-- t_stride : INT
-- ctlarray : FLOAT* in/out
-- sorder : INT
-- torder : INT
-- type : DWORD
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('GLU32.dll');
const gluNurbsSurface = lib.func('__stdcall', 'gluNurbsSurface', 'void', ['intptr_t *', 'int32_t', 'float *', 'int32_t', 'float *', 'int32_t', 'int32_t', 'float *', 'int32_t', 'int32_t', 'uint32_t']);
// gluNurbsSurface(nobj, sknot_count, sknot, tknot_count, tknot, s_stride, t_stride, ctlarray, sorder, torder, type)
// nobj : GLUnurbs* in/out -> 'intptr_t *'
// sknot_count : INT -> 'int32_t'
// sknot : FLOAT* in/out -> 'float *'
// tknot_count : INT -> 'int32_t'
// tknot : FLOAT* in/out -> 'float *'
// s_stride : INT -> 'int32_t'
// t_stride : INT -> 'int32_t'
// ctlarray : FLOAT* in/out -> 'float *'
// sorder : INT -> 'int32_t'
// torder : INT -> 'int32_t'
// type : DWORD -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("GLU32.dll", {
  gluNurbsSurface: { parameters: ["pointer", "i32", "pointer", "i32", "pointer", "i32", "i32", "pointer", "i32", "i32", "u32"], result: "void" },
});
// lib.symbols.gluNurbsSurface(nobj, sknot_count, sknot, tknot_count, tknot, s_stride, t_stride, ctlarray, sorder, torder, type)
// nobj : GLUnurbs* in/out -> "pointer"
// sknot_count : INT -> "i32"
// sknot : FLOAT* in/out -> "pointer"
// tknot_count : INT -> "i32"
// tknot : FLOAT* in/out -> "pointer"
// s_stride : INT -> "i32"
// t_stride : INT -> "i32"
// ctlarray : FLOAT* in/out -> "pointer"
// sorder : INT -> "i32"
// torder : INT -> "i32"
// type : DWORD -> "u32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
void gluNurbsSurface(
    intptr_t* nobj,
    int32_t sknot_count,
    float* sknot,
    int32_t tknot_count,
    float* tknot,
    int32_t s_stride,
    int32_t t_stride,
    float* ctlarray,
    int32_t sorder,
    int32_t torder,
    uint32_t type);
C, "GLU32.dll");
// $ffi->gluNurbsSurface(nobj, sknot_count, sknot, tknot_count, tknot, s_stride, t_stride, ctlarray, sorder, torder, type);
// nobj : GLUnurbs* in/out
// sknot_count : INT
// sknot : FLOAT* in/out
// tknot_count : INT
// tknot : FLOAT* in/out
// s_stride : INT
// t_stride : INT
// ctlarray : FLOAT* in/out
// sorder : INT
// torder : INT
// type : DWORD
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Glu32 extends StdCallLibrary {
    Glu32 INSTANCE = Native.load("glu32", Glu32.class);
    void gluNurbsSurface(
        LongByReference nobj,   // GLUnurbs* in/out
        int sknot_count,   // INT
        FloatByReference sknot,   // FLOAT* in/out
        int tknot_count,   // INT
        FloatByReference tknot,   // FLOAT* in/out
        int s_stride,   // INT
        int t_stride,   // INT
        FloatByReference ctlarray,   // FLOAT* in/out
        int sorder,   // INT
        int torder,   // INT
        int type   // DWORD
    );
}
@[Link("glu32")]
lib LibGLU32
  fun gluNurbsSurface = gluNurbsSurface(
    nobj : LibC::SSizeT*,   # GLUnurbs* in/out
    sknot_count : Int32,   # INT
    sknot : Float32*,   # FLOAT* in/out
    tknot_count : Int32,   # INT
    tknot : Float32*,   # FLOAT* in/out
    s_stride : Int32,   # INT
    t_stride : Int32,   # INT
    ctlarray : Float32*,   # FLOAT* in/out
    sorder : Int32,   # INT
    torder : Int32,   # INT
    type_ : UInt32   # DWORD
  ) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef gluNurbsSurfaceNative = Void Function(Pointer<IntPtr>, Int32, Pointer<Float>, Int32, Pointer<Float>, Int32, Int32, Pointer<Float>, Int32, Int32, Uint32);
typedef gluNurbsSurfaceDart = void Function(Pointer<IntPtr>, int, Pointer<Float>, int, Pointer<Float>, int, int, Pointer<Float>, int, int, int);
final gluNurbsSurface = DynamicLibrary.open('GLU32.dll')
    .lookupFunction<gluNurbsSurfaceNative, gluNurbsSurfaceDart>('gluNurbsSurface');
// nobj : GLUnurbs* in/out -> Pointer<IntPtr>
// sknot_count : INT -> Int32
// sknot : FLOAT* in/out -> Pointer<Float>
// tknot_count : INT -> Int32
// tknot : FLOAT* in/out -> Pointer<Float>
// s_stride : INT -> Int32
// t_stride : INT -> Int32
// ctlarray : FLOAT* in/out -> Pointer<Float>
// sorder : INT -> Int32
// torder : INT -> Int32
// type : DWORD -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
procedure gluNurbsSurface(
  nobj: Pointer;   // GLUnurbs* in/out
  sknot_count: Integer;   // INT
  sknot: Pointer;   // FLOAT* in/out
  tknot_count: Integer;   // INT
  tknot: Pointer;   // FLOAT* in/out
  s_stride: Integer;   // INT
  t_stride: Integer;   // INT
  ctlarray: Pointer;   // FLOAT* in/out
  sorder: Integer;   // INT
  torder: Integer;   // INT
  type: DWORD   // DWORD
); stdcall;
  external 'GLU32.dll' name 'gluNurbsSurface';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "gluNurbsSurface"
  c_gluNurbsSurface :: Ptr CIntPtr -> Int32 -> Ptr CFloat -> Int32 -> Ptr CFloat -> Int32 -> Int32 -> Ptr CFloat -> Int32 -> Int32 -> Word32 -> IO ()
-- nobj : GLUnurbs* in/out -> Ptr CIntPtr
-- sknot_count : INT -> Int32
-- sknot : FLOAT* in/out -> Ptr CFloat
-- tknot_count : INT -> Int32
-- tknot : FLOAT* in/out -> Ptr CFloat
-- s_stride : INT -> Int32
-- t_stride : INT -> Int32
-- ctlarray : FLOAT* in/out -> Ptr CFloat
-- sorder : INT -> Int32
-- torder : INT -> Int32
-- type : DWORD -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let glunurbssurface =
  foreign "gluNurbsSurface"
    ((ptr intptr_t) @-> int32_t @-> (ptr float) @-> int32_t @-> (ptr float) @-> int32_t @-> int32_t @-> (ptr float) @-> int32_t @-> int32_t @-> uint32_t @-> returning void)
(* nobj : GLUnurbs* in/out -> (ptr intptr_t) *)
(* sknot_count : INT -> int32_t *)
(* sknot : FLOAT* in/out -> (ptr float) *)
(* tknot_count : INT -> int32_t *)
(* tknot : FLOAT* in/out -> (ptr float) *)
(* s_stride : INT -> int32_t *)
(* t_stride : INT -> int32_t *)
(* ctlarray : FLOAT* in/out -> (ptr float) *)
(* sorder : INT -> int32_t *)
(* torder : INT -> int32_t *)
(* type : DWORD -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library glu32 (t "GLU32.dll"))
(cffi:use-foreign-library glu32)

(cffi:defcfun ("gluNurbsSurface" glu-nurbs-surface :convention :stdcall) :void
  (nobj :pointer)   ; GLUnurbs* in/out
  (sknot-count :int32)   ; INT
  (sknot :pointer)   ; FLOAT* in/out
  (tknot-count :int32)   ; INT
  (tknot :pointer)   ; FLOAT* in/out
  (s-stride :int32)   ; INT
  (t-stride :int32)   ; INT
  (ctlarray :pointer)   ; FLOAT* in/out
  (sorder :int32)   ; INT
  (torder :int32)   ; INT
  (type :uint32))   ; DWORD
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $gluNurbsSurface = Win32::API::More->new('GLU32',
    'void gluNurbsSurface(LPVOID nobj, int sknot_count, LPVOID sknot, int tknot_count, LPVOID tknot, int s_stride, int t_stride, LPVOID ctlarray, int sorder, int torder, DWORD type)');
# my $ret = $gluNurbsSurface->Call($nobj, $sknot_count, $sknot, $tknot_count, $tknot, $s_stride, $t_stride, $ctlarray, $sorder, $torder, $type);
# nobj : GLUnurbs* in/out -> LPVOID
# sknot_count : INT -> int
# sknot : FLOAT* in/out -> LPVOID
# tknot_count : INT -> int
# tknot : FLOAT* in/out -> LPVOID
# s_stride : INT -> int
# t_stride : INT -> int
# ctlarray : FLOAT* in/out -> LPVOID
# sorder : INT -> int
# torder : INT -> int
# type : DWORD -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。