Disable lighting on machines that don't support shaders.

This commit is contained in:
Leonardo Zide 2017-04-26 21:52:51 -07:00
parent 8da318037d
commit 219f9635db
2 changed files with 6 additions and 1 deletions

View file

@ -97,6 +97,9 @@ lcQGLWidget::lcQGLWidget(QWidget *parent, lcGLWidget *owner, bool view)
lcContext::CreateResources();
View::CreateResources(widget->mContext);
if (!gSupportsShaderObjects)
lcGetPreferences().mLightingMode = LC_LIGHTING_UNLIT;
gPlaceholderMesh = new lcMesh;
gPlaceholderMesh->CreateBox();
}

View file

@ -7,6 +7,7 @@
#include "lc_library.h"
#include "lc_application.h"
#include "lc_qutils.h"
#include "lc_glextensions.h"
#include "pieceinf.h"
lcQPreferencesDialog::lcQPreferencesDialog(QWidget *parent, void *data) :
@ -46,7 +47,8 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget *parent, void *data) :
ui->gridLines->setChecked(options->Preferences.mDrawGridLines);
ui->gridLineSpacing->setText(QString::number(options->Preferences.mGridLineSpacing));
ui->axisIcon->setChecked(options->Preferences.mDrawAxes);
ui->enableLighting->setChecked(options->Preferences.mLightingMode != LC_LIGHTING_UNLIT);
ui->enableLighting->setChecked(options->Preferences.mLightingMode != LC_LIGHTING_UNLIT && gSupportsShaderObjects);
ui->enableLighting->setEnabled(gSupportsShaderObjects);
QPixmap pix(12, 12);