opengl: fix stack effect error in (all-enabled) combinator and add a unit test

db4
Slava Pestov 2009-11-09 00:54:31 -06:00
parent c5387cdcdb
commit 78bd41ae97
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,6 @@
USING: tools.test math opengl opengl.gl ;
IN: opengl.tests
{ 2 1 } [ { GL_TEXTURE_2D } [ + ] all-enabled ] must-infer-as
{ 2 1 } [ { GL_TEXTURE_2D } [ + ] all-enabled-client-state ] must-infer-as

View File

@ -56,7 +56,9 @@ TUPLE: gl-error function code string ;
[ ?execute ] map ;
: (all-enabled) ( seq quot -- )
over [ glEnable ] each dip [ glDisable ] each ; inline
[ dup [ glEnable ] each ] dip
dip
[ glDisable ] each ; inline
: (all-enabled-client-state) ( seq quot -- )
[ dup [ glEnableClientState ] each ] dip