Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: add classic tests with as much ::Modern usage as possible #41

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions lib/OpenGL/Modern/Helpers.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ use OpenGL::Modern qw(
glGenFramebuffers_c
glGenVertexArrays_c
glGenBuffers_c
glGenProgramsARB_c
glGenRenderbuffers_c
glGetIntegerv_c
glBufferData_c
glBufferSubData_c
glUniform2f
glUniform4f
glGetProgramivARB_c
);

=head1 NAME
Expand Down Expand Up @@ -163,10 +167,14 @@ $VERSION = '0.01_02';
glGenFramebuffers_p
glGenVertexArrays_p
glGenBuffers_p
glGenProgramsARB_p
glGenRenderbuffers_p
glGetIntegerv_p
glBufferData_p
glBufferSubData_p
glUniform2f_p
glUniform4f_p
glGetProgramivARB_p
);

%glErrorStrings = (
Expand Down Expand Up @@ -277,6 +285,10 @@ sub glGenVertexArrays_p { gen_thing_p \&glGenVertexArrays_c, @_ }

sub glGenBuffers_p { gen_thing_p \&glGenBuffers_c, @_ }

sub glGenProgramsARB_p { gen_thing_p \&glGenProgramsARB_c, @_ }

sub glGenRenderbuffers_p { gen_thing_p \&glGenRenderbuffers_c, @_ }

sub get_iv_p {
my ( $call, $id, $pname, $count ) = @_;
$count ||= 1;
Expand All @@ -288,6 +300,8 @@ sub get_iv_p {

sub glGetProgramiv_p { get_iv_p \&glGetProgramiv_c, @_ }

sub glGetProgramivARB_p { get_iv_p \&glGetProgramivARB_c, @_ }

sub glGetShaderiv_p { get_iv_p \&glGetShaderiv_c, @_ }

sub glShaderSource_p {
Expand All @@ -312,6 +326,11 @@ sub glBufferData_p {
glBufferData_c $target, $oga->length, $oga->ptr, $usage;
}

sub glBufferSubData_p {
my ( $target, $offset, $oga ) = @_;
glBufferSubData_c $target, $offset, $oga->length, $oga->ptr;
}

sub glUniform2f_p {
my ( $uniform, $v0, $v1 ) = @_;
glUniform2f $uniform, $v0, $v1;
Expand Down
Loading