#include <plib/pu.h>
-#include <Include/general.hxx>
#include <Main/main.hxx>
#include <Main/globals.hxx>
#include <Main/fg_props.hxx>
#include "gui.h"
#include "layout.hxx"
-using namespace osg;
+#include <osg/GraphicsContext>
+
using namespace flightgear;
puFont guiFnt = 0;
GUIInitOperation() : GraphicsContextOperation(std::string("GUI init"))
{
}
- void run(GraphicsContext* gc)
+ void run(osg::GraphicsContext* gc)
{
WindowSystemAdapter* wsa = WindowSystemAdapter::getWSA();
wsa->puInitialize();
}
};
-ref_ptr<GUIInitOperation> initOp;
+osg::ref_ptr<GUIInitOperation> initOp;
}
-void guiStartInit()
+void guiStartInit(osg::GraphicsContext* gc)
{
- initOp = new GUIInitOperation;
- WindowSystemAdapter* wsa = WindowSystemAdapter::getWSA();
- GraphicsContext* gc = wsa->getGUIGraphicsContext();
- gc->add(initOp.get());
+ if (gc) {
+ initOp = new GUIInitOperation;
+ gc->add(initOp.get());
+ }
}
bool guiFinishInit()
{
if (!initOp.valid())
- return false;
+ return true;
if (!initOp->isFinished())
return false;
initOp = 0;