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:
38 my $app = new SDL::App -w => 800, -h => 600, -d => 16, -gl => 1;
40 my @points = ( [-4.0, -4.0, 0.0 ],
45 my $ctrlpoints = pack "d12", map { @$_ } @points;
49 glViewport(0,0,800,600);
50 glMatrixMode(GL_PROJECTION());
53 glFrustum (-0.1,0.1,-0.075,0.075,0.3,100.0 );
55 glMatrixMode(GL_MODELVIEW());
60 glClearColor(0.0, 0.0, 0.0, 0.0);
61 glShadeModel(GL_FLAT());
62 glMap1(GL_MAP1_VERTEX_3(), 0.0, 1.0, 3, 4, $ctrlpoints);
63 glEnable(GL_MAP1_VERTEX_3());
67 glClear(GL_COLOR_BUFFER_BIT);
69 glBegin(GL_LINE_STRIP);
70 for my $i ( 0 .. 30 ) {
78 for my $i ( 0 .. 3 ) {
79 glVertex( @{$points[$i]} );
88 $app->loop({ SDL_QUIT() => sub { exit(); } });