FlightGear next
WindowBuilder.hxx
Go to the documentation of this file.
1// Copyright (C) 2008 Tim Moore
2//
3// This program is free software; you can redistribute it and/or
4// modify it under the terms of the GNU General Public License as
5// published by the Free Software Foundation; either version 2 of the
6// License, or (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful, but
9// WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11// General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License
14// along with this program; if not, write to the Free Software
15// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
17#ifndef FLIGHTGEAR_WINDOWBUILDER_HXX
18#define FLIGHTGEAR_WINDOWBUILDER_HXX 1
19
20#include <osg/ref_ptr>
21#include <osg/Referenced>
22#include <osg/GraphicsContext>
23
24#include <string>
25
26class SGPropertyNode;
27
28namespace flightgear
29{
30
31const char DEFAULT_WINDOW_NAME[] = "FlightGear";
32
33class GraphicsWindow;
39class WindowBuilder : public osg::Referenced
40{
41public:
45 static void initWindowBuilder();
48 static WindowBuilder* getWindowBuilder() { return windowBuilder.get(); }
53 GraphicsWindow* buildWindow(const SGPropertyNode* winNode);
54
55 static void setPoseAsStandaloneApp(bool b);
56protected:
58
59 void setFullscreenTraits(const SGPropertyNode* winNode, osg::GraphicsContext::Traits* traits);
60 bool setWindowedTraits(const SGPropertyNode* winNode, osg::GraphicsContext::Traits* traits);
61
62 void setMacPoseAsStandaloneApp(osg::GraphicsContext::Traits* traits) const;
63
64 void makeDefaultTraits();
65
66 osg::ref_ptr<osg::GraphicsContext::Traits> defaultTraits;
68
69 static osg::ref_ptr<WindowBuilder> windowBuilder;
71};
72
73}
74#endif
A window with a graphics context and an integer ID.
bool setWindowedTraits(const SGPropertyNode *winNode, osg::GraphicsContext::Traits *traits)
osg::ref_ptr< osg::GraphicsContext::Traits > defaultTraits
static WindowBuilder * getWindowBuilder()
Get the singleton window builder.
GraphicsWindow * buildWindow(const SGPropertyNode *winNode)
Create a window from its property node description.
void setMacPoseAsStandaloneApp(osg::GraphicsContext::Traits *traits) const
void setFullscreenTraits(const SGPropertyNode *winNode, osg::GraphicsContext::Traits *traits)
static osg::ref_ptr< WindowBuilder > windowBuilder
static void initWindowBuilder()
Initialize the singleton window builder.
static void setPoseAsStandaloneApp(bool b)
FlightPlan.hxx - defines a full flight-plan object, including departure, cruise, arrival information ...
Definition Addon.cxx:53
const char DEFAULT_WINDOW_NAME[]