#ifdef __WIN32__
#include <windows.h>
#endif

#include <smpeg.h>

#include "PowerPak/powerpak.h"
#include "PowerPak/powerdraw.h"
#include "PowerPak/powermedia.h"

main(int argc, char *argv[])
{
   PM_Mpeg *Mpeg;
   int x, y, i;

   if (argc < 2){
      fprintf (stderr, "Please Specify an Mpeg file\n");
      exit(0);
   }

   /* Initialize the library */
   PP_Init();
   PD_Init();

   /* Initialize 640x480x16bpp graphics mode */
   PD_SetGFXMode(640, 480, 16, PD_DEFAULT);

   Mpeg = PM_CreateMpeg(argv[1]);

//   PM_StartMpeg(Screen, Mpeg, 100, 10);

   /* This is ON by default but it is here to show the syntax */
   PM_ToggleMpegAudio(Mpeg, PM_OFF);

//   while (PM_IsMpegPlaying(Mpeg)){
//      PP_Wait(1);
//for (i=1;i < 200; i++){
		PM_RenderMpegFrame (Screen, Mpeg, 3, 100, 10);
		PD_RectFilled(Screen,0,0,200,100,PD_CreateColor(Screen, 0xff,0x00,0x00));
		PD_UpdateScreen(0,0,200,100);
//	}


   /* Cleanup */
   PM_DestroyMpeg(Mpeg);
   PD_Quit();
   PP_Quit();
}
