File: menutest.pl

package info (click to toggle)
libopengl-perl 0.6704%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,988 kB
  • ctags: 1,979
  • sloc: perl: 10,008; ansic: 5,935; makefile: 101; sh: 51
file content (23 lines) | stat: -rw-r--r-- 572 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use OpenGL qw(:all);

glutInit();

glutInitWindowPosition(10, 10);
glutInitWindowSize(200, 200);
glutInitDisplayMode(16);

$win = glutCreateWindow("test2");
glutSetWindow($win);

glutDisplayFunc(sub { print "Display!\n";
		      glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ) } );
glutReshapeFunc(sub { print "Reshape!\n";
		      my ($width, $height) = @_;
		      glViewport(0, 0, $width, $height); } );
#glutIdleFunc(sub { print "Idle!\n" } );

glutCreateMenu(sub { print "Got menu ",@_,"\n" } );
glutAddMenuEntry("Hello", 1);
glutAttachMenu(0);

glutMainLoop();