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
Doug Coleman 2015-08-04 12:23:55 -07:00
parent d3a749d17a
commit 9d021bb081
2 changed files with 12 additions and 4 deletions

View File

@ -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

View File

@ -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 ;