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