ホーム › UI.Input.GameInput › GameInputForceFeedbackParams
GameInputForceFeedbackParams
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| kind | GameInputForceFeedbackEffectKind | 4 | +0 | +0 | フォースフィードバックエフェクトの種別を示す値である。 |
| data | _data_e__Union | 104 | +8 | +8 | kindに応じたエフェクトパラメータを保持する共用体である。 |
共用体: _data_e__Union x64 104B / x86 104B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| constant | GameInputForceFeedbackConstantParams | 80 | +0 | +0 |
| ramp | GameInputForceFeedbackRampParams | 104 | +0 | +0 |
| sineWave | GameInputForceFeedbackPeriodicParams | 88 | +0 | +0 |
| squareWave | GameInputForceFeedbackPeriodicParams | 88 | +0 | +0 |
| triangleWave | GameInputForceFeedbackPeriodicParams | 88 | +0 | +0 |
| sawtoothUpWave | GameInputForceFeedbackPeriodicParams | 88 | +0 | +0 |
| sawtoothDownWave | GameInputForceFeedbackPeriodicParams | 88 | +0 | +0 |
| spring | GameInputForceFeedbackConditionParams | 52 | +0 | +0 |
| friction | GameInputForceFeedbackConditionParams | 52 | +0 | +0 |
| damper | GameInputForceFeedbackConditionParams | 52 | +0 | +0 |
| inertia | GameInputForceFeedbackConditionParams | 52 | +0 | +0 |
各言語での定義
#include <windows.h>
// GameInputForceFeedbackParams (x64 112 / x86 112 バイト)
typedef struct GameInputForceFeedbackParams {
GameInputForceFeedbackEffectKind kind;
_data_e__Union data;
} GameInputForceFeedbackParams;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GameInputForceFeedbackParams
{
public int kind;
public _data_e__Union data;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GameInputForceFeedbackParams
Public kind As Integer
Public data As _data_e__Union
End Structureimport ctypes
from ctypes import wintypes
class GameInputForceFeedbackParams(ctypes.Structure):
_fields_ = [
("kind", ctypes.c_int),
("data", _data_e__Union),
]#[repr(C)]
pub struct GameInputForceFeedbackParams {
pub kind: i32,
pub data: _data_e__Union,
}import "golang.org/x/sys/windows"
type GameInputForceFeedbackParams struct {
kind int32
data _data_e__Union
}type
GameInputForceFeedbackParams = record
kind: Integer;
data: _data_e__Union;
end;const GameInputForceFeedbackParams = extern struct {
kind: i32,
data: _data_e__Union,
};type
GameInputForceFeedbackParams {.bycopy.} = object
kind: int32
data: _data_e__Unionstruct GameInputForceFeedbackParams
{
int kind;
_data_e__Union data;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GameInputForceFeedbackParams サイズ: 112 バイト(x64)
dim st, 28 ; 4byte整数×28(構造体サイズ 112 / 4 切り上げ)
; kind : GameInputForceFeedbackEffectKind (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; data : _data_e__Union (+8, 104byte) varptr(st)+8 を基点に操作(104byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GameInputForceFeedbackParams
#field int kind
#field byte data 104
#endstruct
stdim st, GameInputForceFeedbackParams ; NSTRUCT 変数を確保
st->kind = 100
mes "kind=" + st->kind
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。