1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +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() , m_MotionTimer()
{ {
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
mvInitGLSuccess = false;
CreateScene(); CreateScene();
@ -122,6 +123,8 @@ void ModelViewGadgetWidget::paintGL()
// Display UI Info (orbit circle) // Display UI Info (orbit circle)
m_MoverController.drawActiveMoverRep(); m_MoverController.drawActiveMoverRep();
mvInitGLSuccess = true;
} }
void ModelViewGadgetWidget::resizeGL(int width, int height) void ModelViewGadgetWidget::resizeGL(int width, int height)
@ -149,6 +152,7 @@ void ModelViewGadgetWidget::CreateScene()
m_World= GLC_Factory::instance()->createWorldFromFile(aircraft); m_World= GLC_Factory::instance()->createWorldFromFile(aircraft);
m_ModelBoundingBox= m_World.boundingBox(); m_ModelBoundingBox= m_World.boundingBox();
loadError = false; loadError = false;
if (!mvInitGLSuccess)
initializeGL(); initializeGL();
} else { } else {
loadError = true; loadError = true;

View File

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