3rd attempt to fix opengl initialization on linux

This commit is contained in:
Enrico Turri 2018-06-04 14:28:59 +02:00
parent 548f773074
commit af8e869880
8 changed files with 28 additions and 1 deletions

View File

@ -2194,7 +2194,7 @@ sub load_object {
$instance_idxs ||= [0..$#{$model_object->instances}];
#==============================================================================================================================
my $volume_indices = $self->volumes->load_object(
$model_object, $obj_idx, $instance_idxs, $self->color_by, $self->select_by, $self->drag_by, $useVBOs);
$model_object, $obj_idx, $instance_idxs, $self->color_by, $self->select_by, $self->drag_by, $useVBOs && Slic3r::GUI::_3DScene::is_shader_enabled($self));
# my $volume_indices = $self->volumes->load_object(
# $model_object, $obj_idx, $instance_idxs, $self->color_by, $self->select_by, $self->drag_by,
# $self->UseVBOs);

View File

@ -1839,6 +1839,11 @@ bool _3DScene::is_layers_editing_allowed(wxGLCanvas* canvas)
return s_canvas_mgr.is_layers_editing_allowed(canvas);
}
bool _3DScene::is_shader_enabled(wxGLCanvas* canvas)
{
return s_canvas_mgr.is_shader_enabled(canvas);
}
void _3DScene::enable_layers_editing(wxGLCanvas* canvas, bool enable)
{
s_canvas_mgr.enable_layers_editing(canvas, enable);

View File

@ -571,6 +571,7 @@ public:
static bool is_layers_editing_enabled(wxGLCanvas* canvas);
static bool is_layers_editing_allowed(wxGLCanvas* canvas);
static bool is_shader_enabled(wxGLCanvas* canvas);
static void enable_layers_editing(wxGLCanvas* canvas, bool enable);
static void enable_warning_texture(wxGLCanvas* canvas, bool enable);

View File

@ -1175,6 +1175,11 @@ bool GLCanvas3D::is_layers_editing_allowed() const
return m_layers_editing.is_allowed();
}
bool GLCanvas3D::is_shader_enabled() const
{
return m_shader_enabled;
}
void GLCanvas3D::enable_layers_editing(bool enable)
{
m_layers_editing.set_enabled(enable);

View File

@ -359,6 +359,7 @@ public:
bool is_layers_editing_enabled() const;
bool is_layers_editing_allowed() const;
bool is_shader_enabled() const;
void enable_layers_editing(bool enable);
void enable_warning_texture(bool enable);

View File

@ -352,6 +352,12 @@ bool GLCanvas3DManager::is_layers_editing_allowed(wxGLCanvas* canvas) const
return (it != m_canvases.end()) ? it->second->is_layers_editing_allowed() : false;
}
bool GLCanvas3DManager::is_shader_enabled(wxGLCanvas* canvas) const
{
CanvasesMap::const_iterator it = _get_canvas(canvas);
return (it != m_canvases.end()) ? it->second->is_shader_enabled() : false;
}
void GLCanvas3DManager::enable_layers_editing(wxGLCanvas* canvas, bool enable)
{
CanvasesMap::iterator it = _get_canvas(canvas);

View File

@ -75,6 +75,7 @@ public:
bool is_layers_editing_enabled(wxGLCanvas* canvas) const;
bool is_layers_editing_allowed(wxGLCanvas* canvas) const;
bool is_shader_enabled(wxGLCanvas* canvas) const;
void enable_layers_editing(wxGLCanvas* canvas, bool enable);
void enable_warning_texture(wxGLCanvas* canvas, bool enable);

View File

@ -294,6 +294,14 @@ is_layers_editing_allowed(canvas)
OUTPUT:
RETVAL
bool
is_shader_enabled(canvas)
SV *canvas;
CODE:
RETVAL = _3DScene::is_shader_enabled((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
OUTPUT:
RETVAL
void
enable_layers_editing(canvas, enable)
SV *canvas;