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

glTexCoord2i

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

シグネチャ

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

void glTexCoord2i(
    INT s,
    INT t
);

パラメーター

名前方向説明
sINTinテクスチャ座標のs成分。整数で指定する。
tINTinテクスチャ座標のt成分。整数で指定する。

戻り値の型: void

各言語での呼び出し定義

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

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

glTexCoord2i = ctypes.windll.opengl32.glTexCoord2i
glTexCoord2i.restype = None
glTexCoord2i.argtypes = [
    ctypes.c_int,  # s : INT
    ctypes.c_int,  # t : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglTexCoord2i = opengl32.NewProc("glTexCoord2i")
)

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

extern "opengl32" fn glTexCoord2i(
    s: i32, // INT
    t: i32 // INT
) callconv(std.os.windows.WINAPI) void;
proc glTexCoord2i(
    s: int32,  # INT
    t: int32  # INT
) {.importc: "glTexCoord2i", stdcall, dynlib: "OPENGL32.dll".}
pragma(lib, "opengl32");
extern(Windows)
void glTexCoord2i(
    int s,   // INT
    int t   // INT
);
ccall((:glTexCoord2i, "OPENGL32.dll"), stdcall, Cvoid,
      (Int32, Int32),
      s, t)
# s : INT -> Int32
# t : INT -> Int32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
void glTexCoord2i(
    int32_t s,
    int32_t t);
]]
local opengl32 = ffi.load("opengl32")
-- opengl32.glTexCoord2i(s, t)
-- s : INT
-- t : INT
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('OPENGL32.dll');
const glTexCoord2i = lib.func('__stdcall', 'glTexCoord2i', 'void', ['int32_t', 'int32_t']);
// glTexCoord2i(s, t)
// s : INT -> 'int32_t'
// t : INT -> 'int32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("OPENGL32.dll", {
  glTexCoord2i: { parameters: ["i32", "i32"], result: "void" },
});
// lib.symbols.glTexCoord2i(s, t)
// s : INT -> "i32"
// t : INT -> "i32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
void glTexCoord2i(
    int32_t s,
    int32_t t);
C, "OPENGL32.dll");
// $ffi->glTexCoord2i(s, t);
// s : INT
// t : INT
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Opengl32 extends StdCallLibrary {
    Opengl32 INSTANCE = Native.load("opengl32", Opengl32.class);
    void glTexCoord2i(
        int s,   // INT
        int t   // INT
    );
}
@[Link("opengl32")]
lib LibOPENGL32
  fun glTexCoord2i = glTexCoord2i(
    s : Int32,   # INT
    t : Int32   # INT
  ) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef glTexCoord2iNative = Void Function(Int32, Int32);
typedef glTexCoord2iDart = void Function(int, int);
final glTexCoord2i = DynamicLibrary.open('OPENGL32.dll')
    .lookupFunction<glTexCoord2iNative, glTexCoord2iDart>('glTexCoord2i');
// s : INT -> Int32
// t : INT -> Int32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
procedure glTexCoord2i(
  s: Integer;   // INT
  t: Integer   // INT
); stdcall;
  external 'OPENGL32.dll' name 'glTexCoord2i';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "glTexCoord2i"
  c_glTexCoord2i :: Int32 -> Int32 -> IO ()
-- s : INT -> Int32
-- t : INT -> Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let gltexcoord2i =
  foreign "glTexCoord2i"
    (int32_t @-> int32_t @-> returning void)
(* s : INT -> int32_t *)
(* t : INT -> int32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library opengl32 (t "OPENGL32.dll"))
(cffi:use-foreign-library opengl32)

(cffi:defcfun ("glTexCoord2i" gl-tex-coord2i :convention :stdcall) :void
  (s :int32)   ; INT
  (t :int32))   ; INT
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $glTexCoord2i = Win32::API::More->new('OPENGL32',
    'void glTexCoord2i(int s, int t)');
# my $ret = $glTexCoord2i->Call($s, $t);
# s : INT -> int
# t : INT -> int
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。