FlightGear next
flightgear::WindowSystemAdapter Class Reference

Adapter from windows system / graphics context management API to functions used by flightgear. More...

#include <WindowSystemAdapter.hxx>

Inherits osg::Referenced.

Public Member Functions

 WindowSystemAdapter ()
 
virtual ~WindowSystemAdapter ()
 
GraphicsWindowregisterWindow (osg::GraphicsContext *gc, const std::string &windowName)
 Register a window, assigning it an ID.
 
GraphicsWindowfindWindow (const std::string &name) const
 Find a window by name.
 
GraphicsWindowgetGUIWindow () const
 Get the first window marked as GUI (there should only be one).
 

Static Public Member Functions

static WindowSystemAdaptergetWSA ()
 Get the global WindowSystemAdapter.
 
static void setWSA (WindowSystemAdapter *wsa)
 Set the global adapter.
 

Public Attributes

WindowVector windows
 Vector of all the registered windows.
 

Protected Attributes

int _nextWindowID
 

Static Protected Attributes

static osg::ref_ptr< WindowSystemAdapter_wsa
 

Detailed Description

Adapter from windows system / graphics context management API to functions used by flightgear.

This papers over the difference between osgViewer::Viewer, which handles multiple windows, graphics threads, etc., and the embedded viewer used with GLUT and SDL.

Definition at line 98 of file WindowSystemAdapter.hxx.

Constructor & Destructor Documentation

◆ WindowSystemAdapter()

flightgear::WindowSystemAdapter::WindowSystemAdapter ( )

Definition at line 43 of file WindowSystemAdapter.cxx.

◆ ~WindowSystemAdapter()

virtual flightgear::WindowSystemAdapter::~WindowSystemAdapter ( )
inlinevirtual

Definition at line 102 of file WindowSystemAdapter.hxx.

Member Function Documentation

◆ findWindow()

GraphicsWindow * flightgear::WindowSystemAdapter::findWindow ( const std::string & name) const

Find a window by name.

Parameters
namethe window name
Returns
the window or 0

Definition at line 58 of file WindowSystemAdapter.cxx.

◆ getGUIWindow()

GraphicsWindow * flightgear::WindowSystemAdapter::getGUIWindow ( ) const

Get the first window marked as GUI (there should only be one).

Returns
the first window with GUI in its flags or nullptr

Definition at line 70 of file WindowSystemAdapter.cxx.

◆ getWSA()

static WindowSystemAdapter * flightgear::WindowSystemAdapter::getWSA ( )
inlinestatic

Get the global WindowSystemAdapter.

Returns
the adapter

Definition at line 126 of file WindowSystemAdapter.hxx.

◆ registerWindow()

GraphicsWindow * flightgear::WindowSystemAdapter::registerWindow ( osg::GraphicsContext * gc,
const std::string & windowName )

Register a window, assigning it an ID.

Parameters
gcgraphics context
windowNameinternal name (not displayed)
Returns
a graphics window

Definition at line 49 of file WindowSystemAdapter.cxx.

◆ setWSA()

static void flightgear::WindowSystemAdapter::setWSA ( WindowSystemAdapter * wsa)
inlinestatic

Set the global adapter.

Parameters
wsathe adapter

Definition at line 130 of file WindowSystemAdapter.hxx.

Member Data Documentation

◆ _nextWindowID

int flightgear::WindowSystemAdapter::_nextWindowID
protected

Definition at line 132 of file WindowSystemAdapter.hxx.

◆ _wsa

ref_ptr< WindowSystemAdapter > flightgear::WindowSystemAdapter::_wsa
staticprotected

Definition at line 133 of file WindowSystemAdapter.hxx.

◆ windows

WindowVector flightgear::WindowSystemAdapter::windows

Vector of all the registered windows.

Definition at line 105 of file WindowSystemAdapter.hxx.


The documentation for this class was generated from the following files: