ホーム › Graphics.OpenGL › wglSwapLayerBuffers
wglSwapLayerBuffers
関数指定したレイヤープレーンのバッファを入れ替える。
シグネチャ
// OPENGL32.dll
#include <windows.h>
BOOL wglSwapLayerBuffers(
HDC param0,
DWORD param1
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| param0 | HDC | in |
| param1 | DWORD | in |
戻り値の型: BOOL
各言語での呼び出し定義
// OPENGL32.dll
#include <windows.h>
BOOL wglSwapLayerBuffers(
HDC param0,
DWORD param1
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("OPENGL32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool wglSwapLayerBuffers(
IntPtr param0, // HDC
uint param1 // DWORD
);<DllImport("OPENGL32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function wglSwapLayerBuffers(
param0 As IntPtr, ' HDC
param1 As UInteger ' DWORD
) As Boolean
End Function' param0 : HDC
' param1 : DWORD
Declare PtrSafe Function wglSwapLayerBuffers Lib "opengl32" ( _
ByVal param0 As LongPtr, _
ByVal param1 As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
wglSwapLayerBuffers = ctypes.windll.opengl32.wglSwapLayerBuffers
wglSwapLayerBuffers.restype = wintypes.BOOL
wglSwapLayerBuffers.argtypes = [
wintypes.HANDLE, # param0 : HDC
wintypes.DWORD, # param1 : DWORD
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('OPENGL32.dll')
wglSwapLayerBuffers = Fiddle::Function.new(
lib['wglSwapLayerBuffers'],
[
Fiddle::TYPE_VOIDP, # param0 : HDC
-Fiddle::TYPE_INT, # param1 : DWORD
],
Fiddle::TYPE_INT)#[link(name = "opengl32")]
extern "system" {
fn wglSwapLayerBuffers(
param0: *mut core::ffi::c_void, // HDC
param1: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("OPENGL32.dll", SetLastError = true)]
public static extern bool wglSwapLayerBuffers(IntPtr param0, uint param1);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OPENGL32_wglSwapLayerBuffers' -Namespace Win32 -PassThru
# $api::wglSwapLayerBuffers(param0, param1)#uselib "OPENGL32.dll"
#func global wglSwapLayerBuffers "wglSwapLayerBuffers" sptr, sptr
; wglSwapLayerBuffers param0, param1 ; 戻り値は stat
; param0 : HDC -> "sptr"
; param1 : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "OPENGL32.dll"
#cfunc global wglSwapLayerBuffers "wglSwapLayerBuffers" sptr, int
; res = wglSwapLayerBuffers(param0, param1)
; param0 : HDC -> "sptr"
; param1 : DWORD -> "int"; BOOL wglSwapLayerBuffers(HDC param0, DWORD param1)
#uselib "OPENGL32.dll"
#cfunc global wglSwapLayerBuffers "wglSwapLayerBuffers" intptr, int
; res = wglSwapLayerBuffers(param0, param1)
; param0 : HDC -> "intptr"
; param1 : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
procwglSwapLayerBuffers = opengl32.NewProc("wglSwapLayerBuffers")
)
// param0 (HDC), param1 (DWORD)
r1, _, err := procwglSwapLayerBuffers.Call(
uintptr(param0),
uintptr(param1),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction wglSwapLayerBuffers(
param0: THandle; // HDC
param1: DWORD // DWORD
): BOOL; stdcall;
external 'OPENGL32.dll' name 'wglSwapLayerBuffers';result := DllCall("OPENGL32\wglSwapLayerBuffers"
, "Ptr", param0 ; HDC
, "UInt", param1 ; DWORD
, "Int") ; return: BOOL●wglSwapLayerBuffers(param0, param1) = DLL("OPENGL32.dll", "bool wglSwapLayerBuffers(void*, dword)")
# 呼び出し: wglSwapLayerBuffers(param0, param1)
# param0 : HDC -> "void*"
# param1 : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。