Fixing an update of the "Export G-code, Send to printer" and similar buttons.
It is a bug, which was lingering around for a long time, only now the buggy function is called at a time point, where it really hurts. https://github.com/prusa3d/Slic3r/issues/137
This commit is contained in:
parent
31f213d6ca
commit
89702a5b4e
1 changed files with 22 additions and 11 deletions
|
@ -61,7 +61,6 @@ __PACKAGE__->mk_accessors( qw(_quat _dirty init
|
|||
_drag_start_xy
|
||||
_dragged
|
||||
|
||||
layer_editing_enabled
|
||||
_layer_height_edited
|
||||
|
||||
_camera_type
|
||||
|
@ -190,6 +189,28 @@ sub Destroy {
|
|||
return $self->SUPER::Destroy;
|
||||
}
|
||||
|
||||
sub layer_editing_enabled {
|
||||
my ($self, $value) = @_;
|
||||
if (@_ == 2) {
|
||||
$self->{layer_editing_enabled} = $value;
|
||||
if ($value && ! $self->{layer_editing_initialized}) {
|
||||
# Enabling the layer editing for the first time. This triggers compilation of the necessary OpenGL shaders.
|
||||
# If compilation fails, the compile log is printed into the console.
|
||||
$self->{layer_editing_initialized} = 1;
|
||||
my $shader = $self->{shader} = new Slic3r::GUI::GLShader;
|
||||
my $info = $shader->Load($self->_fragment_shader, $self->_vertex_shader);
|
||||
print $info if $info;
|
||||
($self->{layer_preview_z_texture_id}) = glGenTextures_p(1);
|
||||
glBindTexture(GL_TEXTURE_2D, $self->{layer_preview_z_texture_id});
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
}
|
||||
}
|
||||
return $self->{layer_editing_enabled};
|
||||
}
|
||||
|
||||
sub _first_selected_object_id {
|
||||
my ($self) = @_;
|
||||
for my $i (0..$#{$self->volumes}) {
|
||||
|
@ -893,16 +914,6 @@ sub InitGL {
|
|||
return unless $self->GetContext;
|
||||
$self->init(1);
|
||||
|
||||
my $shader = $self->{shader} = new Slic3r::GUI::GLShader;
|
||||
my $info = $shader->Load($self->_fragment_shader, $self->_vertex_shader);
|
||||
# print $info if $info;
|
||||
($self->{layer_preview_z_texture_id}) = glGenTextures_p(1);
|
||||
glBindTexture(GL_TEXTURE_2D, $self->{layer_preview_z_texture_id});
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
|
||||
glClearColor(0, 0, 0, 1);
|
||||
glColor3f(1, 0, 0);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
|
Loading…
Reference in a new issue