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

glTexCoord2s

関数
現在のテクスチャ座標を短整数の2成分で設定する。
DLLOPENGL32.dll呼出規約winapi

シグネチャ

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

void glTexCoord2s(
    SHORT s,
    SHORT t
);

パラメーター

名前方向
sSHORTin
tSHORTin

戻り値の型: void

各言語での呼び出し定義

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

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

glTexCoord2s = ctypes.windll.opengl32.glTexCoord2s
glTexCoord2s.restype = None
glTexCoord2s.argtypes = [
    ctypes.c_short,  # s : SHORT
    ctypes.c_short,  # t : SHORT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglTexCoord2s = opengl32.NewProc("glTexCoord2s")
)

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