From 54205b7df6f34597b17457181986dbc7f9957f4d Mon Sep 17 00:00:00 2001 From: Giles Bathgate Date: Fri, 15 Dec 2017 00:57:29 +0000 Subject: [PATCH] Fixes the GL_MULTISAMPLE and GL_ARRAY_BUFFER_ARB messages on failed launch (#4230) --- lib/Slic3r/GUI/3DScene.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Slic3r/GUI/3DScene.pm b/lib/Slic3r/GUI/3DScene.pm index 72e7d28ef..54acbc471 100644 --- a/lib/Slic3r/GUI/3DScene.pm +++ b/lib/Slic3r/GUI/3DScene.pm @@ -50,8 +50,7 @@ use constant PI => 3.1415927; # Constant to determine if Vertex Buffer objects are used to draw # bed grid and the cut plane for object separation. -use constant HAS_VBO => eval { glGenBuffersARB_p(0); 1 }; - +use constant HAS_VBO => eval { glGenBuffersARB_p(0); GL_ARRAY_BUFFER_ARB; 1 }; # phi / theta angles to orient the camera. use constant VIEW_TOP => [0.0,0.0]; @@ -100,6 +99,7 @@ sub new { $self->GetContext(); } + $self->{can_multisample} = $can_multisample; $self->background(1); $self->_quat((0, 0, 0, 1)); $self->_stheta(45); @@ -744,7 +744,7 @@ sub InitGL { # Set antialiasing/multisampling glDisable(GL_LINE_SMOOTH); glDisable(GL_POLYGON_SMOOTH); - glEnable(GL_MULTISAMPLE); + glEnable(GL_MULTISAMPLE) if ($self->{can_multisample}); # ambient lighting glLightModelfv_p(GL_LIGHT_MODEL_AMBIENT, 0.3, 0.3, 0.3, 1); @@ -769,7 +769,7 @@ sub InitGL { # A handy trick -- have surface material mirror the color. glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); glEnable(GL_COLOR_MATERIAL); - glEnable(GL_MULTISAMPLE); + glEnable(GL_MULTISAMPLE) if ($self->{can_multisample}); } sub Render { @@ -804,6 +804,7 @@ sub Render { glLightfv_p(GL_LIGHT0, GL_DIFFUSE, 0.5, 0.5, 0.5, 1); if ($self->enable_picking) { + glDisable(GL_MULTISAMPLE) if ($self->{can_multisample}); glDisable(GL_LIGHTING); $self->draw_volumes(1); glFlush();