Navigation Menu

Skip to content

Commit

Permalink
Run perltidy
Browse files Browse the repository at this point in the history
  • Loading branch information
devel-chm committed Aug 6, 2017
1 parent adccfea commit 1bdd58b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/OpenGL/Modern/Helpers.pm
Expand Up @@ -258,6 +258,7 @@ sub glGetProgramInfoLog_p { get_info_log_p \&glGetProgramInfoLog_c, @_ }
# no glGetVersion() in the OpenGL API.
#
sub glGetVersion_p {

# const GLubyte * GLAPIENTRY glGetString (GLenum name);
my $glVersion = glGetString( GL_VERSION );
( $glVersion ) = ( $glVersion =~ m!^(\d+\.\d+)!g );
Expand Down Expand Up @@ -298,9 +299,9 @@ sub get_iv_p {
return wantarray ? @params : $params[0];
}

sub glGetProgramiv_p { get_iv_p \&glGetProgramiv_c, @_ } # TODO: get rid of $count
sub glGetProgramiv_p { get_iv_p \&glGetProgramiv_c, @_ } # TODO: get rid of $count

sub glGetShaderiv_p { get_iv_p \&glGetShaderiv_c, @_ } # TODO: get rid of $count
sub glGetShaderiv_p { get_iv_p \&glGetShaderiv_c, @_ } # TODO: get rid of $count

sub glShaderSource_p {
my ( $shader, @sources ) = @_;
Expand All @@ -311,33 +312,33 @@ sub glShaderSource_p {
}

sub glGetIntegerv_p {
my ( $pname, $count ) = @_; # TODO: get rid of $count
my ( $pname, $count ) = @_; # TODO: get rid of $count
$count ||= 1;
xs_buffer my $data, 4 * $count;
glGetIntegerv_c $pname, unpack( $PACK_TYPE, pack( 'p', $data ) );
my @data = unpack 'I*', $data;
return wantarray ? @data : $data[0];
}

sub glBufferData_p { # NOTE: this might be better named glpBufferDataf_p
sub glBufferData_p { # NOTE: this might be better named glpBufferDataf_p
my $usage = pop;
my ($target, $size, @data) = @_;
my ( $target, $size, @data ) = @_;
my $pdata = pack "f*", @data;

glBufferData_c $target, $size, unpack( $PACK_TYPE, pack( 'p', $pdata ) ), $usage;
}

sub glBufferData_o { # NOTE: this was glBufferData_p in OpenGL
sub glBufferData_o { # NOTE: this was glBufferData_p in OpenGL
my ( $target, $oga, $usage ) = @_;
glBufferData_c $target, $oga->length, $oga->ptr, $usage;
}

sub glUniform2fv_p { # NOTE: this name is more consistent with OpenGL API
sub glUniform2fv_p { # NOTE: this name is more consistent with OpenGL API
my ( $uniform, $v0, $v1 ) = @_;
glUniform2f $uniform, $v0, $v1;
}

sub glUniform4fv_p { # NOTE: this name is more consistent with OpenGL API
sub glUniform4fv_p { # NOTE: this name is more consistent with OpenGL API
my ( $uniform, $v0, $v1, $v2, $v3 ) = @_;
glUniform4f $uniform, $v0, $v1, $v2, $v3;
}
Expand Down

0 comments on commit 1bdd58b

Please sign in to comment.