File: simple.pl

package info (click to toggle)
libopengl-perl 0.7004%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,088 kB
  • sloc: perl: 9,701; ansic: 8,090; makefile: 110
file content (20 lines) | stat: -rw-r--r-- 419 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# simple example taken from listing 1-1 (or 1-2) from OpenGL book

use OpenGL;

glpOpenWindow;
glClearColor(0,0,1,1);
glClear(GL_COLOR_BUFFER_BIT);
glOrtho(-1,1,-1,1,-1,1);

glColor3f(1,0,0);
glBegin(GL_POLYGON);
  glVertex2f(-0.5,-0.5);
  glVertex2f(-0.5, 0.5);
  glVertex2f( 0.5, 0.5);
  glVertex2f( 0.5,-0.5);
glEnd();
glpFlush();

print "Program 1-1 Simple, hit Enter in terminal window to quit:\n\n";
glpMainLoop;