1 ! Copyright (C) 2007 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
4 USING: arrays kernel math math.functions namespaces opengl
8 TUPLE: graphics-gadget image ;
10 GENERIC: draw-image ( image -- )
11 GENERIC: width ( image -- w )
12 GENERIC: height ( image -- h )
14 M: graphics-gadget pref-dim*
16 [ width ] keep height abs 2array ;
18 M: graphics-gadget draw-gadget* ( gadget -- )
20 graphics-gadget-image draw-image
23 : <graphics-gadget> ( bitmap -- gadget )
24 \ graphics-gadget construct-gadget
25 [ set-graphics-gadget-image ] keep ;