#ifndef _INPUT_H_
#define _INPUT_H_

#include "includes.h"
#include "renderer.h"
#include "control.h"


#define FPSBUFFERSIZE 10

#define MOUSEBTNLEFT 0
#define MOUSEBTNMIDDLE 1
#define MOUSEBTNRIGHT 2
#define MOUSEBTNRELEASED 1
#define MOUSEBTNPRESSED 0


//implement singleton pattern at some point...or even better, make this a library?

class Input
{
public:
       static int mouseX,
                  mouseY,

                  screenX,
                  screenY,

                  windowX,
                  windowY,

                  invertMouse,

                  startPressLeftBtn,
                  startPressRightBtn;

       static bool pressedLeft,
                   pressedRight,
                   pressedMiddle,
                   bShiftDown,
                   bAltDown,
                   bModifierPressed,
                   bTextInput;

       static std::string inputText;

       static std::string savedDrawingDirName;
       static std::string savedCharacterDirName;
       static std::string savedSceneDirName;
       static std::string savedKeyFramesDirName;

       static std::vector<string> savedDrawings;
       static std::vector<string> savedCharacters;
       static std::vector<string> savedScenes;
       static std::vector<string> savedKeyFrames;

       static Vector3f keyVector,          //delta!!!!
                       mouseVector,        //delta!!!!
                       mouse3D;            //mouse position in 3D coordinates (uses picking)

       static double fpsBuffer[FPSBUFFERSIZE];

       static Control  *controller;

       static Actor    *worldTarget;

       static char *debugText;

       static void setup();
       static void update(double deltaTime);

       static void pressedMouse(int button,int state,int x, int y);
       static void moveMouse(int x, int y);
       static void dragMouse(int x, int y);

       static void normalKeyDown(unsigned char key, int x, int y);
       static void specialKeyDown(int key, int x, int y);

       static void keyUp(unsigned char key,int x,int y);
       static void specialKeyUp (int key,int x, int y);

       static void deselectAll();


       static void displayFPS();
       static void drawText(char string[], float x, float y);

       static void saveAll(std::string filename);
       static void loadAll(std::string filename);

       static void getAllDrawings();
       static void getAllCharacters();
       static void getAllScenes();
       static void getAllKeyFrames();
};
#endif
