Checking for OpenGL driver version in the GUI slicer and giving some

reasonable advice to the user in case OpenGL < 2.0 was detected.
This commit is contained in:
bubnikv 2019-08-20 16:38:03 +02:00
parent 2e7d5e5bc1
commit 88dcb7f366
2 changed files with 15 additions and 2 deletions

View file

@ -60,7 +60,6 @@ PrinterTechnology get_printer_technology(const DynamicConfig &config)
int CLI::run(int argc, char **argv) int CLI::run(int argc, char **argv)
{ {
#ifdef _WIN32
// Switch boost::filesystem to utf8. // Switch boost::filesystem to utf8.
try { try {
boost::nowide::nowide_filesystem(); boost::nowide::nowide_filesystem();
@ -74,12 +73,12 @@ int CLI::run(int argc, char **argv)
SLIC3R_APP_NAME " will now terminate.\n\n") + ex.what(); SLIC3R_APP_NAME " will now terminate.\n\n") + ex.what();
#ifdef SLIC3R_GUI #ifdef SLIC3R_GUI
if (m_actions.empty()) if (m_actions.empty())
// Empty actions means Slicer is executed in the GUI mode. Show a GUI message.
MessageBoxA(NULL, text.c_str(), caption.c_str(), MB_OK | MB_ICONERROR); MessageBoxA(NULL, text.c_str(), caption.c_str(), MB_OK | MB_ICONERROR);
#endif #endif
boost::nowide::cerr << text.c_str() << std::endl; boost::nowide::cerr << text.c_str() << std::endl;
return 1; return 1;
} }
#endif
if (! this->setup(argc, argv)) if (! this->setup(argc, argv))
return 1; return 1;

View file

@ -293,6 +293,20 @@ bool GUI_App::on_init_inner()
config_wizard_startup(app_conf_exists); config_wizard_startup(app_conf_exists);
preset_updater->slic3r_update_notify(); preset_updater->slic3r_update_notify();
preset_updater->sync(preset_bundle); preset_updater->sync(preset_bundle);
const GLCanvas3DManager::GLInfo &glinfo = GLCanvas3DManager::get_gl_info();
if (! glinfo.is_version_greater_or_equal_to(2, 0)) {
// Complain about the OpenGL version.
wxString message = wxString::Format(
_(L("PrusaSlicer requires OpenGL 2.0 capable graphics driver to run correctly, \n"
"while OpenGL version %s, render %s, vendor %s was detected.")), wxString(glinfo.get_version()), wxString(glinfo.get_renderer()), wxString(glinfo.get_vendor()));
message += "\n";
message += _(L("You may need to update your graphics card driver."));
#ifdef _WIN32
message += "\n";
message += _(L("As a workaround, you may run PrusaSlicer with a software rendered 3D graphics by running prusa-slicer.exe with the --sw_renderer parameter."));
#endif
wxMessageBox(message, wxString("PrusaSlicer - ") + _(L("Unsupported OpenGL version")), wxOK | wxICON_ERROR);
}
}); });
} }
}); });