From e79b0a2f25f325ef8643587944ff0ce30f508c96 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Wed, 19 Sep 2018 08:59:11 +0200 Subject: Code cleanup --- xs/src/slic3r/GUI/GUI.cpp | 8 +------- xs/src/slic3r/GUI/GUI.hpp | 4 ---- xs/src/slic3r/GUI/GUI_Preview.cpp | 5 +++-- 3 files changed, 4 insertions(+), 13 deletions(-) (limited to 'xs') diff --git a/xs/src/slic3r/GUI/GUI.cpp b/xs/src/slic3r/GUI/GUI.cpp index b3b52e0c6..24d459921 100644 --- a/xs/src/slic3r/GUI/GUI.cpp +++ b/xs/src/slic3r/GUI/GUI.cpp @@ -46,10 +46,8 @@ #include "Tab.hpp" #include "TabIface.hpp" -//############################################################################################################################################################## #include "GUI_Preview.hpp" #include "GUI_PreviewIface.hpp" -//############################################################################################################################################################## #include "AboutDialog.hpp" #include "AppConfig.hpp" #include "ConfigSnapshotDialog.hpp" @@ -152,9 +150,7 @@ wxStaticBitmap *g_manifold_warning_icon = nullptr; bool g_show_print_info = false; bool g_show_manifold_warning_icon = false; -//############################################################################################################################################################## -PreviewIface* g_preview = nullptr; // <<< FIXME ENRICO -> add code to delete the pointer when the application closes -//############################################################################################################################################################## +PreviewIface* g_preview = nullptr; static void init_label_colours() { @@ -673,7 +669,6 @@ TabIface* get_preset_tab_iface(char *name) return new TabIface(nullptr); } -//############################################################################################################################################################## PreviewIface* create_preview_iface(wxNotebook* parent, DynamicPrintConfig* config, Print* print, GCodePreviewData* gcode_preview_data) { if (g_preview == nullptr) @@ -684,7 +679,6 @@ PreviewIface* create_preview_iface(wxNotebook* parent, DynamicPrintConfig* confi return g_preview; } -//############################################################################################################################################################## // opt_index = 0, by the reason of zero-index in ConfigOptionVector by default (in case only one element) void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt_key, const boost::any& value, int opt_index /*= 0*/) diff --git a/xs/src/slic3r/GUI/GUI.hpp b/xs/src/slic3r/GUI/GUI.hpp index a5fb4d44d..8dfaf42c6 100644 --- a/xs/src/slic3r/GUI/GUI.hpp +++ b/xs/src/slic3r/GUI/GUI.hpp @@ -39,11 +39,9 @@ class AppConfig; class PresetUpdater; class DynamicPrintConfig; class TabIface; -//############################################################################################################################################################## class PreviewIface; class Print; class GCodePreviewData; -//############################################################################################################################################################## #define _(s) Slic3r::GUI::I18N::translate((s)) @@ -170,9 +168,7 @@ extern void open_preferences_dialog(int event_preferences); void create_preset_tabs(int event_value_change, int event_presets_changed); TabIface* get_preset_tab_iface(char *name); -//############################################################################################################################################################## PreviewIface* create_preview_iface(wxNotebook* notebook, DynamicPrintConfig* config, Print* print, GCodePreviewData* gcode_preview_data); -//############################################################################################################################################################## // add it at the end of the tab panel. void add_created_tab(Tab* panel, int event_value_change, int event_presets_changed); diff --git a/xs/src/slic3r/GUI/GUI_Preview.cpp b/xs/src/slic3r/GUI/GUI_Preview.cpp index 52d20e18a..50d404e78 100644 --- a/xs/src/slic3r/GUI/GUI_Preview.cpp +++ b/xs/src/slic3r/GUI/GUI_Preview.cpp @@ -57,14 +57,15 @@ bool Preview::init(wxNotebook* notebook, DynamicPrintConfig* config, Print* prin if (!Create(notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize)) return false; - int attribList[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 24, WX_GL_SAMPLE_BUFFERS, 1, WX_GL_SAMPLES, 4, 0 }; + int attribList[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 24, WX_GL_SAMPLE_BUFFERS, GL_TRUE, WX_GL_SAMPLES, 4, 0 }; int wxVersion = wxMAJOR_VERSION * 10000 + wxMINOR_VERSION * 100 + wxRELEASE_NUMBER; const AppConfig* app_config = GUI::get_app_config(); bool enable_multisample = (app_config != nullptr) && (app_config->get("use_legacy_opengl") != "1") && (wxVersion >= 30003); // if multisample is not enabled or supported by the graphic card, remove it from the attributes list - bool can_multisample = enable_multisample && wxGLCanvas::IsDisplaySupported(attribList); // <<< FIXME ENRICO IsDisplaySupported() seems not to work + bool can_multisample = enable_multisample && wxGLCanvas::IsExtensionSupported("WGL_ARB_multisample"); +// bool can_multisample = enable_multisample && wxGLCanvas::IsDisplaySupported(attribList); // <<< Alternative method: but IsDisplaySupported() seems not to work if (!can_multisample) attribList[4] = 0; -- cgit v1.2.3