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

glRasterPos2i

関数
ラスタ位置を整数の2次元座標で指定する。
DLLOPENGL32.dll呼出規約winapi

シグネチャ

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

void glRasterPos2i(
    INT x,
    INT y
);

パラメーター

名前方向
xINTin
yINTin

戻り値の型: void

各言語での呼び出し定義

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

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

glRasterPos2i = ctypes.windll.opengl32.glRasterPos2i
glRasterPos2i.restype = None
glRasterPos2i.argtypes = [
    ctypes.c_int,  # x : INT
    ctypes.c_int,  # y : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglRasterPos2i = opengl32.NewProc("glRasterPos2i")
)

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