#ifndef GLEYE_H
#define GLEYE_H

#define GLEYE_LEFT_BUTTON       0
#define GLEYE_MIDDLE_BUTTON     1
#define GLEYE_RIGHT_BUTTON      2

#define SETBIT(i,offset) (i|=(1<<offset))
#define CLEARBIT(i,offset) (i=((i|1<<offset)-(1<<offset)))
#define ISSET(i,offset) (i&(1<<offset))

typedef struct callbacks_s {
  void (*idleFunc)(void) ;
  void (*keyboardFunc)(unsigned char key, int x, int y) ;
  void (*motionFunc)(int x, int y) ;
  void (*mouseFunc)(int button, int state, int x, int y) ;
  void (*specialFunc)(int code, int x, int y) ;
} callbacks_t ;

extern callbacks_t gleyeCallbacks ;
extern void gleyeSetInputCallbacks (callbacks_t c) ;

typedef struct gleyedata_s {
  int triggers ; /* state of mouse buttons and misc. keys */
  int mouse_last_x, mouse_last_y ; // used for mouse tracking
  float camera_x, camera_y, camera_z ; // position of eye (absolute coords)
  float speed_x, speed_y, speed_z ; // speed vector (absolute coords, pix/sec)
  float azimuth, elevation, roll ; // angles (from canonical Oxyz)
} gleyedata_t ;
extern gleyedata_t gleyedata ;

#endif
