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