3 # A simplified OpenGL wrapper
5 # Copyright (C) 2002, 2003, 2004 David J. Goehrig
20 @ISA=qw(Exporter DynaLoader);
23 use SDL::OpenGL::Constants;
26 bootstrap SDL::OpenGL;
27 for ( keys %SDL::OpenGL:: ) {
33 # export all GL constants
34 for (@SDL::OpenGL::Constants::EXPORT) {
49 SDL::OpenGL - a perl extension
53 L<SDL::OpenGL> is a perl module which when used by your application
54 exports the gl* and glu* functions into your application's primary namespace.
55 Most of the functions described in the OpenGL 1.3 specification are currently
56 supported in this fashion. As the implementation of the OpenGL bindings that
57 comes with SDL_perl is largely type agnositic, there is no need to decline
58 the function names in the fashion that is done in the C API. For example,
59 glVertex3d is simply glVertex, and perl just does the right thing with regards
64 The following methods work different in Perl than in C:
70 glCallLists(@array_of_numbers);
72 Unlike the C function, which get's passed a count, a type and a list of
73 numbers, the Perl equivalent only takes a list of numbers.
75 Note that this is slow, since it needs to allocate memory and construct a
76 list of numbers from the given scalars. For a faster version see
81 The following methods exist in addition to the normal OpenGL specification:
85 =item glCallListsString
87 glCallListsString($string);
89 Works like L<glCallLists()>, except that it needs only one parameter, a scalar
90 holding a string. The string is interpreted as a set of bytes, and each of
91 these will be passed to glCallLists as GL_BYTE. This is faster than
92 glCallLists, so you might want to pack your data like this:
94 my $lists = pack("C", @array_of_numbers);
96 And later use it like this:
98 glCallListsString($lists);