Win32 API 日本語リファレンス
ホームGraphics.OpenGL › glVertex2s

glVertex2s

関数
頂点を短整数の2次元座標で指定する。
DLLOPENGL32.dll呼出規約winapi

シグネチャ

// OPENGL32.dll
#include <windows.h>

void glVertex2s(
    SHORT x,
    SHORT y
);

パラメーター

名前方向
xSHORTin
ySHORTin

戻り値の型: void

各言語での呼び出し定義

// OPENGL32.dll
#include <windows.h>

void glVertex2s(
    SHORT x,
    SHORT y
);
[DllImport("OPENGL32.dll", ExactSpelling = true)]
static extern void glVertex2s(
    short x,   // SHORT
    short y   // SHORT
);
<DllImport("OPENGL32.dll", ExactSpelling:=True)>
Public Shared Sub glVertex2s(
    x As Short,   ' SHORT
    y As Short   ' SHORT
)
End Sub
' x : SHORT
' y : SHORT
Declare PtrSafe Sub glVertex2s Lib "opengl32" ( _
    ByVal x As Integer, _
    ByVal y As Integer)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

glVertex2s = ctypes.windll.opengl32.glVertex2s
glVertex2s.restype = None
glVertex2s.argtypes = [
    ctypes.c_short,  # x : SHORT
    ctypes.c_short,  # y : SHORT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('OPENGL32.dll')
glVertex2s = Fiddle::Function.new(
  lib['glVertex2s'],
  [
    Fiddle::TYPE_SHORT,  # x : SHORT
    Fiddle::TYPE_SHORT,  # y : SHORT
  ],
  Fiddle::TYPE_VOID)
#[link(name = "opengl32")]
extern "system" {
    fn glVertex2s(
        x: i16,  // SHORT
        y: i16  // SHORT
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("OPENGL32.dll")]
public static extern void glVertex2s(short x, short y);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OPENGL32_glVertex2s' -Namespace Win32 -PassThru
# $api::glVertex2s(x, y)
#uselib "OPENGL32.dll"
#func global glVertex2s "glVertex2s" sptr, sptr
; glVertex2s x, y
; x : SHORT -> "sptr"
; y : SHORT -> "sptr"
#uselib "OPENGL32.dll"
#func global glVertex2s "glVertex2s" int, int
; glVertex2s x, y
; x : SHORT -> "int"
; y : SHORT -> "int"
; void glVertex2s(SHORT x, SHORT y)
#uselib "OPENGL32.dll"
#func global glVertex2s "glVertex2s" int, int
; glVertex2s x, y
; x : SHORT -> "int"
; y : SHORT -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglVertex2s = opengl32.NewProc("glVertex2s")
)

// x (SHORT), y (SHORT)
r1, _, err := procglVertex2s.Call(
	uintptr(x),
	uintptr(y),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure glVertex2s(
  x: Smallint;   // SHORT
  y: Smallint   // SHORT
); stdcall;
  external 'OPENGL32.dll' name 'glVertex2s';
result := DllCall("OPENGL32\glVertex2s"
    , "Short", x   ; SHORT
    , "Short", y   ; SHORT
    , "Int")   ; return: void
●glVertex2s(x, y) = DLL("OPENGL32.dll", "int glVertex2s(int, int)")
# 呼び出し: glVertex2s(x, y)
# x : SHORT -> "int"
# y : SHORT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。