Skip to content

Commit c252132

Browse files
committed
rename load_uniform to set_uniform
1 parent 3defab3 commit c252132

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

  • lib/PDL/Graphics/TriD

lib/PDL/Graphics/TriD/GL.pm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,13 @@ sub load_attrib {
237237
my %SUFFIX2FUNC = (
238238
'1i' => \&glUniform1i,
239239
);
240-
sub load_uniform {
240+
sub set_uniform {
241241
my ($this, $name, $suffix, $value) = @_;
242-
PDL::barf "load_uniform: value must be array-ref" unless ref($value) eq 'ARRAY';
243-
PDL::barf "load_uniform: unknown suffix '$suffix'" unless $SUFFIX2FUNC{$suffix};
244-
PDL::barf "load_uniform: no program found" unless
242+
PDL::barf "set_uniform: value must be array-ref" unless ref($value) eq 'ARRAY';
243+
PDL::barf "set_uniform: unknown suffix '$suffix'" unless $SUFFIX2FUNC{$suffix};
244+
PDL::barf "set_uniform: no program found" unless
245245
my ($program) = grep defined, @{ $this->{Impl} }{qw(program program_nodestroy)};
246-
PDL::barf "load_uniform: invalid name '$name'" if 0 >
246+
PDL::barf "set_uniform: invalid name '$name'" if 0 >
247247
(my $loc = glGetUniformLocation($program, $name));
248248
$this->{Impl}{uniform_indices}{$name} = [ $loc, $suffix, $value ];
249249
$loc;
@@ -544,7 +544,7 @@ sub togl_setup {
544544
if ($need_load) {
545545
$this->load_attrib(position => $this->{Impl}{vertices});
546546
$this->load_attrib(normal => $this->{Impl}{normals});
547-
$this->load_uniform(lightind => '1i' => [0]);
547+
$this->set_uniform(lightind => '1i' => [0]);
548548
$this->load_idx_buffer(indx_buf => $this->{Impl}{idx});
549549
}
550550
$this->{Impl}{offset_loc} = $this->load_attrib(offset => $points);
@@ -611,12 +611,12 @@ sub togl_setup {
611611
} else {
612612
$this->load_attrib(texcoord => $this->{TexCoord});
613613
$this->load_texture(tex_id => $this->{TexColors}, GL_RGB, ($this->{TexColors}->dims)[1,2], GL_RGB);
614-
$this->load_uniform(tex => '1i' => [0]); # must be texture unit, not ID
614+
$this->set_uniform(tex => '1i' => [0]); # must be texture unit, not ID
615615
}
616616
$this->load_idx_buffer(indx_buf => $this->{Faceidx});
617617
if ($shading > 2) {
618618
$this->load_attrib(normal => $this->{Normals});
619-
$this->load_uniform(lightind => '1i' => [0]);
619+
$this->set_uniform(lightind => '1i' => [0]);
620620
}
621621
$this->togl_unbind;
622622
}

0 commit comments

Comments
 (0)