
#include "ming.h"

int main()
{
  SWFShape s;
  SWFMovieClip p;
  SWFMovie m;
  SWFDisplayItem i;

  int j;

  Ming_init();
  Ming_setScale(1.0);

  s = newSWFShape();
  SWFShape_setRightFill(s, SWFShape_addSolidFill(s, 0xff, 0, 0, 0xff));
  SWFShape_movePenTo(s, -500,-500);
  SWFShape_drawLineTo(s, 500,-500);
  SWFShape_drawLineTo(s, 500,500);
  SWFShape_drawLineTo(s, -500,500);
  SWFShape_drawLineTo(s, -500,-500);

  p = newSWFMovieClip();

  i = SWFMovieClip_add(p, s);

  for(j=0; j<17; ++j)
  {
    SWFMovieClip_nextFrame(p);
    SWFDisplayItem_rotate(i, 5);
  }
  SWFMovieClip_nextFrame(p);

  m = newSWFMovie();

  i = SWFMovie_add(m, p);
  SWFDisplayItem_moveTo(i, 1500, 1000);
  SWFDisplayItem_setName(i, "blah");

  SWFMovie_setBackground(m, 0xff, 0xff, 0xff);
  SWFMovie_setDimension(m, 3000, 2000);

  SWFMovie_save(m, "test.swf");

  exit(0);
}
