]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_os.hxx
cosmetic changes *only*:
[flightgear.git] / src / Main / fg_os.hxx
index ba36a08795f89998a431cfd3a04c16d5d3397e7a..c12e79b7bd0d9aa27d4a662139a5c7ff18ce65ad 100644 (file)
@@ -1,9 +1,17 @@
 #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
+#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,
@@ -23,7 +31,10 @@ enum { KEYMOD_NONE     = 0,
        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
@@ -38,9 +49,10 @@ enum { KEYMOD_NONE     = 0,
 //
 
 void fgOSInit(int* argc, char** argv);
-void fgOSOpenWindow(int w, int h, int bpp, bool alpha);
+void fgOSOpenWindow(bool stencil);
 void fgOSFullScreen();
 void fgOSMainLoop();
+void fgOSExit(int code);
 
 void fgSetMouseCursor(int cursor);
 int  fgGetMouseCursor();
@@ -54,12 +66,15 @@ void fgRequestRedraw();
 // 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);
@@ -70,4 +85,17 @@ void fgRegisterKeyHandler(fgKeyHandler 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