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

glDrawArrays

関数
有効な頂点配列から連続するプリミティブを描画する。
DLLOPENGL32.dll呼出規約winapi

シグネチャ

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

void glDrawArrays(
    DWORD mode,
    INT first,
    INT count
);

パラメーター

名前方向
modeDWORDin
firstINTin
countINTin

戻り値の型: void

各言語での呼び出し定義

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

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

glDrawArrays = ctypes.windll.opengl32.glDrawArrays
glDrawArrays.restype = None
glDrawArrays.argtypes = [
    wintypes.DWORD,  # mode : DWORD
    ctypes.c_int,  # first : INT
    ctypes.c_int,  # count : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglDrawArrays = opengl32.NewProc("glDrawArrays")
)

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