Updated docs and site
[sdlgit/SDL-Site.git] / pages / SDL-OpenGL.html-inc
CommitLineData
162a0989 1<div class="pod">
2<!-- INDEX START -->
3<h3 id="TOP">Index</h3>
4
5<ul><li><a href="#NAME">NAME</a></li>
c59d9ab1 6<li><a href="#CATEGORY">CATEGORY</a></li>
162a0989 7<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
8<li><a href="#CAVEATS">CAVEATS</a></li>
9<li><a href="#AUTHOR">AUTHOR</a></li>
10<li><a href="#SEE_ALSO">SEE ALSO</a>
11</li>
12</ul><hr />
13<!-- INDEX END -->
14
15
16
17
18
19
20
21
22<h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
23<div id="NAME_CONTENT">
24<p>SDL::OpenGL - a perl extension</p>
25
26</div>
c59d9ab1 27<h1 id="CATEGORY">CATEGORY</h1><p><a href="#TOP" class="toplink">Top</a></p>
28<div id="CATEGORY_CONTENT">
29<p>TODO</p>
30
31</div>
162a0989 32<h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
33<div id="DESCRIPTION_CONTENT">
55bbf7a2 34<p><a href="SDL-OpenGL.html">SDL::OpenGL</a> is a perl module which when used by your application
162a0989 35exports the gl* and glu* functions into your application's primary namespace.
36Most of the functions described in the OpenGL 1.3 specification are currently
37supported in this fashion. As the implementation of the OpenGL bindings that
38comes with SDL_perl is largely type agnositic, there is no need to decline
39the function names in the fashion that is done in the C API. For example,
40glVertex3d is simply glVertex, and perl just does the right thing with regards
41to types.</p>
42
43</div>
44<h1 id="CAVEATS">CAVEATS</h1><p><a href="#TOP" class="toplink">Top</a></p>
45<div id="CAVEATS_CONTENT">
46<p>The following methods work different in Perl than in C:</p>
47<dl>
48 <dt>glCallLists</dt>
49 <dd>
50<pre> glCallLists(@array_of_numbers);
51
52</pre>
53 <p>Unlike the C function, which get's passed a count, a type and a list of
54numbers, the Perl equivalent only takes a list of numbers.</p>
55 <p>Note that this is slow, since it needs to allocate memory and construct a
56list of numbers from the given scalars. For a faster version see
46beffd8 57<a href="http://search.cpan.org/perldoc?glCallListsString">glCallListsString</a>.</p>
162a0989 58 </dd>
59</dl>
60<p>The following methods exist in addition to the normal OpenGL specification:</p>
61<dl>
62 <dt>glCallListsString</dt>
63 <dd>
64<pre> glCallListsString($string);
65
66</pre>
46beffd8 67 <p>Works like <a href="http://search.cpan.org/perldoc?glCallLists()">glCallLists()</a>, except that it needs only one parameter, a scalar
162a0989 68holding a string. The string is interpreted as a set of bytes, and each of
69these will be passed to glCallLists as GL_BYTE. This is faster than
70glCallLists, so you might want to pack your data like this:</p>
71<pre> my $lists = pack(&quot;C&quot;, @array_of_numbers);
72
73</pre>
74 <p>And later use it like this:</p>
75<pre> glCallListsString($lists);
76
77</pre>
78 </dd>
79</dl>
80
81</div>
82<h1 id="AUTHOR">AUTHOR</h1><p><a href="#TOP" class="toplink">Top</a></p>
83<div id="AUTHOR_CONTENT">
84<p>David J. Goehrig</p>
85
86</div>
87<h1 id="SEE_ALSO">SEE ALSO</h1><p><a href="#TOP" class="toplink">Top</a></p>
88<div id="SEE_ALSO_CONTENT">
55bbf7a2 89<p><a href="http://search.cpan.org/perldoc?perl">perl</a> <a href="SDL-App.html">SDL::App</a></p>
162a0989 90
91</div>
92</div>