Skip to content

Commit

Permalink
Implement correct pure perl for glBufferData_p
Browse files Browse the repository at this point in the history
The POGL version was actually using OpenGL::Array objects so
I've renamed this to glBufferData_o to avoid conflict.
  • Loading branch information
devel-chm committed Jul 10, 2017
1 parent 5ac91f2 commit 2aa49cf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/OpenGL/Modern/Helpers.pm
Expand Up @@ -314,6 +314,14 @@ sub glGetIntegerv_p {
}

sub glBufferData_p {
my $usage = pop;
my ($target, $size, @data) = @_;
my $pdata = pack "f*", @data;

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

sub glBufferData_o {
my ( $target, $oga, $usage ) = @_;
glBufferData_c $target, $oga->length, $oga->ptr, $usage;
}
Expand Down

0 comments on commit 2aa49cf

Please sign in to comment.