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

glClearStencil

関数
ステンシルバッファのクリア値を設定する。
DLLOPENGL32.dll呼出規約winapi

シグネチャ

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

void glClearStencil(
    INT s
);

パラメーター

名前方向
sINTin

戻り値の型: void

各言語での呼び出し定義

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

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

glClearStencil = ctypes.windll.opengl32.glClearStencil
glClearStencil.restype = None
glClearStencil.argtypes = [
    ctypes.c_int,  # s : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglClearStencil = opengl32.NewProc("glClearStencil")
)

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