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

glLogicOp

関数
フラグメントとの論理演算ラスタ操作を指定する。
DLLOPENGL32.dll呼出規約winapi

シグネチャ

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

void glLogicOp(
    DWORD opcode
);

パラメーター

名前方向
opcodeDWORDin

戻り値の型: void

各言語での呼び出し定義

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

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

glLogicOp = ctypes.windll.opengl32.glLogicOp
glLogicOp.restype = None
glLogicOp.argtypes = [
    wintypes.DWORD,  # opcode : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglLogicOp = opengl32.NewProc("glLogicOp")
)

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