OpenGL errors are now thrown instaed of just being printed

release
Slava Pestov 2007-11-04 18:06:47 -05:00
parent 4cc86d74ff
commit 092d18d1b9
1 changed files with 4 additions and 3 deletions

View File

@ -1,8 +1,9 @@
! Copyright (C) 2005, 2007 Slava Pestov. ! Copyright (C) 2005, 2007 Slava Pestov.
! Portions copyright (C) 2007 Eduardo Cavazos. ! Portions copyright (C) 2007 Eduardo Cavazos.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.c-types io kernel math namespaces USING: alien alien.c-types kernel math namespaces sequences
sequences math.vectors math.constants math.functions opengl.gl opengl.glu combinators arrays ; math.vectors math.constants math.functions opengl.gl opengl.glu
combinators arrays ;
IN: opengl IN: opengl
: coordinates [ first2 ] 2apply ; : coordinates [ first2 ] 2apply ;
@ -19,7 +20,7 @@ IN: opengl
: gl-error ( -- ) : gl-error ( -- )
glGetError dup zero? [ glGetError dup zero? [
"GL error: " write dup gluErrorString print flush "GL error: " dup gluErrorString append throw
] unless drop ; ] unless drop ;
: do-state ( what quot -- ) : do-state ( what quot -- )