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
sknot_countINTin
sknotFLOAT*inout
tknot_countINTin
tknotFLOAT*inout
s_strideINTin
t_strideINTin
ctlarrayFLOAT*inout
sorderINTin
torderINTin
typeDWORDin

戻り値の型: 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 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" int, 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 -> "int"
; 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" int, 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 -> "int"
; 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)。