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