#ifndef _FG_OS_HXX
#define _FG_OS_HXX
-// Plib pui needs to know at compile time what toolkit is in use.
-// Change this when we move to something other than glut.
-// #define PU_USE_GLUT -- moved to configure.ac -- EMH
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
+#include <string>
+#include <vector>
+
+#include <osg/ref_ptr>
+#include <osg/Camera>
+#include <osg/GraphicsContext>
+
enum { MOUSE_BUTTON_LEFT,
MOUSE_BUTTON_MIDDLE,
KEYMOD_SHIFT = 2,
KEYMOD_CTRL = 4,
KEYMOD_ALT = 8,
- KEYMOD_MAX = 16 };
+ KEYMOD_META = 16,
+ KEYMOD_SUPER = 32,
+ KEYMOD_HYPER = 64,
+ KEYMOD_MAX = 128 };
// A note on key codes: none are defined here. FlightGear has no
// hard-coded interpretations of codes other than modifier keys, so we
//
void fgOSInit(int* argc, char** argv);
-void fgOSOpenWindow(int w, int h, int bpp, bool alpha, bool stencil,
- bool fullscreen);
+void fgOSOpenWindow(bool stencil);
void fgOSFullScreen();
void fgOSMainLoop();
+void fgOSExit(int code);
void fgSetMouseCursor(int cursor);
int fgGetMouseCursor();
// Callbacks and registration API
//
+namespace osg { class Camera; class GraphicsContext; }
+namespace osgGA { class GUIEventAdapter; }
+
typedef void (*fgIdleHandler)();
typedef void (*fgDrawHandler)();
typedef void (*fgWindowResizeHandler)(int w, int h);
typedef void (*fgKeyHandler)(int key, int keymod, int mousex, int mousey);
-typedef void (*fgMouseClickHandler)(int button, int updown, int x, int y);
+typedef void (*fgMouseClickHandler)(int button, int updown, int x, int y, bool mainWindow, const osgGA::GUIEventAdapter*);
typedef void (*fgMouseMotionHandler)(int x, int y);
void fgRegisterIdleHandler(fgIdleHandler func);
void fgRegisterMouseClickHandler(fgMouseClickHandler func);
void fgRegisterMouseMotionHandler(fgMouseMotionHandler func);
+bool fgOSIsMainCamera(const osg::Camera* camera);
+bool fgOSIsMainContext(const osg::GraphicsContext* context);
+
+/** Get graphics context of the main camera. This is the principal
+ * window in multi-window configurations, or the only window in an
+ * embedded configuration. The GUI will be added to this context.
+ */
+osg::GraphicsContext* fgOSGetMainContext();
+
+
+
+
+
#endif // _FG_OS_HXX