Example #1
0
func main() {
	count := uint(30)
	width := uint(1920)
	height := uint(1080)
	flag.UintVar(&count, "framecnt", count, "Frames generated per simulation packet")
	flag.UintVar(&width, "width", width, "Width of output surface")
	flag.UintVar(&height, "height", height, "Height of output surface")
	flag.Parse()

	yard := ext.StdExtensions()
	shapes := animate.StdShapes
	groups := animate.StdGroupFacts

	fact := animate.RenderFactory{}
	fact.Width = width
	fact.Height = height
	fact.Yard = yard
	fact.Framecnt = count
	fact.EntShapes = shapes
	fact.EntGroups = groups
	frtun := runFrameTunnel(fact)

	for frch := range frtun {
		for fr := range frch {
			werr := animate.WriteFrame(fr, os.Stdout)
			if werr != nil {
				fmt.Fprintf(os.Stderr, "Warning: %v", werr)
			}
		}
	}
}
func main() {
	input, inerr := lib.ReadSimPkt(os.Stdin)
	if inerr != nil {
		fatal(inerr)
	}

	extensions := ext.StdExtensions()
	outch, simerr := lib.Simulate(input, extensions)

	if simerr != nil {
		fatal(simerr)
	}

	for out := range outch {
		werr := lib.WriteSimPkt(out, os.Stdout)
		if werr != nil {
			break
		}
	}
}