pardon my dust

db4
Joe Groff 2009-07-01 17:57:21 -05:00
parent b748164b43
commit 97adae24f0
4 changed files with 10 additions and 10 deletions

View File

@ -154,7 +154,7 @@ MACRO: all-enabled-client-state ( seq quot -- )
:: with-vertex-array ( id quot -- )
id glBindVertexArray
quot [ binding 0 glBindVertexArray ] [ ] cleanup ; inline
quot [ 0 glBindVertexArray ] [ ] cleanup ; inline
: <gl-buffer> ( target data hint -- id )
pick gen-gl-buffer [

View File

@ -89,13 +89,13 @@ SYMBOL: context-world
: with-gl-context ( world quot -- )
'[ set-gl-context @ ]
[ flush-gl-context gl-error ] bi ; inline
[ handle>> flush-gl-context gl-error ] bi ; inline
ERROR: no-world-found ;
: find-gl-context ( gadget -- )
find-world dup
[ handle>> set-gl-context ] [ no-world-found ] if ;
[ set-gl-context ] [ no-world-found ] if ;
: (request-focus) ( child world ? -- )
pick parent>> pick eq? [
@ -164,8 +164,8 @@ M: world (>>dim)
[ call-next-method ]
[
dup handle>>
[ set-gl-context resize-world ]
[ drop ] if*
[ [ set-gl-context ] [ resize-world ] bi ]
[ drop ] if
] bi ;
GENERIC: draw-world* ( world -- )
@ -199,7 +199,7 @@ ui-error-hook [ [ rethrow ] ] initialize
dup draw-world? [
dup world [
[
dup handle>> [ draw-world* ] with-gl-context
dup [ draw-world* ] with-gl-context
flush-layout-cache-hook get call( -- )
] [
over <world-error> ui-error

View File

@ -61,7 +61,7 @@ SYMBOL: windows
: set-up-window ( world -- )
{
[ handle>> set-gl-context ]
[ set-gl-context ]
[ [ title>> ] keep set-title ]
[ begin-world ]
[ resize-world ]
@ -89,13 +89,13 @@ M: world graft*
: (ungraft-world) ( world -- )
{
[ handle>> set-gl-context ]
[ set-gl-context ]
[ text-handle>> [ dispose ] when* ]
[ images>> [ dispose ] when* ]
[ hand-clicked close-global ]
[ hand-gadget close-global ]
[ end-world ]
[ [ [ [ dispose ] when* ] each V{ } clone ] change-window-resources ]
[ [ [ [ dispose ] when* ] each V{ } clone ] change-window-resources drop ]
} cleave ;
M: world ungraft*

View File

@ -22,6 +22,6 @@ M: null-world pref-dim* drop { 512 512 } ;
f swap open-window* ;
: into-window ( world quot -- world )
[ dup handle>> ] dip with-gl-context ; inline
[ dup ] dip with-gl-context ; inline