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

glDepthFunc

関数
深度バッファの比較に使う関数を設定する。
DLLOPENGL32.dll呼出規約winapi

シグネチャ

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

void glDepthFunc(
    DWORD func
);

パラメーター

名前方向
funcDWORDin

戻り値の型: void

各言語での呼び出し定義

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

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

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

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

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglDepthFunc = opengl32.NewProc("glDepthFunc")
)

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