# a small example of how to use raw video output. load-opengl 320 240 display 2d animation # setup display variable raw-stream # open a file for writing "/tmp/dump.raw" "w" open-file raw-stream ! # 'print-atom' will transfer the raw data of a packet into the # stream. as opposed to 'write-atom' which will add metadata. : record raw-stream @ print-atom ; "( bitmap -- )\tSave one bitmap to file." doc # some simple animation : drawit .2 scale normal transx normal transy 1. square m-push 1.2 transx 1 0 0 rgb .5 square m-pop 1.2 transy 0 1 0 rgb .5 square ; :: drawit # draw scene display>rgb # grab screen to rgb bitmap record # write it to the file ; is drawer : done { undef raw-stream ! # closes file { } is drawer # stop drawing } is drawer ; "type 'done' to close the video file." p cr interactive