Reorder the ui notify loop to update graft state before calling graft*/ungraft*, avoiding the death problem without sacrificing performance

db4
Joe Groff 2008-01-27 22:11:05 -08:00
parent 7b7987f476
commit afb8ac566e
2 changed files with 8 additions and 7 deletions

View File

@ -187,7 +187,10 @@ main()
] if ;
M: line-art-gadget graft* ( gadget -- )
"2.0" { "GL_ARB_draw_buffers" "GL_ARB_shader_objects" "GL_ARB_multitexture" }
"2.0" { "GL_ARB_draw_buffers"
"GL_ARB_shader_objects"
"GL_ARB_multitexture"
"GL_ARB_texture_float" }
require-gl-version-or-extensions
{ "GL_EXT_framebuffer_object" } require-gl-extensions
GL_CULL_FACE glEnable

View File

@ -120,12 +120,10 @@ SYMBOL: ui-hook
[ dup update-hand draw-world ] each ;
: notify ( gadget -- )
dup gadget-graft-state {
{ { f t } [ dup activate-control dup graft* ] }
{ { t f } [ dup activate-control dup ungraft* ] }
} case
dup gadget-graft-state first { f f } { t t } ?
swap set-gadget-graft-state ;
dup gadget-graft-state dup first { f f } { t t } ? pick set-gadget-graft-state {
{ { f t } [ dup activate-control graft* ] }
{ { t f } [ dup activate-control ungraft* ] }
} case ;
: notify-queued ( -- )
graft-queue [ notify ] dlist-slurp ;