: open-world-window ( world -- )
dup pref-dim >>dim dup relayout graft ;
+: open-window* ( gadget title/attributes -- window )
+ ?attributes <world> [ open-world-window ] keep ;
+
: open-window ( gadget title/attributes -- )
- ?attributes <world> open-world-window ;
+ open-window* drop ;
: set-fullscreen ( gadget ? -- )
[ find-world ] dip (set-fullscreen) ;
--- /dev/null
+USING: accessors kernel ui ui.backend ui.gadgets
+ui.gadgets.worlds ui.pixel-formats ;
+IN: ui.gadgets.worlds.null
+
+TUPLE: null-world < world ;
+M: null-world begin-world drop ;
+M: null-world end-world drop ;
+M: null-world draw-world* drop ;
+M: null-world resize-world drop ;
+M: null-world pref-dim* drop { 512 512 } ;
+
+: null-window ( title -- world )
+ <world-attributes>
+ swap >>title
+ null-world >>world-class
+ {
+ windowed
+ double-buffered
+ backing-store
+ T{ depth-bits f 24 }
+ } >>pixel-format-attributes
+ f swap open-window* ;
+
+: into-window ( world quot -- world )
+ [ dup handle>> ] dip with-gl-context ; inline
+
+