 ! Copyright (C) 2010 Erik Charlebois
 ! See http:// factorcode.org/license.txt for BSD license.
-USING: accessors chipmunk classes.struct game.loop game.worlds gpu
-gpu.util.wasd kernel literals locals math method-chains opengl.gl
-random sequences specialized-arrays
-specialized-arrays.instances.alien.c-types.void* ui.gadgets.worlds
+USING: accessors chipmunk classes.struct game.worlds kernel locals
+math method-chains opengl.gl random sequences specialized-arrays
+specialized-arrays.instances.alien.c-types.void* ui ui.gadgets.worlds
 ui.pixel-formats ;
 IN: chipmunk.demo
 


M:: chipmunk-world begin-game-world ( world -- )
    cpInitChipmunk
    init-gpu
    world { -0.2 0.13 0.1 } 1.1 0.2 set-wasd-view drop

    cpSpaceAlloc cpSpaceInit cpSpace memory>struct :> space


    [ cpSpaceFreeChildren ]
    [ cpSpaceFree ] bi ;

: chipmunk-demo ( -- )
    [
        f
        T{ game-attributes
           { world-class chipmunk-world }
           { title "Chipmunk Physics Demo" }
           { pixel-format-attributes
             { windowed double-buffered }
           }
           { pref-dim { 640 480 } }
           { tick-interval-micros 16666 }
        }
        clone
        open-window
    ] with-ui ;

