Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/xs
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2018-09-19 09:59:11 +0300
committerEnrico Turri <enricoturri@seznam.cz>2018-09-19 09:59:11 +0300
commite79b0a2f25f325ef8643587944ff0ce30f508c96 (patch)
tree4828e1c469dbc017ddc6f78a8c2ec9f0a2028883 /xs
parent9daae9413af4b72e567b4458734d756c98f256a6 (diff)
Code cleanup
Diffstat (limited to 'xs')
-rw-r--r--xs/src/slic3r/GUI/GUI.cpp8
-rw-r--r--xs/src/slic3r/GUI/GUI.hpp4
-rw-r--r--xs/src/slic3r/GUI/GUI_Preview.cpp5
3 files changed, 4 insertions, 13 deletions
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;