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

glClipPlane

関数
ユーザー定義のクリッピング平面を設定する。
DLLOPENGL32.dll呼出規約winapi

シグネチャ

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

void glClipPlane(
    DWORD plane,
    const DOUBLE* equation
);

パラメーター

名前方向
planeDWORDin
equationDOUBLE*in

戻り値の型: void

各言語での呼び出し定義

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

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

glClipPlane = ctypes.windll.opengl32.glClipPlane
glClipPlane.restype = None
glClipPlane.argtypes = [
    wintypes.DWORD,  # plane : DWORD
    ctypes.POINTER(ctypes.c_double),  # equation : DOUBLE*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('OPENGL32.dll')
glClipPlane = Fiddle::Function.new(
  lib['glClipPlane'],
  [
    -Fiddle::TYPE_INT,  # plane : DWORD
    Fiddle::TYPE_VOIDP,  # equation : DOUBLE*
  ],
  Fiddle::TYPE_VOID)
#[link(name = "opengl32")]
extern "system" {
    fn glClipPlane(
        plane: u32,  // DWORD
        equation: *const f64  // DOUBLE*
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("OPENGL32.dll")]
public static extern void glClipPlane(uint plane, ref double equation);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OPENGL32_glClipPlane' -Namespace Win32 -PassThru
# $api::glClipPlane(plane, equation)
#uselib "OPENGL32.dll"
#func global glClipPlane "glClipPlane" sptr, sptr
; glClipPlane plane, varptr(equation)
; plane : DWORD -> "sptr"
; equation : DOUBLE* -> "sptr"
出力引数:
#uselib "OPENGL32.dll"
#func global glClipPlane "glClipPlane" int, var
; glClipPlane plane, equation
; plane : DWORD -> "int"
; equation : DOUBLE* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void glClipPlane(DWORD plane, DOUBLE* equation)
#uselib "OPENGL32.dll"
#func global glClipPlane "glClipPlane" int, var
; glClipPlane plane, equation
; plane : DWORD -> "int"
; equation : DOUBLE* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglClipPlane = opengl32.NewProc("glClipPlane")
)

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