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

glIndexiv

関数
現在のカラーインデックスを整数配列で設定する。
DLLOPENGL32.dll呼出規約winapi

シグネチャ

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

void glIndexiv(
    const INT* c
);

パラメーター

名前方向
cINT*in

戻り値の型: void

各言語での呼び出し定義

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

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

glIndexiv = ctypes.windll.opengl32.glIndexiv
glIndexiv.restype = None
glIndexiv.argtypes = [
    ctypes.POINTER(ctypes.c_int),  # c : INT*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('OPENGL32.dll')
glIndexiv = Fiddle::Function.new(
  lib['glIndexiv'],
  [
    Fiddle::TYPE_VOIDP,  # c : INT*
  ],
  Fiddle::TYPE_VOID)
#[link(name = "opengl32")]
extern "system" {
    fn glIndexiv(
        c: *const i32  // INT*
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("OPENGL32.dll")]
public static extern void glIndexiv(ref int c);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OPENGL32_glIndexiv' -Namespace Win32 -PassThru
# $api::glIndexiv(c)
#uselib "OPENGL32.dll"
#func global glIndexiv "glIndexiv" sptr
; glIndexiv varptr(c)
; c : INT* -> "sptr"
出力引数:
#uselib "OPENGL32.dll"
#func global glIndexiv "glIndexiv" var
; glIndexiv c
; c : INT* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void glIndexiv(INT* c)
#uselib "OPENGL32.dll"
#func global glIndexiv "glIndexiv" var
; glIndexiv c
; c : INT* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglIndexiv = opengl32.NewProc("glIndexiv")
)

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