pardon my dust
parent
b748164b43
commit
97adae24f0
|
@ -154,7 +154,7 @@ MACRO: all-enabled-client-state ( seq quot -- )
|
||||||
|
|
||||||
:: with-vertex-array ( id quot -- )
|
:: with-vertex-array ( id quot -- )
|
||||||
id glBindVertexArray
|
id glBindVertexArray
|
||||||
quot [ binding 0 glBindVertexArray ] [ ] cleanup ; inline
|
quot [ 0 glBindVertexArray ] [ ] cleanup ; inline
|
||||||
|
|
||||||
: <gl-buffer> ( target data hint -- id )
|
: <gl-buffer> ( target data hint -- id )
|
||||||
pick gen-gl-buffer [
|
pick gen-gl-buffer [
|
||||||
|
|
|
@ -89,13 +89,13 @@ SYMBOL: context-world
|
||||||
|
|
||||||
: with-gl-context ( world quot -- )
|
: with-gl-context ( world quot -- )
|
||||||
'[ set-gl-context @ ]
|
'[ set-gl-context @ ]
|
||||||
[ flush-gl-context gl-error ] bi ; inline
|
[ handle>> flush-gl-context gl-error ] bi ; inline
|
||||||
|
|
||||||
ERROR: no-world-found ;
|
ERROR: no-world-found ;
|
||||||
|
|
||||||
: find-gl-context ( gadget -- )
|
: find-gl-context ( gadget -- )
|
||||||
find-world dup
|
find-world dup
|
||||||
[ handle>> set-gl-context ] [ no-world-found ] if ;
|
[ set-gl-context ] [ no-world-found ] if ;
|
||||||
|
|
||||||
: (request-focus) ( child world ? -- )
|
: (request-focus) ( child world ? -- )
|
||||||
pick parent>> pick eq? [
|
pick parent>> pick eq? [
|
||||||
|
@ -164,8 +164,8 @@ M: world (>>dim)
|
||||||
[ call-next-method ]
|
[ call-next-method ]
|
||||||
[
|
[
|
||||||
dup handle>>
|
dup handle>>
|
||||||
[ set-gl-context resize-world ]
|
[ [ set-gl-context ] [ resize-world ] bi ]
|
||||||
[ drop ] if*
|
[ drop ] if
|
||||||
] bi ;
|
] bi ;
|
||||||
|
|
||||||
GENERIC: draw-world* ( world -- )
|
GENERIC: draw-world* ( world -- )
|
||||||
|
@ -199,7 +199,7 @@ ui-error-hook [ [ rethrow ] ] initialize
|
||||||
dup draw-world? [
|
dup draw-world? [
|
||||||
dup world [
|
dup world [
|
||||||
[
|
[
|
||||||
dup handle>> [ draw-world* ] with-gl-context
|
dup [ draw-world* ] with-gl-context
|
||||||
flush-layout-cache-hook get call( -- )
|
flush-layout-cache-hook get call( -- )
|
||||||
] [
|
] [
|
||||||
over <world-error> ui-error
|
over <world-error> ui-error
|
||||||
|
|
|
@ -61,7 +61,7 @@ SYMBOL: windows
|
||||||
|
|
||||||
: set-up-window ( world -- )
|
: set-up-window ( world -- )
|
||||||
{
|
{
|
||||||
[ handle>> set-gl-context ]
|
[ set-gl-context ]
|
||||||
[ [ title>> ] keep set-title ]
|
[ [ title>> ] keep set-title ]
|
||||||
[ begin-world ]
|
[ begin-world ]
|
||||||
[ resize-world ]
|
[ resize-world ]
|
||||||
|
@ -89,13 +89,13 @@ M: world graft*
|
||||||
|
|
||||||
: (ungraft-world) ( world -- )
|
: (ungraft-world) ( world -- )
|
||||||
{
|
{
|
||||||
[ handle>> set-gl-context ]
|
[ set-gl-context ]
|
||||||
[ text-handle>> [ dispose ] when* ]
|
[ text-handle>> [ dispose ] when* ]
|
||||||
[ images>> [ dispose ] when* ]
|
[ images>> [ dispose ] when* ]
|
||||||
[ hand-clicked close-global ]
|
[ hand-clicked close-global ]
|
||||||
[ hand-gadget close-global ]
|
[ hand-gadget close-global ]
|
||||||
[ end-world ]
|
[ end-world ]
|
||||||
[ [ [ [ dispose ] when* ] each V{ } clone ] change-window-resources ]
|
[ [ [ [ dispose ] when* ] each V{ } clone ] change-window-resources drop ]
|
||||||
} cleave ;
|
} cleave ;
|
||||||
|
|
||||||
M: world ungraft*
|
M: world ungraft*
|
||||||
|
|
|
@ -22,6 +22,6 @@ M: null-world pref-dim* drop { 512 512 } ;
|
||||||
f swap open-window* ;
|
f swap open-window* ;
|
||||||
|
|
||||||
: into-window ( world quot -- world )
|
: into-window ( world quot -- world )
|
||||||
[ dup handle>> ] dip with-gl-context ; inline
|
[ dup ] dip with-gl-context ; inline
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue