1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Modelview: another ugly fix to complte the first one. There is a lingering issue of initing the GL context on the first valid

model that is loaded, this fix addresses it but it could be much more elegant, I'm sure.


git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1576 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
edouard 2010-09-10 15:25:05 +00:00 committed by edouard
parent 4d399d7034
commit 3d388d2e93
2 changed files with 6 additions and 1 deletions

View File

@ -40,6 +40,7 @@ ModelViewGadgetWidget::ModelViewGadgetWidget(QWidget *parent)
, m_MotionTimer()
{
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
mvInitGLSuccess = false;
CreateScene();
@ -122,6 +123,8 @@ void ModelViewGadgetWidget::paintGL()
// Display UI Info (orbit circle)
m_MoverController.drawActiveMoverRep();
mvInitGLSuccess = true;
}
void ModelViewGadgetWidget::resizeGL(int width, int height)
@ -149,7 +152,8 @@ void ModelViewGadgetWidget::CreateScene()
m_World= GLC_Factory::instance()->createWorldFromFile(aircraft);
m_ModelBoundingBox= m_World.boundingBox();
loadError = false;
initializeGL();
if (!mvInitGLSuccess)
initializeGL();
} else {
loadError = true;
}

View File

@ -90,6 +90,7 @@ private:
QString bgFilename;
bool vboEnable;
bool loadError;
bool mvInitGLSuccess;
AttitudeActual* attActual;
};