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

glCopyTexSubImage1D

関数
フレームバッファから1次元テクスチャの部分領域へ複写する。
DLLOPENGL32.dll呼出規約winapi

シグネチャ

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

void glCopyTexSubImage1D(
    DWORD target,
    INT level,
    INT xoffset,
    INT x,
    INT y,
    INT width
);

パラメーター

名前方向
targetDWORDin
levelINTin
xoffsetINTin
xINTin
yINTin
widthINTin

戻り値の型: void

各言語での呼び出し定義

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

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

glCopyTexSubImage1D = ctypes.windll.opengl32.glCopyTexSubImage1D
glCopyTexSubImage1D.restype = None
glCopyTexSubImage1D.argtypes = [
    wintypes.DWORD,  # target : DWORD
    ctypes.c_int,  # level : INT
    ctypes.c_int,  # xoffset : INT
    ctypes.c_int,  # x : INT
    ctypes.c_int,  # y : INT
    ctypes.c_int,  # width : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglCopyTexSubImage1D = opengl32.NewProc("glCopyTexSubImage1D")
)

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