5 # Copyright (C) 2005 David J. Goehrig <dgoehrig@cpan.org>
7 # ------------------------------------------------------------------------------
9 # This library is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public
11 # License as published by the Free Software Foundation; either
12 # version 2.1 of the License, or (at your option) any later version.
14 # This library is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # Lesser General Public License for more details.
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with this library; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 # ------------------------------------------------------------------------------
25 # Please feel free to send questions, suggestions or improvements to:
43 @ISA=qw(Exporter DynaLoader);
47 bootstrap SDL::OpenGL;
48 for ( keys %SDL::OpenGL:: ) {
54 use SDL::OpenGL::Constants;
59 $self->export_to_level(1, @_);
60 SDL::OpenGL::Constants->export_to_level(1);
75 SDL::OpenGL - a perl extension
79 L<SDL::OpenGL> is a perl module which when used by your application
80 exports the gl* and glu* functions into your application's primary namespace.
81 Most of the functions described in the OpenGL 1.3 specification are currently
82 supported in this fashion. As the implementation of the OpenGL bindings that
83 comes with SDL_perl is largely type agnositic, there is no need to decline
84 the function names in the fashion that is done in the C API. For example,
85 glVertex3d is simply glVertex, and perl just does the right thing with regards
90 The following methods work different in Perl than in C:
96 glCallLists(@array_of_numbers);
98 Unlike the C function, which get's passed a count, a type and a list of
99 numbers, the Perl equivalent only takes a list of numbers.
101 Note that this is slow, since it needs to allocate memory and construct a
102 list of numbers from the given scalars. For a faster version see
103 L<glCallListsString>.
107 The following methods exist in addition to the normal OpenGL specification:
111 =item glCallListsString
113 glCallListsString($string);
115 Works like L<glCallLists()>, except that it needs only one parameter, a scalar
116 holding a string. The string is interpreted as a set of bytes, and each of
117 these will be passed to glCallLists as GL_BYTE. This is faster than
118 glCallLists, so you might want to pack your data like this:
120 my $lists = pack("C", @array_of_numbers);
122 And later use it like this:
124 glCallListsString($lists);