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