X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FGUI%2Fgui.cxx;h=2e8305ba419b6b9adf25aba261b78b8224c6a06d;hb=5cad5aa7da2476ca8323a61f81dea59676dca085;hp=77c98d9edeb826f7fbe4cf13a10bdf00f0524dc4;hpb=3db0cf165981bc55c35bd215590b0f90212a860a;p=flightgear.git diff --git a/src/GUI/gui.cxx b/src/GUI/gui.cxx index 77c98d9ed..2e8305ba4 100644 --- a/src/GUI/gui.cxx +++ b/src/GUI/gui.cxx @@ -49,7 +49,8 @@ #include "gui.h" #include "layout.hxx" -using namespace osg; +#include + using namespace flightgear; puFont guiFnt = 0; @@ -67,7 +68,7 @@ public: GUIInitOperation() : GraphicsContextOperation(std::string("GUI init")) { } - void run(GraphicsContext* gc) + void run(osg::GraphicsContext* gc) { WindowSystemAdapter* wsa = WindowSystemAdapter::getWSA(); wsa->puInitialize(); @@ -96,21 +97,21 @@ public: } }; -ref_ptr initOp; +osg::ref_ptr 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;