diff --git a/basis/opengl/opengl.factor b/basis/opengl/opengl.factor index 55c2b766cd..26a3410677 100644 --- a/basis/opengl/opengl.factor +++ b/basis/opengl/opengl.factor @@ -3,9 +3,9 @@ ! Portions copyright (C) 2008 Joe Groff. ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.c-types alien.data assocs colors -combinators.smart continuations fry init kernel locals macros -math namespaces opengl.gl sequences sequences.generalizations -specialized-arrays words ; +combinators.smart continuations fry init io kernel locals macros +math math.parser namespaces opengl.gl sequences +sequences.generalizations specialized-arrays words ; FROM: alien.c-types => float ; SPECIALIZED-ARRAY: float SPECIALIZED-ARRAY: uint @@ -46,6 +46,14 @@ TUPLE: gl-error-tuple function code string ; : gl-error ( -- ) f (gl-error) ; inline +: gl-error-nonfatal ( -- ) + gl-error-code [ + [ + [ number>string ] [ error>string ] bi ": " glue + "OpenGL error: " prepend print flush + ] with-global + ] when* ; + : do-enabled ( what quot -- ) over glEnable dip glDisable ; inline diff --git a/basis/ui/gadgets/worlds/worlds.factor b/basis/ui/gadgets/worlds/worlds.factor index 51e95ac4cc..f4b494fa3f 100644 --- a/basis/ui/gadgets/worlds/worlds.factor +++ b/basis/ui/gadgets/worlds/worlds.factor @@ -97,7 +97,7 @@ TUPLE: world-attributes : with-gl-context ( world quot -- ) '[ set-gl-context @ ] - [ handle>> flush-gl-context gl-error ] bi ; inline + [ handle>> flush-gl-context gl-error-nonfatal ] bi ; inline ERROR: no-world-found ;