mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-17 02:52:12 +01:00
OP-175/Ground: Hopefully fixed some Modelview crashes on Windows due to VBO enabled by default in GLC_Lib.
Added debug message displaying current VBO states (enabled, supported, used) - check with mouse right-click. Please confirm that this does not break the plugin on other systems and that VBO can be enabled and really is used by GLC_lib on supported systems. Also changed default 3ds model path. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1850 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
2bcb053ac1
commit
9f34044d74
@ -30,7 +30,7 @@
|
||||
|
||||
ModelViewGadgetConfiguration::ModelViewGadgetConfiguration(QString classId, QSettings* qSettings, QObject *parent) :
|
||||
IUAVGadgetConfiguration(classId, parent),
|
||||
m_acFilename("../share/models/Easystar/EasyStar.3ds"),
|
||||
m_acFilename("../share/openpilotgcs/models/Easystar/EasyStar.3ds"),
|
||||
m_bgFilename(""),
|
||||
m_enableVbo(false)
|
||||
{
|
||||
|
@ -38,7 +38,11 @@ ModelViewGadgetWidget::ModelViewGadgetWidget(QWidget *parent)
|
||||
, m_MoverController()
|
||||
, m_ModelBoundingBox()
|
||||
, m_MotionTimer()
|
||||
, vboEnable(false)
|
||||
{
|
||||
// Prevent crash on non-VBO enabled systems during GLC geometry creation
|
||||
GLC_State::setVboUsage(vboEnable);
|
||||
|
||||
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||
mvInitGLSuccess = false;
|
||||
|
||||
@ -82,9 +86,11 @@ void ModelViewGadgetWidget::initializeGL()
|
||||
return;
|
||||
// OpenGL initialization
|
||||
m_GlView.initGl();
|
||||
if (!vboEnable)
|
||||
|
||||
// Enable VBO usage if configured (default is to disable)
|
||||
GLC_State::setVboUsage(vboEnable);
|
||||
if (!vboEnable)
|
||||
{
|
||||
GLC_State::setVboUsage(false);
|
||||
qDebug("VBOs disabled. Enable for better performance if GPU supports it. (Most do)");
|
||||
}
|
||||
|
||||
@ -184,6 +190,10 @@ void ModelViewGadgetWidget::mousePressEvent(QMouseEvent *e)
|
||||
updateGL();
|
||||
break;
|
||||
case (Qt::RightButton):
|
||||
printf("VBO enabled: %s, VBO supported: %s, VBO used: %s\n",
|
||||
vboEnable ? "yes" : "no",
|
||||
GLC_State::vboSupported() ? "yes" : "no",
|
||||
GLC_State::vboUsed() ? "yes" : "no");
|
||||
printf("Renderer - %s \n", (char*)glGetString(GL_RENDERER));
|
||||
printf("Extensions - %s\n", (char*)glGetString(GL_EXTENSIONS));
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user