ホーム › Graphics.OpenGL › gluBuild1DMipmaps
gluBuild1DMipmaps
関数1次元テクスチャのミップマップ群を生成する。
シグネチャ
// GLU32.dll
#include <windows.h>
INT gluBuild1DMipmaps(
DWORD target,
INT components,
INT width,
DWORD format,
DWORD type,
const void* data
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| target | DWORD | in |
| components | INT | in |
| width | INT | in |
| format | DWORD | in |
| type | DWORD | in |
| data | void* | in |
戻り値の型: INT
各言語での呼び出し定義
// GLU32.dll
#include <windows.h>
INT gluBuild1DMipmaps(
DWORD target,
INT components,
INT width,
DWORD format,
DWORD type,
const void* data
);[DllImport("GLU32.dll", ExactSpelling = true)]
static extern int gluBuild1DMipmaps(
uint target, // DWORD
int components, // INT
int width, // INT
uint format, // DWORD
uint type, // DWORD
IntPtr data // void*
);<DllImport("GLU32.dll", ExactSpelling:=True)>
Public Shared Function gluBuild1DMipmaps(
target As UInteger, ' DWORD
components As Integer, ' INT
width As Integer, ' INT
format As UInteger, ' DWORD
type As UInteger, ' DWORD
data As IntPtr ' void*
) As Integer
End Function' target : DWORD
' components : INT
' width : INT
' format : DWORD
' type : DWORD
' data : void*
Declare PtrSafe Function gluBuild1DMipmaps Lib "glu32" ( _
ByVal target As Long, _
ByVal components As Long, _
ByVal width As Long, _
ByVal format As Long, _
ByVal type As Long, _
ByVal data As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
gluBuild1DMipmaps = ctypes.windll.glu32.gluBuild1DMipmaps
gluBuild1DMipmaps.restype = ctypes.c_int
gluBuild1DMipmaps.argtypes = [
wintypes.DWORD, # target : DWORD
ctypes.c_int, # components : INT
ctypes.c_int, # width : INT
wintypes.DWORD, # format : DWORD
wintypes.DWORD, # type : DWORD
ctypes.POINTER(None), # data : void*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('GLU32.dll')
gluBuild1DMipmaps = Fiddle::Function.new(
lib['gluBuild1DMipmaps'],
[
-Fiddle::TYPE_INT, # target : DWORD
Fiddle::TYPE_INT, # components : INT
Fiddle::TYPE_INT, # width : INT
-Fiddle::TYPE_INT, # format : DWORD
-Fiddle::TYPE_INT, # type : DWORD
Fiddle::TYPE_VOIDP, # data : void*
],
Fiddle::TYPE_INT)#[link(name = "glu32")]
extern "system" {
fn gluBuild1DMipmaps(
target: u32, // DWORD
components: i32, // INT
width: i32, // INT
format: u32, // DWORD
type: u32, // DWORD
data: *const () // void*
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("GLU32.dll")]
public static extern int gluBuild1DMipmaps(uint target, int components, int width, uint format, uint type, IntPtr data);
"@
$api = Add-Type -MemberDefinition $sig -Name 'GLU32_gluBuild1DMipmaps' -Namespace Win32 -PassThru
# $api::gluBuild1DMipmaps(target, components, width, format, type, data)#uselib "GLU32.dll"
#func global gluBuild1DMipmaps "gluBuild1DMipmaps" sptr, sptr, sptr, sptr, sptr, sptr
; gluBuild1DMipmaps target, components, width, format, type, data ; 戻り値は stat
; target : DWORD -> "sptr"
; components : INT -> "sptr"
; width : INT -> "sptr"
; format : DWORD -> "sptr"
; type : DWORD -> "sptr"
; data : void* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "GLU32.dll"
#cfunc global gluBuild1DMipmaps "gluBuild1DMipmaps" int, int, int, int, int, sptr
; res = gluBuild1DMipmaps(target, components, width, format, type, data)
; target : DWORD -> "int"
; components : INT -> "int"
; width : INT -> "int"
; format : DWORD -> "int"
; type : DWORD -> "int"
; data : void* -> "sptr"; INT gluBuild1DMipmaps(DWORD target, INT components, INT width, DWORD format, DWORD type, void* data)
#uselib "GLU32.dll"
#cfunc global gluBuild1DMipmaps "gluBuild1DMipmaps" int, int, int, int, int, intptr
; res = gluBuild1DMipmaps(target, components, width, format, type, data)
; target : DWORD -> "int"
; components : INT -> "int"
; width : INT -> "int"
; format : DWORD -> "int"
; type : DWORD -> "int"
; data : void* -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
glu32 = windows.NewLazySystemDLL("GLU32.dll")
procgluBuild1DMipmaps = glu32.NewProc("gluBuild1DMipmaps")
)
// target (DWORD), components (INT), width (INT), format (DWORD), type (DWORD), data (void*)
r1, _, err := procgluBuild1DMipmaps.Call(
uintptr(target),
uintptr(components),
uintptr(width),
uintptr(format),
uintptr(type),
uintptr(data),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction gluBuild1DMipmaps(
target: DWORD; // DWORD
components: Integer; // INT
width: Integer; // INT
format: DWORD; // DWORD
type: DWORD; // DWORD
data: Pointer // void*
): Integer; stdcall;
external 'GLU32.dll' name 'gluBuild1DMipmaps';result := DllCall("GLU32\gluBuild1DMipmaps"
, "UInt", target ; DWORD
, "Int", components ; INT
, "Int", width ; INT
, "UInt", format ; DWORD
, "UInt", type ; DWORD
, "Ptr", data ; void*
, "Int") ; return: INT●gluBuild1DMipmaps(target, components, width, format, type, data) = DLL("GLU32.dll", "int gluBuild1DMipmaps(dword, int, int, dword, dword, void*)")
# 呼び出し: gluBuild1DMipmaps(target, components, width, format, type, data)
# target : DWORD -> "dword"
# components : INT -> "int"
# width : INT -> "int"
# format : DWORD -> "dword"
# type : DWORD -> "dword"
# data : void* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。