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

glNormal3s

関数
現在の法線ベクトルを短整数の3成分で設定する。
DLLOPENGL32.dll呼出規約winapi

シグネチャ

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

void glNormal3s(
    SHORT nx,
    SHORT ny,
    SHORT nz
);

パラメーター

名前方向
nxSHORTin
nySHORTin
nzSHORTin

戻り値の型: void

各言語での呼び出し定義

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

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

glNormal3s = ctypes.windll.opengl32.glNormal3s
glNormal3s.restype = None
glNormal3s.argtypes = [
    ctypes.c_short,  # nx : SHORT
    ctypes.c_short,  # ny : SHORT
    ctypes.c_short,  # nz : SHORT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	opengl32 = windows.NewLazySystemDLL("OPENGL32.dll")
	procglNormal3s = opengl32.NewProc("glNormal3s")
)

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