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