Skip to content

Commit 8f28a72

Browse files
committed
::Spheres only keep reloading offset, not sphere data
1 parent 7fa0f53 commit 8f28a72

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • lib/PDL/Graphics/TriD

lib/PDL/Graphics/TriD/GL.pm

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,12 +448,14 @@ sub togl_setup {
448448
}
449449
@{ $this->{Impl} }{@KEYS} = @SPHERE{@KEYS};
450450
$SHADER_PROGRAM //= $this->compile_program($vertex_shader, $fragment_shader);
451-
$this->{Impl}{program_nodestroy} = $SHADER_PROGRAM;
452-
$this->load_attrib(position => $this->{Impl}{vertices});
453-
$this->load_attrib(normal => $this->{Impl}{normals});
451+
if (!defined $this->{Impl}{program_nodestroy}) {
452+
$this->{Impl}{program_nodestroy} = $SHADER_PROGRAM;
453+
$this->load_attrib(position => $this->{Impl}{vertices});
454+
$this->load_attrib(normal => $this->{Impl}{normals});
455+
$this->load_idx_buffer(indx_buf => $this->{Impl}{idx});
456+
}
454457
$this->{Impl}{offset_loc} = $this->load_attrib(offset => $points);
455458
$this->{Impl}{noffset} = $points->dim(1);
456-
$this->load_idx_buffer(indx_buf => $this->{Impl}{idx});
457459
$this->togl_unbind;
458460
}
459461
sub gdraw {

0 commit comments

Comments
 (0)