ホーム › Graphics.OpenGL › glColorMaterial
glColorMaterial
関数材質の色をどの色成分に追従させるかを指定する。
シグネチャ
// OPENGL32.dll
#include <windows.h>
void glColorMaterial(
DWORD face,
DWORD mode
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| face | DWORD | in |
| mode | DWORD | in |
戻り値の型: void
各言語での呼び出し定義
// OPENGL32.dll
#include <windows.h>
void glColorMaterial(
DWORD face,
DWORD mode
);[DllImport("OPENGL32.dll", ExactSpelling = true)]
static extern void glColorMaterial(
uint face, // DWORD
uint mode // DWORD
);<DllImport("OPENGL32.dll", ExactSpelling:=True)>
Public Shared Sub glColorMaterial(
face As UInteger, ' DWORD
mode As UInteger ' DWORD
)
End Sub' face : DWORD
' mode : DWORD
Declare PtrSafe Sub glColorMaterial Lib "opengl32" ( _
ByVal face As Long, _
ByVal mode As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
glColorMaterial = ctypes.windll.opengl32.glColorMaterial
glColorMaterial.restype = None
glColorMaterial.argtypes = [
wintypes.DWORD, # face : DWORD
wintypes.DWORD, # mode : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('OPENGL32.dll')
glColorMaterial = Fiddle::Function.new(
lib['glColorMaterial'],
[
-Fiddle::TYPE_INT, # face : DWORD
-Fiddle::TYPE_INT, # mode : DWORD
],
Fiddle::TYPE_VOID)#[link(name = "opengl32")]
extern "system" {
fn glColorMaterial(
face: u32, // DWORD
mode: u32 // DWORD
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("OPENGL32.dll")]
public static extern void glColorMaterial(uint face, uint mode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OPENGL32_glColorMaterial' -Namespace Win32 -PassThru
# $api::glColorMaterial(face, mode)#uselib "OPENGL32.dll"
#func global glColorMaterial "glColorMaterial" sptr, sptr
; glColorMaterial face, mode
; face : DWORD -> "sptr"
; mode : DWORD -> "sptr"#uselib "OPENGL32.dll"
#func global glColorMaterial "glColorMaterial" int, int
; glColorMaterial face, mode
; face : DWORD -> "int"
; mode : DWORD -> "int"; void glColorMaterial(DWORD face, DWORD mode)
#uselib "OPENGL32.dll"
#func global glColorMaterial "glColorMaterial" int, int
; glColorMaterial face, mode
; face : DWORD -> "int"
; mode : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
procglColorMaterial = opengl32.NewProc("glColorMaterial")
)
// face (DWORD), mode (DWORD)
r1, _, err := procglColorMaterial.Call(
uintptr(face),
uintptr(mode),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure glColorMaterial(
face: DWORD; // DWORD
mode: DWORD // DWORD
); stdcall;
external 'OPENGL32.dll' name 'glColorMaterial';result := DllCall("OPENGL32\glColorMaterial"
, "UInt", face ; DWORD
, "UInt", mode ; DWORD
, "Int") ; return: void●glColorMaterial(face, mode) = DLL("OPENGL32.dll", "int glColorMaterial(dword, dword)")
# 呼び出し: glColorMaterial(face, mode)
# face : DWORD -> "dword"
# mode : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。