Bugfix: prevent the "bad drawable" error when showing the OpenGL canvas. #2015 #2099

This commit is contained in:
Alessandro Ranellucci 2014-06-19 10:27:23 +02:00
parent ca7668e1b3
commit cf1b25dfc8

View File

@ -382,8 +382,10 @@ sub InitGL {
sub Render { sub Render {
my ($self, $dc) = @_; my ($self, $dc) = @_;
return unless $self->GetContext; # prevent calling SetCurrent() when window is not shown yet
return unless $self->IsShownOnScreen;
return unless my $context = $self->GetContext;
$self->SetCurrent($self->GetContext); $self->SetCurrent($self->GetContext);
$self->InitGL; $self->InitGL;