Advertisement
Guest User

Untitled

a guest
May 28th, 2015
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1.  
  2. import snow.api.buffers.Uint8Array;
  3. import snow.modules.opengl.GL;
  4.  
  5. //....
  6.  
  7. override function onkeyup( e:KeyEvent ) {
  8.  
  9. if(e.keycode == Key.key_h) {
  10.  
  11. var w:Int = Std.int(Luxe.screen.w);
  12. var h:Int = Std.int(Luxe.screen.h);
  13.  
  14. if(pix == null) pix = new Uint8Array(w * h * 3);
  15.  
  16. GL.readPixels(0, 0, w, h, GL.RGB, GL.UNSIGNED_BYTE, pix);
  17.  
  18. trace('${pix[0]} ${pix[1]} ${pix[2]}');
  19.  
  20. Luxe.snow.io.data_save('/Users/sven/dev/test.raw', pix);
  21.  
  22. }
  23.  
  24. } //onkeyup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement