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

glIndexs

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

シグネチャ

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

void glIndexs(
    SHORT c
);

パラメーター

名前方向
cSHORTin

戻り値の型: void

各言語での呼び出し定義

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

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

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

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

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglIndexs = opengl32.NewProc("glIndexs")
)

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