factor/library/ui/ui.factor

35 lines
803 B
Factor
Raw Permalink Normal View History

2005-05-03 19:10:20 -04:00
! Copyright (C) 2005 Slava Pestov.
! See http://factor.sf.net/license.txt for BSD license.
IN: gadgets
2005-10-14 04:05:02 -04:00
USING: errors freetype gadgets-layouts gadgets-listener
gadgets-theme generic help io kernel listener lists math memory
namespaces opengl prettyprint sdl sequences shells styles
threads words ;
SYMBOL: first-time
2005-10-08 01:15:14 -04:00
global [ first-time on ] bind
2005-05-03 19:10:20 -04:00
2005-10-14 04:05:02 -04:00
: init-world ( -- )
2005-10-08 01:15:14 -04:00
global [
2005-10-14 04:05:02 -04:00
first-time get [
<world> world set
world get solid-interior
{ 600 700 0 } world get set-gadget-dim
2005-10-14 04:05:02 -04:00
<hand> hand set
first-time off
] when
2005-10-08 01:15:14 -04:00
] bind ;
2005-08-26 00:55:56 -04:00
2005-09-03 22:28:46 -04:00
IN: shells
2005-05-03 19:10:20 -04:00
: ui ( -- )
[
init-world world get rect-dim first2
[ listener-application run-world ] with-gl-screen
2005-10-14 04:05:02 -04:00
] with-freetype ;
2006-01-08 20:41:31 -05:00
IN: gadgets
: ui* [ ui ] in-thread ;