mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-01 21:21:10 -06:00
Code cleanup
This commit is contained in:
parent
9daae9413a
commit
e79b0a2f25
4 changed files with 4 additions and 49 deletions
|
|
@ -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*/)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue