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

glIndexPointer

関数
カラーインデックス頂点配列の配置を指定する。
DLLOPENGL32.dll呼出規約winapi

シグネチャ

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

void glIndexPointer(
    DWORD type,
    INT stride,
    const void* pointer
);

パラメーター

名前方向
typeDWORDin
strideINTin
pointervoid*in

戻り値の型: void

各言語での呼び出し定義

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

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

glIndexPointer = ctypes.windll.opengl32.glIndexPointer
glIndexPointer.restype = None
glIndexPointer.argtypes = [
    wintypes.DWORD,  # type : DWORD
    ctypes.c_int,  # stride : INT
    ctypes.POINTER(None),  # pointer : void*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglIndexPointer = opengl32.NewProc("glIndexPointer")
)

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