]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/game/input/x11/x11.factor
Updating code to use with-out-parameters
[factor.git] / basis / game / input / x11 / x11.factor
index 2e6514d396e2c50925c69673a5261172551106e7..c3bf11f7a898d49e24b44a0c0171c4ac4d5310c4 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.c-types arrays kernel game.input
 namespaces math classes bit-arrays system sequences vectors
-x11 x11.xlib assocs ;
+x11 x11.xlib assocs generalizations ;
 IN: game.input.x11
 
 SINGLETON: x11-game-input-backend
@@ -88,9 +88,9 @@ M: x11-game-input-backend read-keyboard
 
 : query-pointer ( -- x y buttons )
     dpy get dup XDefaultRootWindow
-    0 <int> 0 <int> 0 <int> 0 <int> 0 <int> 0 <int> 0 <int>
-    [ XQueryPointer drop ] 3keep
-    [ *int ] tri@ ;
+    { int int int int int int int }
+    [ XQueryPointer drop ] [ ] with-out-parameters
+    [ 4 ndrop ] 3dip ;
 
 SYMBOL: mouse-reset?