Index: shader.c
===================================================================
--- shader.c	(revision 684)
+++ shader.c	(revision 685)
@@ -373,7 +373,8 @@
     raydium_log("shader: cannot attach shader: Invalid shader");
     return 0;
     }
-if(texture<=0 || texture>=(int)raydium_texture_index)
+//if(texture<=0 || texture>=(int)raydium_texture_index)
+if(!raydium_texture_is_slot_used(texture))
     {
     raydium_log("shader: cannot attach shader: Invalid texture");
     return 0;
_end[o]);
 #else
+// Experimental Vertex Array Rendering
+raydium_object_render_va(o,1);
+#endif
+#else
     raydium_rendering_from_to_simple(raydium_object_start[o],raydium_object_end[o]);
 #endif
 }
@@ -224,7 +229,11 @@
 
 glColor4f(1,1,1,1);
 
+#ifndef IPHONEOS
 glViewport(0,0,raydium_window_tx,raydium_window_ty);
+#else
+glViewport(0,0,raydium_window_ty,raydium_window_tx);
+#endif
 glEnable(GL_TEXTURE_2D);
 
 glMatrixMode(GL_PROJECTION);