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

wglDescribeLayerPlane

関数
オーバーレイなどレイヤープレーンの情報を取得する。
DLLOPENGL32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

BOOL wglDescribeLayerPlane(
    HDC param0,
    INT param1,
    INT param2,
    DWORD param3,
    LAYERPLANEDESCRIPTOR* param4
);

パラメーター

名前方向説明
param0HDCin対象のデバイスコンテキストハンドル(HDC)。
param1INTin対象のピクセル形式インデックスを示すINT値。
param2INTin情報を取得するレイヤープレーン番号を示すINT値。
param3DWORDinparam4バッファのバイトサイズを示すDWORD値。
param4LAYERPLANEDESCRIPTOR*inoutレイヤープレーンの記述を受け取る出力先のLAYERPLANEDESCRIPTORへのポインタ。

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL wglDescribeLayerPlane(
    HDC param0,
    INT param1,
    INT param2,
    DWORD param3,
    LAYERPLANEDESCRIPTOR* param4
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("OPENGL32.dll", ExactSpelling = true)]
static extern bool wglDescribeLayerPlane(
    IntPtr param0,   // HDC
    int param1,   // INT
    int param2,   // INT
    uint param3,   // DWORD
    IntPtr param4   // LAYERPLANEDESCRIPTOR* in/out
);
<DllImport("OPENGL32.dll", ExactSpelling:=True)>
Public Shared Function wglDescribeLayerPlane(
    param0 As IntPtr,   ' HDC
    param1 As Integer,   ' INT
    param2 As Integer,   ' INT
    param3 As UInteger,   ' DWORD
    param4 As IntPtr   ' LAYERPLANEDESCRIPTOR* in/out
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
' param0 : HDC
' param1 : INT
' param2 : INT
' param3 : DWORD
' param4 : LAYERPLANEDESCRIPTOR* in/out
Declare PtrSafe Function wglDescribeLayerPlane Lib "opengl32" ( _
    ByVal param0 As LongPtr, _
    ByVal param1 As Long, _
    ByVal param2 As Long, _
    ByVal param3 As Long, _
    ByVal param4 As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

wglDescribeLayerPlane = ctypes.windll.opengl32.wglDescribeLayerPlane
wglDescribeLayerPlane.restype = wintypes.BOOL
wglDescribeLayerPlane.argtypes = [
    wintypes.HANDLE,  # param0 : HDC
    ctypes.c_int,  # param1 : INT
    ctypes.c_int,  # param2 : INT
    wintypes.DWORD,  # param3 : DWORD
    ctypes.c_void_p,  # param4 : LAYERPLANEDESCRIPTOR* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('OPENGL32.dll')
wglDescribeLayerPlane = Fiddle::Function.new(
  lib['wglDescribeLayerPlane'],
  [
    Fiddle::TYPE_VOIDP,  # param0 : HDC
    Fiddle::TYPE_INT,  # param1 : INT
    Fiddle::TYPE_INT,  # param2 : INT
    -Fiddle::TYPE_INT,  # param3 : DWORD
    Fiddle::TYPE_VOIDP,  # param4 : LAYERPLANEDESCRIPTOR* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "opengl32")]
extern "system" {
    fn wglDescribeLayerPlane(
        param0: *mut core::ffi::c_void,  // HDC
        param1: i32,  // INT
        param2: i32,  // INT
        param3: u32,  // DWORD
        param4: *mut LAYERPLANEDESCRIPTOR  // LAYERPLANEDESCRIPTOR* in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("OPENGL32.dll")]
public static extern bool wglDescribeLayerPlane(IntPtr param0, int param1, int param2, uint param3, IntPtr param4);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OPENGL32_wglDescribeLayerPlane' -Namespace Win32 -PassThru
# $api::wglDescribeLayerPlane(param0, param1, param2, param3, param4)
#uselib "OPENGL32.dll"
#func global wglDescribeLayerPlane "wglDescribeLayerPlane" sptr, sptr, sptr, sptr, sptr
; wglDescribeLayerPlane param0, param1, param2, param3, varptr(param4)   ; 戻り値は stat
; param0 : HDC -> "sptr"
; param1 : INT -> "sptr"
; param2 : INT -> "sptr"
; param3 : DWORD -> "sptr"
; param4 : LAYERPLANEDESCRIPTOR* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "OPENGL32.dll"
#cfunc global wglDescribeLayerPlane "wglDescribeLayerPlane" sptr, int, int, int, var
; res = wglDescribeLayerPlane(param0, param1, param2, param3, param4)
; param0 : HDC -> "sptr"
; param1 : INT -> "int"
; param2 : INT -> "int"
; param3 : DWORD -> "int"
; param4 : LAYERPLANEDESCRIPTOR* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; BOOL wglDescribeLayerPlane(HDC param0, INT param1, INT param2, DWORD param3, LAYERPLANEDESCRIPTOR* param4)
#uselib "OPENGL32.dll"
#cfunc global wglDescribeLayerPlane "wglDescribeLayerPlane" intptr, int, int, int, var
; res = wglDescribeLayerPlane(param0, param1, param2, param3, param4)
; param0 : HDC -> "intptr"
; param1 : INT -> "int"
; param2 : INT -> "int"
; param3 : DWORD -> "int"
; param4 : LAYERPLANEDESCRIPTOR* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procwglDescribeLayerPlane = opengl32.NewProc("wglDescribeLayerPlane")
)

// param0 (HDC), param1 (INT), param2 (INT), param3 (DWORD), param4 (LAYERPLANEDESCRIPTOR* in/out)
r1, _, err := procwglDescribeLayerPlane.Call(
	uintptr(param0),
	uintptr(param1),
	uintptr(param2),
	uintptr(param3),
	uintptr(param4),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function wglDescribeLayerPlane(
  param0: THandle;   // HDC
  param1: Integer;   // INT
  param2: Integer;   // INT
  param3: DWORD;   // DWORD
  param4: Pointer   // LAYERPLANEDESCRIPTOR* in/out
): BOOL; stdcall;
  external 'OPENGL32.dll' name 'wglDescribeLayerPlane';
result := DllCall("OPENGL32\wglDescribeLayerPlane"
    , "Ptr", param0   ; HDC
    , "Int", param1   ; INT
    , "Int", param2   ; INT
    , "UInt", param3   ; DWORD
    , "Ptr", param4   ; LAYERPLANEDESCRIPTOR* in/out
    , "Int")   ; return: BOOL
●wglDescribeLayerPlane(param0, param1, param2, param3, param4) = DLL("OPENGL32.dll", "bool wglDescribeLayerPlane(void*, int, int, dword, void*)")
# 呼び出し: wglDescribeLayerPlane(param0, param1, param2, param3, param4)
# param0 : HDC -> "void*"
# param1 : INT -> "int"
# param2 : INT -> "int"
# param3 : DWORD -> "dword"
# param4 : LAYERPLANEDESCRIPTOR* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "opengl32" fn wglDescribeLayerPlane(
    param0: ?*anyopaque, // HDC
    param1: i32, // INT
    param2: i32, // INT
    param3: u32, // DWORD
    param4: [*c]LAYERPLANEDESCRIPTOR // LAYERPLANEDESCRIPTOR* in/out
) callconv(std.os.windows.WINAPI) i32;
proc wglDescribeLayerPlane(
    param0: pointer,  # HDC
    param1: int32,  # INT
    param2: int32,  # INT
    param3: uint32,  # DWORD
    param4: ptr LAYERPLANEDESCRIPTOR  # LAYERPLANEDESCRIPTOR* in/out
): int32 {.importc: "wglDescribeLayerPlane", stdcall, dynlib: "OPENGL32.dll".}
pragma(lib, "opengl32");
extern(Windows)
int wglDescribeLayerPlane(
    void* param0,   // HDC
    int param1,   // INT
    int param2,   // INT
    uint param3,   // DWORD
    LAYERPLANEDESCRIPTOR* param4   // LAYERPLANEDESCRIPTOR* in/out
);
ccall((:wglDescribeLayerPlane, "OPENGL32.dll"), stdcall, Int32,
      (Ptr{Cvoid}, Int32, Int32, UInt32, Ptr{LAYERPLANEDESCRIPTOR}),
      param0, param1, param2, param3, param4)
# param0 : HDC -> Ptr{Cvoid}
# param1 : INT -> Int32
# param2 : INT -> Int32
# param3 : DWORD -> UInt32
# param4 : LAYERPLANEDESCRIPTOR* in/out -> Ptr{LAYERPLANEDESCRIPTOR}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t wglDescribeLayerPlane(
    void* param0,
    int32_t param1,
    int32_t param2,
    uint32_t param3,
    void* param4);
]]
local opengl32 = ffi.load("opengl32")
-- opengl32.wglDescribeLayerPlane(param0, param1, param2, param3, param4)
-- param0 : HDC
-- param1 : INT
-- param2 : INT
-- param3 : DWORD
-- param4 : LAYERPLANEDESCRIPTOR* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('OPENGL32.dll');
const wglDescribeLayerPlane = lib.func('__stdcall', 'wglDescribeLayerPlane', 'int32_t', ['void *', 'int32_t', 'int32_t', 'uint32_t', 'void *']);
// wglDescribeLayerPlane(param0, param1, param2, param3, param4)
// param0 : HDC -> 'void *'
// param1 : INT -> 'int32_t'
// param2 : INT -> 'int32_t'
// param3 : DWORD -> 'uint32_t'
// param4 : LAYERPLANEDESCRIPTOR* in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("OPENGL32.dll", {
  wglDescribeLayerPlane: { parameters: ["pointer", "i32", "i32", "u32", "pointer"], result: "i32" },
});
// lib.symbols.wglDescribeLayerPlane(param0, param1, param2, param3, param4)
// param0 : HDC -> "pointer"
// param1 : INT -> "i32"
// param2 : INT -> "i32"
// param3 : DWORD -> "u32"
// param4 : LAYERPLANEDESCRIPTOR* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t wglDescribeLayerPlane(
    void* param0,
    int32_t param1,
    int32_t param2,
    uint32_t param3,
    void* param4);
C, "OPENGL32.dll");
// $ffi->wglDescribeLayerPlane(param0, param1, param2, param3, param4);
// param0 : HDC
// param1 : INT
// param2 : INT
// param3 : DWORD
// param4 : LAYERPLANEDESCRIPTOR* in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Opengl32 extends StdCallLibrary {
    Opengl32 INSTANCE = Native.load("opengl32", Opengl32.class);
    boolean wglDescribeLayerPlane(
        Pointer param0,   // HDC
        int param1,   // INT
        int param2,   // INT
        int param3,   // DWORD
        Pointer param4   // LAYERPLANEDESCRIPTOR* in/out
    );
}
@[Link("opengl32")]
lib LibOPENGL32
  fun wglDescribeLayerPlane = wglDescribeLayerPlane(
    param0 : Void*,   # HDC
    param1 : Int32,   # INT
    param2 : Int32,   # INT
    param3 : UInt32,   # DWORD
    param4 : LAYERPLANEDESCRIPTOR*   # LAYERPLANEDESCRIPTOR* in/out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef wglDescribeLayerPlaneNative = Int32 Function(Pointer<Void>, Int32, Int32, Uint32, Pointer<Void>);
typedef wglDescribeLayerPlaneDart = int Function(Pointer<Void>, int, int, int, Pointer<Void>);
final wglDescribeLayerPlane = DynamicLibrary.open('OPENGL32.dll')
    .lookupFunction<wglDescribeLayerPlaneNative, wglDescribeLayerPlaneDart>('wglDescribeLayerPlane');
// param0 : HDC -> Pointer<Void>
// param1 : INT -> Int32
// param2 : INT -> Int32
// param3 : DWORD -> Uint32
// param4 : LAYERPLANEDESCRIPTOR* in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function wglDescribeLayerPlane(
  param0: THandle;   // HDC
  param1: Integer;   // INT
  param2: Integer;   // INT
  param3: DWORD;   // DWORD
  param4: Pointer   // LAYERPLANEDESCRIPTOR* in/out
): BOOL; stdcall;
  external 'OPENGL32.dll' name 'wglDescribeLayerPlane';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "wglDescribeLayerPlane"
  c_wglDescribeLayerPlane :: Ptr () -> Int32 -> Int32 -> Word32 -> Ptr () -> IO CInt
-- param0 : HDC -> Ptr ()
-- param1 : INT -> Int32
-- param2 : INT -> Int32
-- param3 : DWORD -> Word32
-- param4 : LAYERPLANEDESCRIPTOR* in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let wgldescribelayerplane =
  foreign "wglDescribeLayerPlane"
    ((ptr void) @-> int32_t @-> int32_t @-> uint32_t @-> (ptr void) @-> returning int32_t)
(* param0 : HDC -> (ptr void) *)
(* param1 : INT -> int32_t *)
(* param2 : INT -> int32_t *)
(* param3 : DWORD -> uint32_t *)
(* param4 : LAYERPLANEDESCRIPTOR* in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library opengl32 (t "OPENGL32.dll"))
(cffi:use-foreign-library opengl32)

(cffi:defcfun ("wglDescribeLayerPlane" wgl-describe-layer-plane :convention :stdcall) :int32
  (param0 :pointer)   ; HDC
  (param1 :int32)   ; INT
  (param2 :int32)   ; INT
  (param3 :uint32)   ; DWORD
  (param4 :pointer))   ; LAYERPLANEDESCRIPTOR* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $wglDescribeLayerPlane = Win32::API::More->new('OPENGL32',
    'BOOL wglDescribeLayerPlane(HANDLE param0, int param1, int param2, DWORD param3, LPVOID param4)');
# my $ret = $wglDescribeLayerPlane->Call($param0, $param1, $param2, $param3, $param4);
# param0 : HDC -> HANDLE
# param1 : INT -> int
# param2 : INT -> int
# param3 : DWORD -> DWORD
# param4 : LAYERPLANEDESCRIPTOR* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型