File: ada_sphere.adb

package info (click to toggle)
glut 3.7-14
  • links: PTS
  • area: main
  • in suites: woody
  • size: 12,556 kB
  • ctags: 45,170
  • sloc: ansic: 148,716; makefile: 35,208; ada: 2,062; yacc: 473; fortran: 290; lex: 131; csh: 51; sed: 49; sh: 33
file content (40 lines) | stat: -rw-r--r-- 760 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

with GL; use GL;
with Interfaces.C.Strings;
with Glut; use Glut;
with ada_sphere_procs; use ada_sphere_procs;

procedure ada_sphere is
  
  package ICS renames Interfaces.C.Strings;

  type chars_ptr_ptr is access ICS.chars_ptr;

  argc : aliased integer;
  pragma Import (C, argc, "gnat_argc");

  argv : chars_ptr_ptr;
  pragma Import (C, argv, "gnat_argv");

  win : Integer;
  m : Integer;

begin

  glutInit (argc'access, argv);

  glutInitDisplayMode(GLUT_RGB or GLUT_DEPTH or GLUT_DOUBLE);
  win := glutCreateWindow("ada_sphere");

  glutDisplayFunc(display'access);
  glutReshapeFunc(reshape'access);

  init;

  m := glutCreateMenu(menu'access);
  glutAddMenuEntry("Quit", 666);
  glutAttachMenu(GLUT_RIGHT_BUTTON);

  glutMainLoop;

end ada_sphere;