ホーム › Graphics.OpenGL › glNormal3d
glNormal3d
関数現在の法線ベクトルを倍精度の3成分で設定する。
シグネチャ
// OPENGL32.dll
#include <windows.h>
void glNormal3d(
DOUBLE nx,
DOUBLE ny,
DOUBLE nz
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| nx | DOUBLE | in |
| ny | DOUBLE | in |
| nz | DOUBLE | in |
戻り値の型: void
各言語での呼び出し定義
// OPENGL32.dll
#include <windows.h>
void glNormal3d(
DOUBLE nx,
DOUBLE ny,
DOUBLE nz
);[DllImport("OPENGL32.dll", ExactSpelling = true)]
static extern void glNormal3d(
double nx, // DOUBLE
double ny, // DOUBLE
double nz // DOUBLE
);<DllImport("OPENGL32.dll", ExactSpelling:=True)>
Public Shared Sub glNormal3d(
nx As Double, ' DOUBLE
ny As Double, ' DOUBLE
nz As Double ' DOUBLE
)
End Sub' nx : DOUBLE
' ny : DOUBLE
' nz : DOUBLE
Declare PtrSafe Sub glNormal3d Lib "opengl32" ( _
ByVal nx As Double, _
ByVal ny As Double, _
ByVal nz As Double)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
glNormal3d = ctypes.windll.opengl32.glNormal3d
glNormal3d.restype = None
glNormal3d.argtypes = [
ctypes.c_double, # nx : DOUBLE
ctypes.c_double, # ny : DOUBLE
ctypes.c_double, # nz : DOUBLE
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('OPENGL32.dll')
glNormal3d = Fiddle::Function.new(
lib['glNormal3d'],
[
Fiddle::TYPE_DOUBLE, # nx : DOUBLE
Fiddle::TYPE_DOUBLE, # ny : DOUBLE
Fiddle::TYPE_DOUBLE, # nz : DOUBLE
],
Fiddle::TYPE_VOID)#[link(name = "opengl32")]
extern "system" {
fn glNormal3d(
nx: f64, // DOUBLE
ny: f64, // DOUBLE
nz: f64 // DOUBLE
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("OPENGL32.dll")]
public static extern void glNormal3d(double nx, double ny, double nz);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OPENGL32_glNormal3d' -Namespace Win32 -PassThru
# $api::glNormal3d(nx, ny, nz)#uselib "OPENGL32.dll"
#func global glNormal3d "glNormal3d" double, double, double
; glNormal3d nx, ny, nz
; nx : DOUBLE -> "double"
; ny : DOUBLE -> "double"
; nz : DOUBLE -> "double"#uselib "OPENGL32.dll"
#func global glNormal3d "glNormal3d" double, double, double
; glNormal3d nx, ny, nz
; nx : DOUBLE -> "double"
; ny : DOUBLE -> "double"
; nz : DOUBLE -> "double"; void glNormal3d(DOUBLE nx, DOUBLE ny, DOUBLE nz)
#uselib "OPENGL32.dll"
#func global glNormal3d "glNormal3d" double, double, double
; glNormal3d nx, ny, nz
; nx : DOUBLE -> "double"
; ny : DOUBLE -> "double"
; nz : DOUBLE -> "double"import (
"math"
"golang.org/x/sys/windows"
"unsafe"
)
var (
opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
procglNormal3d = opengl32.NewProc("glNormal3d")
)
// nx (DOUBLE), ny (DOUBLE), nz (DOUBLE)
r1, _, err := procglNormal3d.Call(
uintptr(math.Float64bits(nx)),
uintptr(math.Float64bits(ny)),
uintptr(math.Float64bits(nz)),
)
_ = 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 glNormal3d(
nx: Double; // DOUBLE
ny: Double; // DOUBLE
nz: Double // DOUBLE
); stdcall;
external 'OPENGL32.dll' name 'glNormal3d';result := DllCall("OPENGL32\glNormal3d"
, "Double", nx ; DOUBLE
, "Double", ny ; DOUBLE
, "Double", nz ; DOUBLE
, "Int") ; return: void●glNormal3d(nx, ny, nz) = DLL("OPENGL32.dll", "int glNormal3d(double, double, double)")
# 呼び出し: glNormal3d(nx, ny, nz)
# nx : DOUBLE -> "double"
# ny : DOUBLE -> "double"
# nz : DOUBLE -> "double"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。