diff --git a/src/PrusaSlicer.cpp b/src/PrusaSlicer.cpp index 45e19b3343..ccabc07485 100644 --- a/src/PrusaSlicer.cpp +++ b/src/PrusaSlicer.cpp @@ -182,7 +182,6 @@ int CLI::run(int argc, char **argv) #ifdef SLIC3R_GUI std::vector::iterator it; -#if ENABLE_OPENGL_AUTO_AA_SAMPLES bool opengl_aa = false; it = std::find(m_actions.begin(), m_actions.end(), "opengl-aa"); if (it != m_actions.end()) { @@ -190,7 +189,6 @@ int CLI::run(int argc, char **argv) opengl_aa = true; m_actions.erase(it); } -#endif // ENABLE_OPENGL_AUTO_AA_SAMPLES #if SLIC3R_OPENGL_ES // are we starting as gcodeviewer ? for (auto it = m_actions.begin(); it != m_actions.end(); ++it) { @@ -252,11 +250,7 @@ int CLI::run(int argc, char **argv) #endif // SLIC3R_OPENGL_ES #else // SLIC3R_GUI // If there is no GUI, we shall ignore the parameters. Remove them from the list. -#if ENABLE_OPENGL_AUTO_AA_SAMPLES for (const std::string& s : { "opengl-version", "opengl-compatibility", "opengl-debug", "opengl-aa", "gcodeviewer" }) { -#else - for (const std::string& s : { "opengl-version", "opengl-compatibility", "opengl-debug", "gcodeviewer" }) { -#endif // ENABLE_OPENGL_AUTO_AA_SAMPLES auto it = std::find(m_actions.cbegin(), m_actions.cend(), s); if (it != m_actions.end()) { boost::nowide::cerr << "Parameter '" << s << "' is ignored, this PrusaSlicer build is CLI only." << std::endl; @@ -757,9 +751,7 @@ int CLI::run(int argc, char **argv) params.start_downloader = start_downloader; params.download_url = download_url; params.delete_after_load = delete_after_load; -#if ENABLE_OPENGL_AUTO_AA_SAMPLES params.opengl_aa = opengl_aa; -#endif // ENABLE_OPENGL_AUTO_AA_SAMPLES #if !SLIC3R_OPENGL_ES params.opengl_version = opengl_version; params.opengl_debug = opengl_debug; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 92092fc30f..3e832eef10 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -5014,13 +5014,11 @@ CLIActionsConfigDef::CLIActionsConfigDef() def->cli = "gcodeviewer"; def->set_default_value(new ConfigOptionBool(false)); -#if ENABLE_OPENGL_AUTO_AA_SAMPLES def = this->add("opengl-aa", coBool); def->label = L("Automatic OpenGL antialising samples number selection"); def->tooltip = L("Automatically select the highest number of samples for OpenGL antialising."); def->cli = "opengl-aa"; def->set_default_value(new ConfigOptionBool(false)); -#endif // ENABLE_OPENGL_AUTO_AA_SAMPLES #if !SLIC3R_OPENGL_ES def = this->add("opengl-version", coString); diff --git a/src/libslic3r/Technologies.hpp b/src/libslic3r/Technologies.hpp index aeddcf7997..914c7420af 100644 --- a/src/libslic3r/Technologies.hpp +++ b/src/libslic3r/Technologies.hpp @@ -47,9 +47,6 @@ // Enable smoothing of objects normals #define ENABLE_SMOOTH_NORMALS 0 -// Enable automatic detection of highest number of samples supported for OpenGL antialising -#define ENABLE_OPENGL_AUTO_AA_SAMPLES 1 - // Enable imgui dialog which allows to set the parameters used to export binarized gcode #define ENABLE_BINARIZED_GCODE_DEBUG_WINDOW 0 diff --git a/src/slic3r/GUI/GUI_Init.hpp b/src/slic3r/GUI/GUI_Init.hpp index 1090b696f4..ee1773cf89 100644 --- a/src/slic3r/GUI/GUI_Init.hpp +++ b/src/slic3r/GUI/GUI_Init.hpp @@ -38,9 +38,7 @@ struct GUI_InitParams bool opengl_debug; bool opengl_compatibiity_profile; #endif // !SLIC3R_OPENGL_ES -#if ENABLE_OPENGL_AUTO_AA_SAMPLES bool opengl_aa; -#endif // ENABLE_OPENGL_AUTO_AA_SAMPLES }; int GUI_Run(GUI_InitParams ¶ms); diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index f097f51159..c66763ede8 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -10,9 +10,7 @@ #include "GUI_Preview.hpp" #include "GUI_App.hpp" #include "GUI.hpp" -#if ENABLE_OPENGL_AUTO_AA_SAMPLES #include "GUI_Init.hpp" -#endif // ENABLE_OPENGL_AUTO_AA_SAMPLES #include "I18N.hpp" #include "3DScene.hpp" #include "BackgroundSlicingProcess.hpp" @@ -68,12 +66,8 @@ bool View3D::init(wxWindow* parent, Bed3D& bed, Model* model, DynamicPrintConfig if (!Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 /* disable wxTAB_TRAVERSAL */)) return false; -#if ENABLE_OPENGL_AUTO_AA_SAMPLES const GUI_InitParams* const init_params = wxGetApp().init_params; m_canvas_widget = OpenGLManager::create_wxglcanvas(*this, (init_params != nullptr) ? init_params->opengl_aa : false); -#else - m_canvas_widget = OpenGLManager::create_wxglcanvas(*this); -#endif // ENABLE_OPENGL_AUTO_AA_SAMPLES if (m_canvas_widget == nullptr) return false; @@ -217,12 +211,8 @@ bool Preview::init(wxWindow* parent, Bed3D& bed, Model* model) SetBackgroundColour(GetParent()->GetBackgroundColour()); #endif // _WIN32 -#if ENABLE_OPENGL_AUTO_AA_SAMPLES const GUI_InitParams* const init_params = wxGetApp().init_params; m_canvas_widget = OpenGLManager::create_wxglcanvas(*this, (init_params != nullptr) ? init_params->opengl_aa : false); -#else - m_canvas_widget = OpenGLManager::create_wxglcanvas(*this); -#endif // ENABLE_OPENGL_AUTO_AA_SAMPLES if (m_canvas_widget == nullptr) return false; diff --git a/src/slic3r/GUI/OpenGLManager.cpp b/src/slic3r/GUI/OpenGLManager.cpp index c8472b8d9d..b9b6a5bd42 100644 --- a/src/slic3r/GUI/OpenGLManager.cpp +++ b/src/slic3r/GUI/OpenGLManager.cpp @@ -131,10 +131,8 @@ void OpenGLManager::GLInfo::detect() const if (!GLEW_ARB_compatibility) *const_cast(&m_core_profile) = true; -#if ENABLE_OPENGL_AUTO_AA_SAMPLES int* samples = const_cast(&m_samples); glsafe(::glGetIntegerv(GL_SAMPLES, samples)); -#endif // ENABLE_OPENGL_AUTO_AA_SAMPLES *const_cast(&m_detected) = true; } @@ -214,9 +212,7 @@ std::string OpenGLManager::GLInfo::to_string(bool for_github) const out << b_start << "Renderer: " << b_end << m_renderer << line_end; out << b_start << "GLSL version: " << b_end << m_glsl_version << line_end; out << b_start << "Textures compression: " << b_end << (are_compressed_textures_supported() ? "Enabled" : "Disabled") << line_end; -#if ENABLE_OPENGL_AUTO_AA_SAMPLES out << b_start << "Mutisampling: " << b_end << (can_multisample() ? "Enabled (" + std::to_string(m_samples) + " samples)" : "Disabled") << line_end; -#endif // ENABLE_OPENGL_AUTO_AA_SAMPLES { #if SLIC3R_OPENGL_ES @@ -534,14 +530,9 @@ wxGLContext* OpenGLManager::init_glcontext(wxGLCanvas& canvas, const std::pair= 30003; - s_multisample = - enable_multisample && - // Disable multi-sampling on ChromeOS, as the OpenGL virtualization swaps Red/Blue channels with multi-sampling enabled, - // at least on some platforms. - platform_flavor() != PlatformFlavor::LinuxOnChromium && - wxGLCanvas::IsDisplaySupported(attribList) - ? EMultisampleState::Enabled : EMultisampleState::Disabled; - // Alternative method: it was working on previous version of wxWidgets but not with the latest, at least on Windows - // s_multisample = enable_multisample && wxGLCanvas::IsExtensionSupported("WGL_ARB_multisample"); -} -#endif // !ENABLE_OPENGL_AUTO_AA_SAMPLES - } // namespace GUI } // namespace Slic3r diff --git a/src/slic3r/GUI/OpenGLManager.hpp b/src/slic3r/GUI/OpenGLManager.hpp index 5f58038452..c4f36ca01e 100644 --- a/src/slic3r/GUI/OpenGLManager.hpp +++ b/src/slic3r/GUI/OpenGLManager.hpp @@ -32,9 +32,7 @@ public: bool m_core_profile{ false }; int m_max_tex_size{ 0 }; float m_max_anisotropy{ 0.0f }; -#if ENABLE_OPENGL_AUTO_AA_SAMPLES int m_samples{ 0 }; -#endif // ENABLE_OPENGL_AUTO_AA_SAMPLES std::string m_version_string; Semver m_version = Semver::invalid(); @@ -134,18 +132,9 @@ public: static bool can_multisample() { return s_multisample == EMultisampleState::Enabled; } static bool are_framebuffers_supported() { return (s_framebuffers_type != EFramebufferType::Unknown); } static EFramebufferType get_framebuffers_type() { return s_framebuffers_type; } -#if ENABLE_OPENGL_AUTO_AA_SAMPLES static wxGLCanvas* create_wxglcanvas(wxWindow& parent, bool enable_auto_aa_samples); -#else - static wxGLCanvas* create_wxglcanvas(wxWindow& parent); -#endif // ENABLE_OPENGL_AUTO_AA_SAMPLES static const GLInfo& get_gl_info() { return s_gl_info; } static bool force_power_of_two_textures() { return s_force_power_of_two_textures; } - -private: -#if !ENABLE_OPENGL_AUTO_AA_SAMPLES - static void detect_multisample(const wxGLAttributes& attribList); -#endif // !ENABLE_OPENGL_AUTO_AA_SAMPLES }; } // namespace GUI