Tech ENABLE_OPENGL_DEBUG_OPTION - Let option opengl-debug be always available to avoid error unknown option at startup

This commit is contained in:
enricoturri1966 2022-07-13 10:06:57 +02:00
parent 22b634ca1d
commit e0c8ffc524
4 changed files with 4 additions and 13 deletions

View File

@ -192,16 +192,14 @@ int CLI::run(int argc, char **argv)
m_actions.erase(it); m_actions.erase(it);
} }
#if ENABLE_OPENGL_DEBUG_OPTION
#ifndef __APPLE__
it = std::find(m_actions.begin(), m_actions.end(), "opengl-debug"); it = std::find(m_actions.begin(), m_actions.end(), "opengl-debug");
if (it != m_actions.end()) { if (it != m_actions.end()) {
start_gui = true; start_gui = true;
#if ENABLE_OPENGL_DEBUG_OPTION
opengl_debug = true; opengl_debug = true;
#endif // ENABLE_OPENGL_DEBUG_OPTION
m_actions.erase(it); m_actions.erase(it);
} }
#endif // __APPLE__
#endif // ENABLE_OPENGL_DEBUG_OPTION
#else #else
// are we starting as gcodeviewer ? // are we starting as gcodeviewer ?
for (auto it = m_actions.begin(); it != m_actions.end(); ++it) { for (auto it = m_actions.begin(); it != m_actions.end(); ++it) {

View File

@ -4311,13 +4311,11 @@ CLIActionsConfigDef::CLIActionsConfigDef()
def->cli = "opengl-core"; def->cli = "opengl-core";
def->set_default_value(new ConfigOptionString()); def->set_default_value(new ConfigOptionString());
#if ENABLE_OPENGL_DEBUG_OPTION
def = this->add("opengl-debug", coBool); def = this->add("opengl-debug", coBool);
def->label = L("OpenGL debug output"); def->label = L("OpenGL debug output");
def->tooltip = L("Activate OpenGL debug output on graphic cards which support it"); def->tooltip = L("Activate OpenGL debug output on graphic cards which support it");
def->cli = "opengl-debug"; def->cli = "opengl-debug";
def->set_default_value(new ConfigOptionBool(false)); def->set_default_value(new ConfigOptionBool(false));
#endif // ENABLE_OPENGL_DEBUG_OPTION
#endif // ENABLE_GL_CORE_PROFILE #endif // ENABLE_GL_CORE_PROFILE
def = this->add("slice", coBool); def = this->add("slice", coBool);

View File

@ -66,11 +66,6 @@ const std::string& OpenGLManager::GLInfo::get_renderer() const
return m_renderer; return m_renderer;
} }
bool OpenGLManager::GLInfo::is_core_profile() const
{
return !GLEW_ARB_compatibility;
}
bool OpenGLManager::GLInfo::is_mesa() const bool OpenGLManager::GLInfo::is_mesa() const
{ {
return boost::icontains(m_version, "mesa"); return boost::icontains(m_version, "mesa");
@ -392,7 +387,7 @@ bool OpenGLManager::init_gl()
wxMessageBox(message, wxString("PrusaSlicer - ") + _L("Error loading shaders"), wxOK | wxICON_ERROR); wxMessageBox(message, wxString("PrusaSlicer - ") + _L("Error loading shaders"), wxOK | wxICON_ERROR);
} }
#if ENABLE_OPENGL_DEBUG_OPTION #if ENABLE_OPENGL_DEBUG_OPTION
if (m_debug_enabled) { if (m_debug_enabled && GLEW_KHR_debug) {
::glEnable(GL_DEBUG_OUTPUT); ::glEnable(GL_DEBUG_OUTPUT);
::glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS); ::glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
::glDebugMessageCallback(CustomGLDebugOutput, nullptr); ::glDebugMessageCallback(CustomGLDebugOutput, nullptr);

View File

@ -44,7 +44,7 @@ public:
const std::string& get_vendor() const; const std::string& get_vendor() const;
const std::string& get_renderer() const; const std::string& get_renderer() const;
bool is_core_profile() const; bool is_core_profile() const { return m_core_profile; }
void set_core_profile(bool value) { m_core_profile = value; } void set_core_profile(bool value) { m_core_profile = value; }
bool is_mesa() const; bool is_mesa() const;