File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -437,7 +437,7 @@ sub PDL::Graphics::TriD::Lines::primitive {OpenGL::Modern::GL_LINES}
437437 PDL::Graphics::TriD::Spheres;
438438use PDL::Graphics::OpenGLQ;
439439use OpenGL::Modern qw(
440- glVertexAttribDivisor glDrawElementsInstancedARB_c
440+ glIsProgram glVertexAttribDivisor glDrawElementsInstancedARB_c
441441 GL_TRIANGLE_STRIP GL_UNSIGNED_INT
442442) ;
443443my $vertex_shader = sprintf <<'EOF' , @SHADERBITS {qw( version vs_in_decl vs_in_light_decl fs_in_light_decl vs_in vs_out vs_out_light) };
@@ -465,7 +465,9 @@ sub togl_setup {
465465 @SPHERE {@KEYS } = gl_sphere(0.025, 15, 15);
466466 }
467467 @{ $this -> {Impl } }{@KEYS } = @SPHERE {@KEYS };
468- $SHADER_PROGRAM //= $this -> compile_program($vertex_shader , $fragment_shader );
468+ if (!defined $SHADER_PROGRAM or !glIsProgram($SHADER_PROGRAM )) {
469+ $SHADER_PROGRAM = $this -> compile_program($vertex_shader , $fragment_shader );
470+ }
469471 if (!defined $this -> {Impl }{program_nodestroy }) {
470472 $this -> {Impl }{program_nodestroy } = $SHADER_PROGRAM ;
471473 $this -> load_attrib(position => $this -> {Impl }{vertices });
You can’t perform that action at this time.
0 commit comments