opengl: fix stack effect error in (all-enabled) combinator and add a unit test
							parent
							
								
									c5387cdcdb
								
							
						
					
					
						commit
						78bd41ae97
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue