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