opengl: Temporary (?) fix for the ui. Issue #1379.
Throwing gl errors is not helpful because the ui gets messed up anyway. Print the error and continue. Maybe we should add a section in the F3 error window for opengl errors instead of printing them in the global stdout. - We could also use gl-error on every platform except for MacOSX 10.11 - We could fix the underlying gl drawing commands that cause this error.db4
parent
d3a749d17a
commit
9d021bb081
|
@ -3,9 +3,9 @@
|
||||||
! Portions copyright (C) 2008 Joe Groff.
|
! Portions copyright (C) 2008 Joe Groff.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien alien.c-types alien.data assocs colors
|
USING: alien alien.c-types alien.data assocs colors
|
||||||
combinators.smart continuations fry init kernel locals macros
|
combinators.smart continuations fry init io kernel locals macros
|
||||||
math namespaces opengl.gl sequences sequences.generalizations
|
math math.parser namespaces opengl.gl sequences
|
||||||
specialized-arrays words ;
|
sequences.generalizations specialized-arrays words ;
|
||||||
FROM: alien.c-types => float ;
|
FROM: alien.c-types => float ;
|
||||||
SPECIALIZED-ARRAY: float
|
SPECIALIZED-ARRAY: float
|
||||||
SPECIALIZED-ARRAY: uint
|
SPECIALIZED-ARRAY: uint
|
||||||
|
@ -46,6 +46,14 @@ TUPLE: gl-error-tuple function code string ;
|
||||||
: gl-error ( -- )
|
: gl-error ( -- )
|
||||||
f (gl-error) ; inline
|
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 -- )
|
: do-enabled ( what quot -- )
|
||||||
over glEnable dip glDisable ; inline
|
over glEnable dip glDisable ; inline
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ TUPLE: world-attributes
|
||||||
|
|
||||||
: with-gl-context ( world quot -- )
|
: with-gl-context ( world quot -- )
|
||||||
'[ set-gl-context @ ]
|
'[ set-gl-context @ ]
|
||||||
[ handle>> flush-gl-context gl-error ] bi ; inline
|
[ handle>> flush-gl-context gl-error-nonfatal ] bi ; inline
|
||||||
|
|
||||||
ERROR: no-world-found ;
|
ERROR: no-world-found ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue