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

#include "PowerPak/powerpak.h"
#include "PowerPak/powerinput.h"

main(int argc, char *argv[])
{
  Uint8 *keys;

  PP_Init();
  atexit(PP_Quit);

  fprintf(stderr, "Mouse status demo. Method 2\nLeft Click the middle of the window when it comes up\n");

  PP_Wait(2500);

  /* Use SDL to set 640x480 video mode so as not to depend
  on the PowerDraw lib (we already rely on SDL) */
  if ( SDL_SetVideoMode(640, 480, 0, SDL_SWSURFACE) == NULL ) {
    fprintf(stderr, "Couldn't set 640x480 video mode: %s\n", SDL_GetError());
      exit(2);
  }

  while (1){
    /* The short way */
    if (PI_MouseX() > 290 && PI_MouseX() < 350)
      if (PI_MouseY() > 210 && PI_MouseY() < 270)
        if (PI_IsMouseButtonDown(1))
          exit(0);
  }

  PP_Quit();
}
