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:
parent
4d399d7034
commit
3d388d2e93
@ -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,6 +152,7 @@ void ModelViewGadgetWidget::CreateScene()
|
||||
m_World= GLC_Factory::instance()->createWorldFromFile(aircraft);
|
||||
m_ModelBoundingBox= m_World.boundingBox();
|
||||
loadError = false;
|
||||
if (!mvInitGLSuccess)
|
||||
initializeGL();
|
||||
} else {
|
||||
loadError = true;
|
||||
|
@ -90,6 +90,7 @@ private:
|
||||
QString bgFilename;
|
||||
bool vboEnable;
|
||||
bool loadError;
|
||||
bool mvInitGLSuccess;
|
||||
|
||||
AttitudeActual* attActual;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user