Get game-input to load on Windows
							parent
							
								
									b1243dc1be
								
							
						
					
					
						commit
						5d3c2c874a
					
				| 
						 | 
				
			
			@ -354,7 +354,7 @@ H{ } clone wm-handlers set-global
 | 
			
		|||
 | 
			
		||||
: 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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -832,7 +832,7 @@ SYMBOLS:
 | 
			
		|||
    define-keyboard-format-constant
 | 
			
		||||
    define-hid-keyboard-format-constant ;
 | 
			
		||||
 | 
			
		||||
: define-constants
 | 
			
		||||
: define-constants ( -- )
 | 
			
		||||
    define-guid-constants
 | 
			
		||||
    define-format-constants ;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,15 +27,15 @@ TYPEDEF: void* LPDIENUMEFFECTSCALLBACKW
 | 
			
		|||
    [ "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
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,10 +2,10 @@ USING: windows.dinput windows.dinput.constants parser
 | 
			
		|||
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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -35,7 +35,7 @@ PRIVATE>
 | 
			
		|||
    ] 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 ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue