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

glBindTexture

関数
名前付きテクスチャをターゲットにバインドする。
DLLOPENGL32.dll呼出規約winapi

シグネチャ

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

void glBindTexture(
    DWORD target,
    DWORD texture
);

パラメーター

名前方向
targetDWORDin
textureDWORDin

戻り値の型: void

各言語での呼び出し定義

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

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

glBindTexture = ctypes.windll.opengl32.glBindTexture
glBindTexture.restype = None
glBindTexture.argtypes = [
    wintypes.DWORD,  # target : DWORD
    wintypes.DWORD,  # texture : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglBindTexture = opengl32.NewProc("glBindTexture")
)

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