4 // Plib pui needs to know at compile time what toolkit is in use.
5 // Change this when we move to something other than glut.
8 enum { MOUSE_BUTTON_LEFT,
12 enum { MOUSE_BUTTON_DOWN,
15 enum { MOUSE_CURSOR_NONE,
18 MOUSE_CURSOR_CROSSHAIR,
19 MOUSE_CURSOR_LEFTRIGHT };
21 enum { KEYMOD_NONE = 0,
22 KEYMOD_RELEASED = 1, // Not a mod key, indicates "up" action
28 // A note on key codes: none are defined here. FlightGear has no
29 // hard-coded interpretations of codes other than modifier keys, so we
30 // can get away with that. The only firm requirement is that the
31 // codes passed to the fgKeyHandler function be correctly interpreted
32 // by the PUI library. Users who need to hard-code key codes
33 // (probably not a good idea in any case) can use the pu.hxx header
37 // OS integration functions
40 void fgOSInit(int* argc, char** argv);
41 void fgOSOpenWindow(int w, int h, int bpp, bool alpha, bool stencil,
43 void fgOSFullScreen();
46 void fgSetMouseCursor(int cursor);
47 int fgGetMouseCursor();
48 void fgWarpMouse(int x, int y);
50 int fgGetKeyModifiers();
52 void fgRequestRedraw();
55 // Callbacks and registration API
58 typedef void (*fgIdleHandler)();
59 typedef void (*fgDrawHandler)();
60 typedef void (*fgWindowResizeHandler)(int w, int h);
62 typedef void (*fgKeyHandler)(int key, int keymod, int mousex, int mousey);
63 typedef void (*fgMouseClickHandler)(int button, int updown, int x, int y);
64 typedef void (*fgMouseMotionHandler)(int x, int y);
66 void fgRegisterIdleHandler(fgIdleHandler func);
67 void fgRegisterDrawHandler(fgDrawHandler func);
68 void fgRegisterWindowResizeHandler(fgWindowResizeHandler func);
70 void fgRegisterKeyHandler(fgKeyHandler func);
71 void fgRegisterMouseClickHandler(fgMouseClickHandler func);
72 void fgRegisterMouseMotionHandler(fgMouseMotionHandler func);