17#ifndef FLIGHTGEAR_WINDOWSYSTEMADAPTER_HXX
18#define FLIGHTGEAR_WINDOWSYSTEMADAPTER_HXX 1
23#include <osg/Referenced>
25#include <osg/GraphicsThread>
28#include <simgear/structure/SGAtomic.hxx>
44 int id_,
unsigned flags_ = 0) :
50 osg::ref_ptr<osg::GraphicsContext>
gc;
76 osg::GraphicsOperation(
name, false)
81 virtual void operator()(osg::GraphicsContext* gc);
84 virtual void run(osg::GraphicsContext* gc) = 0;
112 const std::string& windowName);
133 static osg::ref_ptr<WindowSystemAdapter>
_wsa;
GraphicsContextOperation(const std::string &name)
virtual void operator()(osg::GraphicsContext *gc)
Don't override this!
virtual void run(osg::GraphicsContext *gc)=0
The body of the operation.
bool isFinished() const
Test if the operation has completed.
A window with a graphics context and an integer ID.
int id
A unique ID for the window.
unsigned flags
Flags for the window.
GraphicsWindow(osg::GraphicsContext *gc_, const std::string &name_, int id_, unsigned flags_=0)
osg::ref_ptr< osg::GraphicsContext > gc
The OSG graphics context for this window.
std::string name
The window's internal name.
@ GUI
The GUI (and 2D cockpit) will be drawn on this window.
static void setWSA(WindowSystemAdapter *wsa)
Set the global adapter.
GraphicsWindow * getGUIWindow() const
Get the first window marked as GUI (there should only be one).
virtual ~WindowSystemAdapter()
GraphicsWindow * findWindow(const std::string &name) const
Find a window by name.
WindowVector windows
Vector of all the registered windows.
static WindowSystemAdapter * getWSA()
Get the global WindowSystemAdapter.
GraphicsWindow * registerWindow(osg::GraphicsContext *gc, const std::string &windowName)
Register a window, assigning it an ID.
static osg::ref_ptr< WindowSystemAdapter > _wsa
FlightPlan.hxx - defines a full flight-plan object, including departure, cruise, arrival information ...
std::vector< osg::ref_ptr< GraphicsWindow > > WindowVector