: add-wm-handler ( quot wm -- )
dup array?
- [ [ execute add-wm-handler ] with each ]
+ [ [ execute( -- wm ) add-wm-handler ] with each ]
[ wm-handlers get-global set-at ] if ;
[ handle-wm-close 0 ] WM_CLOSE add-wm-handler
define-keyboard-format-constant
define-hid-keyboard-format-constant ;
-: define-constants
+: define-constants ( -- )
define-guid-constants
define-format-constants ;
[ "BOOL" { "LPCDIEFFECTINFOW" "LPVOID" } "stdcall" ]
dip alien-callback ; inline
TYPEDEF: void* LPDIENUMCREATEDEFFECTOBJECTSCALLBACK
-: LPDIENUMCREATEDEFFECTOBJECTSCALLBACK
+: LPDIENUMCREATEDEFFECTOBJECTSCALLBACK ( quot -- callback )
[ "BOOL" { "LPDIRECTINPUTEFFECT" "LPVOID" } "stdcall" ]
dip alien-callback ; inline
TYPEDEF: void* LPDIENUMEFFECTSINFILECALLBACK
-: LPDIENUMEFFECTSINFILECALLBACK
+: LPDIENUMEFFECTSINFILECALLBACK ( quot -- callback )
[ "BOOL" { "LPCDIFILEEFFECT" "LPVOID" } "stdcall" ]
dip alien-callback ; inline
TYPEDEF: void* LPDIENUMDEVICEOBJECTSCALLBACKW
-: LPDIENUMDEVICEOBJECTSCALLBACKW
+: LPDIENUMDEVICEOBJECTSCALLBACKW ( quot -- callback )
[ "BOOL" { "LPCDIDEVICEOBJECTINSTANCEW" "LPVOID" } "stdcall" ]
dip alien-callback ; inline
alien.c-types windows.ole32 namespaces assocs kernel arrays
vectors windows.kernel32 windows.com windows.dinput shuffle
windows.user32 windows.messages sequences combinators locals
-math.rectangles ui.windows accessors math windows alien
+math.rectangles accessors math windows alien
alien.strings io.encodings.utf16 io.encodings.utf16n
continuations byte-arrays game-input.dinput.keys-array
-game-input ;
+game-input ui.backend.windows ;
IN: game-input.dinput
SINGLETON: dinput-game-input-backend
] when ;
: with-game-input ( quot -- )
- open-game-input [ close-game-input ] [ ] cleanup ;
+ open-game-input [ close-game-input ] [ ] cleanup ; inline
TUPLE: controller handle ;
TUPLE: controller-state x y z rx ry rz slider pov buttons ;