Update windows.dinput for specialized-arrays

db4
U-SLAVA-DFB8FF805\Slava 2008-12-03 09:55:11 -06:00
parent 35df2fd480
commit 852e00c57a
1 changed files with 9 additions and 8 deletions

17
basis/windows/dinput/constants/constants.factor Normal file → Executable file
View File

@ -1,7 +1,8 @@
USING: windows.dinput windows.kernel32 windows.ole32 windows.com
windows.com.syntax alien alien.c-types alien.syntax kernel system namespaces
combinators sequences symbols fry math accessors macros words quotations
libc continuations generalizations splitting locals assocs init ;
libc continuations generalizations splitting locals assocs init
struct-arrays ;
IN: windows.dinput.constants
! Some global variables aren't provided by the DirectInput DLL (they're in the
@ -52,14 +53,14 @@ SYMBOLS:
} cleave
"DIOBJECTDATAFORMAT" <c-object> (DIOBJECTDATAFORMAT) ;
: malloc-DIOBJECTDATAFORMAT-array ( struct array -- alien )
[ nip length "DIOBJECTDATAFORMAT" malloc-array dup ]
[
-rot [| args i alien struct |
:: malloc-DIOBJECTDATAFORMAT-array ( struct array -- alien )
[let | alien [ array length "DIOBJECTDATAFORMAT" malloc-struct-array ] |
array [| args i |
struct args <DIOBJECTDATAFORMAT>
i alien set-DIOBJECTDATAFORMAT-nth
] 2curry each-index
] 2bi ;
i alien set-nth
] each-index
alien underlying>>
] ;
: (DIDATAFORMAT) ( dwSize dwObjSize dwFlags dwDataSize dwNumObjs rgodf alien -- alien )
[ {