1. -- * CAUTION *: this GLUT.ads file is generated by preprocessing GLUT.prs 
  2. -- You should modify GLUT.prs and preprocess it with: tools/glut_prep.bat 
  3. -- 
  4. -- Bindings to FreeGLUT (2.4.0 or later). 
  5. -- Maintained by Gautier de Montmollin and Rod Kay 
  6. -- 
  7. -- Overall changes made to older Ada bindings to GLUT 3.7, 
  8. -- the ancestor of FreeGLUT: 
  9. --  - mixed Jerry van Dijk's and Pascal Obry's bindings 
  10. --  - uses GL without the GL prefixes and "4f"-style suffixes 
  11. --  - useless and harmful "GLUT_" and "glut" prefixes removed 
  12. --  - one can set callbacks with the 'Address attribute, since 
  13. --    the 'Unrestricted_Access is GNAT-specific 
  14.  
  15. with Interfaces.C; 
  16. with Interfaces.C.Strings; 
  17. with System.Storage_Elements; 
  18.  
  19. with GL; 
  20.  
  21. package GLUT is 
  22.  
  23.    subtype Unsigned is Interfaces.C.Unsigned; 
  24.    function "and"(x,y: Unsigned) return Unsigned renames Interfaces.C."and"; 
  25.    function "or"(x,y: Unsigned) return Unsigned  renames Interfaces.C."or"; 
  26.  
  27.    --  Display mode bit masks. 
  28.  
  29.    RGB                 : constant := 0; 
  30.    RGBA                : constant := 0; 
  31.    INDEX               : constant := 1; 
  32.    SINGLE              : constant := 0; 
  33.    DOUBLE              : constant := 2; 
  34.    ACCUM               : constant := 4; 
  35.    ALPHA               : constant := 8; 
  36.    DEPTH               : constant := 16; 
  37.    STENCIL             : constant := 32; 
  38.    MULTISAMPLE         : constant := 128; 
  39.    STEREO              : constant := 256; 
  40.    LUMINANCE           : constant := 512; 
  41.  
  42.    --  Mouse buttons. 
  43.  
  44.    LEFT_BUTTON         : constant := 0; 
  45.    MIDDLE_BUTTON       : constant := 1; 
  46.    RIGHT_BUTTON        : constant := 2; 
  47.  
  48.    --  Mouse button callback state. 
  49.  
  50.    DOWN                : constant := 0; 
  51.    UP                  : constant := 1; 
  52.  
  53.    --  function keys 
  54.  
  55.    KEY_F1              : constant := 1; 
  56.    KEY_F2              : constant := 2; 
  57.    KEY_F3              : constant := 3; 
  58.    KEY_F4              : constant := 4; 
  59.    KEY_F5              : constant := 5; 
  60.    KEY_F6              : constant := 6; 
  61.    KEY_F7              : constant := 7; 
  62.    KEY_F8              : constant := 8; 
  63.    KEY_F9              : constant := 9; 
  64.    KEY_F10             : constant := 10; 
  65.    KEY_F11             : constant := 11; 
  66.    KEY_F12             : constant := 12; 
  67.  
  68.    --  directional keys 
  69.  
  70.    KEY_LEFT            : constant := 100; 
  71.    KEY_UP              : constant := 101; 
  72.    KEY_RIGHT           : constant := 102; 
  73.    KEY_DOWN            : constant := 103; 
  74.    KEY_PAGE_UP         : constant := 104; 
  75.    KEY_PAGE_DOWN       : constant := 105; 
  76.    KEY_HOME            : constant := 106; 
  77.    KEY_END             : constant := 107; 
  78.    KEY_INSERT          : constant := 108; 
  79.  
  80.    --  Entry/exit callback state. 
  81.  
  82.    LEFT                : constant := 0; 
  83.    ENTERED             : constant := 1; 
  84.  
  85.    --  Menu usage callback state. 
  86.  
  87.    MENU_NOT_IN_USE     : constant := 0; 
  88.    MENU_IN_USE         : constant := 1; 
  89.  
  90.    --  Visibility callback state. 
  91.  
  92.    NOT_VISIBLE         : constant := 0; 
  93.    VISIBLE             : constant := 1; 
  94.  
  95.    --  Window status callback state. 
  96.  
  97.    HIDDEN              : constant := 0; 
  98.    FULLY_RETAINED      : constant := 1; 
  99.    PARTIALLY_RETAINED  : constant := 2; 
  100.    FULLY_COVERED       : constant := 3; 
  101.  
  102.    --  Color index component selection values. 
  103.  
  104.    RED                 : constant := 0; 
  105.    GREEN               : constant := 1; 
  106.    BLUE                : constant := 2; 
  107.  
  108.    --  glutGameModeGet 
  109.  
  110.    GAME_MODE_ACTIVE          : constant := 0; 
  111.    GAME_MODE_POSSIBLE        : constant := 1; 
  112.    GAME_MODE_WIDTH           : constant := 2; 
  113.    GAME_MODE_HEIGHT          : constant := 3; 
  114.    GAME_MODE_PIXEL_DEPTH     : constant := 4; 
  115.    GAME_MODE_REFRESH_RATE    : constant := 5; 
  116.    GAME_MODE_DISPLAY_CHANGED : constant := 6; 
  117.  
  118.    -- glutSetKeyRepeat modes 
  119.  
  120.    KEY_REPEAT_OFF            : constant := 0; 
  121.    KEY_REPEAT_ON             : constant := 1; 
  122.    KEY_REPEAT_DEFAULT        : constant := 2; 
  123.  
  124.    -- Joystick button masks 
  125.  
  126.    JOYSTICK_BUTTON_A          : constant := 1; 
  127.    JOYSTICK_BUTTON_B          : constant := 2; 
  128.    JOYSTICK_BUTTON_C          : constant := 4; 
  129.    JOYSTICK_BUTTON_D          : constant := 8; 
  130.  
  131.    --  Stroke font constants (use these in GLUT program). 
  132.  
  133.    STROKE_ROMAN_STROKE : constant System.Address; 
  134.    pragma Import(C, STROKE_ROMAN_STROKE, "glutStrokeRoman"); 
  135.    STROKE_ROMAN      : constant System.Address := STROKE_ROMAN_STROKE'Address; 
  136.    STROKE_MONO_ROMAN_STROKE : constant System.Address; 
  137.    pragma Import(C, STROKE_MONO_ROMAN_STROKE, "glutStrokeMonoRoman"); 
  138.    STROKE_MONO_ROMAN : constant System.Address := STROKE_MONO_ROMAN_STROKE'Address; 
  139.  
  140.    --  Bitmap font constants (use these in GLUT program). 
  141.  
  142.    BITMAP_9_BY_15_FONT   : constant System.Address; 
  143.    pragma Import(C, BITMAP_9_BY_15_FONT, "glutBitmap9By15"); 
  144.    BITMAP_9_BY_15        : constant System.Address := Bitmap_9_By_15_Font'Address; 
  145.    BITMAP_8_BY_13_FONT   : constant System.Address; 
  146.    pragma Import(C, BITMAP_8_BY_13_FONT, "glutBitmap8By13"); 
  147.    BITMAP_8_BY_13        : constant System.Address := BITMAP_8_BY_13_FONT'Address; 
  148.    BITMAP_TIMES_ROMAN_10_FONT : constant System.Address; 
  149.    pragma Import(C, BITMAP_TIMES_ROMAN_10_FONT, "glutBitmapTimesRoman10"); 
  150.    BITMAP_TIMES_ROMAN_10 : constant System.Address := BITMAP_TIMES_ROMAN_10_FONT'Address; 
  151.    BITMAP_TIMES_ROMAN_24_FONT : constant System.Address; 
  152.    pragma Import(C, BITMAP_TIMES_ROMAN_24_FONT, "glutBitmapTimesRoman24"); 
  153.    BITMAP_TIMES_ROMAN_24 : constant System.Address := BITMAP_TIMES_ROMAN_24_FONT'Address; 
  154.    BITMAP_HELVETICA_10_FONT   : constant System.Address; 
  155.    pragma Import(C, BITMAP_HELVETICA_10_FONT, "glutBitmapHelvetica10"); 
  156.    BITMAP_HELVETICA_10   : constant System.Address := BITMAP_HELVETICA_10_FONT'Address; 
  157.    BITMAP_HELVETICA_12_FONT   : constant System.Address; 
  158.    pragma Import(C, BITMAP_HELVETICA_12_FONT, "glutBitmapHelvetica12"); 
  159.    BITMAP_HELVETICA_12   : constant System.Address := BITMAP_HELVETICA_12_FONT'Address; 
  160.    BITMAP_HELVETICA_18_FONT   : constant System.Address; 
  161.    pragma Import(C, BITMAP_HELVETICA_18_FONT, "glutBitmapHelvetica18"); 
  162.    BITMAP_HELVETICA_18   : constant System.Address := BITMAP_HELVETICA_18_FONT'Address; 
  163.  
  164.    --  glutGet parameters. 
  165.  
  166.    WINDOW_X                  : constant := 100; 
  167.    WINDOW_Y                  : constant := 101; 
  168.    WINDOW_WIDTH              : constant := 102; 
  169.    WINDOW_HEIGHT             : constant := 103; 
  170.    WINDOW_BUFFER_SIZE        : constant := 104; 
  171.    WINDOW_STENCIL_SIZE       : constant := 105; 
  172.    WINDOW_DEPTH_SIZE         : constant := 106; 
  173.    WINDOW_RED_SIZE           : constant := 107; 
  174.    WINDOW_GREEN_SIZE         : constant := 108; 
  175.    WINDOW_BLUE_SIZE          : constant := 109; 
  176.    WINDOW_ALPHA_SIZE         : constant := 110; 
  177.    WINDOW_ACCUM_RED_SIZE     : constant := 111; 
  178.    WINDOW_ACCUM_GREEN_SIZE   : constant := 112; 
  179.    WINDOW_ACCUM_BLUE_SIZE    : constant := 113; 
  180.    WINDOW_ACCUM_ALPHA_SIZE   : constant := 114; 
  181.    WINDOW_DOUBLEBUFFER       : constant := 115; 
  182.    WINDOW_RGBA               : constant := 116; 
  183.    WINDOW_PARENT             : constant := 117; 
  184.    WINDOW_NUM_CHILDREN       : constant := 118; 
  185.    WINDOW_COLORMAP_SIZE      : constant := 119; 
  186.    WINDOW_NUM_SAMPLES        : constant := 120; 
  187.    WINDOW_STEREO             : constant := 121; 
  188.    WINDOW_CURSOR             : constant := 122; 
  189.    SCREEN_WIDTH              : constant := 200; 
  190.    SCREEN_HEIGHT             : constant := 201; 
  191.    SCREEN_WIDTH_MM           : constant := 202; 
  192.    SCREEN_HEIGHT_MM          : constant := 203; 
  193.    MENU_NUM_ITEMS            : constant := 300; 
  194.    DISPLAY_MODE_POSSIBLE     : constant := 400; 
  195.    INIT_WINDOW_X             : constant := 500; 
  196.    INIT_WINDOW_Y             : constant := 501; 
  197.    INIT_WINDOW_WIDTH         : constant := 502; 
  198.    INIT_WINDOW_HEIGHT        : constant := 503; 
  199.    INIT_DISPLAY_MODE         : constant := 504; 
  200.    ELAPSED_TIME              : constant := 700; 
  201.  
  202.    --  glutDeviceGet parameters. 
  203.  
  204.    HAS_KEYBOARD              : constant := 600; 
  205.    HAS_MOUSE                 : constant := 601; 
  206.    HAS_SPACEBALL             : constant := 602; 
  207.    HAS_DIAL_AND_BUTTON_BOX   : constant := 603; 
  208.    HAS_TABLET                : constant := 604; 
  209.    NUM_MOUSE_BUTTONS         : constant := 605; 
  210.    NUM_SPACEBALL_BUTTONS     : constant := 606; 
  211.    NUM_BUTTON_BOX_BUTTONS    : constant := 607; 
  212.    NUM_DIALS                 : constant := 608; 
  213.    NUM_TABLET_BUTTONS        : constant := 609; 
  214.  
  215.    --  glutLayerGet parameters. 
  216.  
  217.    OVERLAY_POSSIBLE          : constant := 800; 
  218.    LAYER_IN_USE              : constant := 801; 
  219.    HAS_OVERLAY               : constant := 802; 
  220.    TRANSPARENT_INDEX         : constant := 803; 
  221.    NORMAL_DAMAGED            : constant := 804; 
  222.    OVERLAY_DAMAGED           : constant := 805; 
  223.  
  224.    --  glutVideoResizeGet parameters. 
  225.  
  226.    VIDEO_RESIZE_POSSIBLE     : constant := 900; 
  227.    VIDEO_RESIZE_IN_USE       : constant := 901; 
  228.    VIDEO_RESIZE_X_DELTA      : constant := 902; 
  229.    VIDEO_RESIZE_Y_DELTA      : constant := 903; 
  230.    VIDEO_RESIZE_WIDTH_DELTA  : constant := 904; 
  231.    VIDEO_RESIZE_HEIGHT_DELTA : constant := 905; 
  232.    VIDEO_RESIZE_X            : constant := 906; 
  233.    VIDEO_RESIZE_Y            : constant := 907; 
  234.    VIDEO_RESIZE_WIDTH        : constant := 908; 
  235.    VIDEO_RESIZE_HEIGHT       : constant := 909; 
  236.  
  237.    --  UseLayer parameters. 
  238.  
  239.    NORMAL  : constant := 0; 
  240.    OVERLAY : constant := 1; 
  241.  
  242.    --  GetModifiers return mask. 
  243.  
  244.    ACTIVE_SHIFT               : constant := 1; 
  245.    ACTIVE_CTRL                : constant := 2; 
  246.    ACTIVE_ALT                 : constant := 4; 
  247.  
  248.    --  SetCursor parameters. 
  249.    --  Basic arrows. 
  250.  
  251.    CURSOR_RIGHT_ARROW         : constant := 0; 
  252.    CURSOR_LEFT_ARROW          : constant := 1; 
  253.  
  254.    --  Symbolic cursor shapes. 
  255.  
  256.    CURSOR_INFO                : constant := 2; 
  257.    CURSOR_DESTROY             : constant := 3; 
  258.    CURSOR_HELP                : constant := 4; 
  259.    CURSOR_CYCLE               : constant := 5; 
  260.    CURSOR_SPRAY               : constant := 6; 
  261.    CURSOR_WAIT                : constant := 7; 
  262.    CURSOR_TEXT                : constant := 8; 
  263.    CURSOR_CROSSHAIR           : constant := 9; 
  264.  
  265.    --  Directional cursors. 
  266.  
  267.    CURSOR_UP_DOWN             : constant := 10; 
  268.    CURSOR_LEFT_RIGHT          : constant := 11; 
  269.  
  270.    --  Sizing cursors. 
  271.  
  272.    CURSOR_TOP_SIDE            : constant := 12; 
  273.    CURSOR_BOTTOM_SIDE         : constant := 13; 
  274.    CURSOR_LEFT_SIDE           : constant := 14; 
  275.    CURSOR_RIGHT_SIDE          : constant := 15; 
  276.    CURSOR_TOP_LEFT_CORNER     : constant := 16; 
  277.    CURSOR_TOP_RIGHT_CORNER    : constant := 17; 
  278.    CURSOR_BOTTOM_RIGHT_CORNER : constant := 18; 
  279.    CURSOR_BOTTOM_LEFT_CORNER  : constant := 19; 
  280.  
  281.    --  Inherit from parent window. 
  282.  
  283.    CURSOR_INHERIT             : constant := 100; 
  284.  
  285.    --  Blank cursor. 
  286.  
  287.    CURSOR_NONE                : constant := 101; 
  288.  
  289.    --  Fullscreen crosshair (if available). 
  290.  
  291.    CURSOR_FULL_CROSSHAIR      : constant := 102; 
  292.  
  293.    --  GLUT initialization sub-API. 
  294.  
  295.    procedure Init; 
  296.  
  297.    -- GLUT API Extension macro definitions 
  298.    -- behaviour when the user clicks on an "x" to close a window 
  299.    -- 
  300.    ACTION_EXIT                 : constant := 0; 
  301.    ACTION_GLUTMAINLOOP_RETURNS : constant := 1; 
  302.    ACTION_CONTINUE_EXECUTION   : constant := 2; 
  303.  
  304.    ACTION_ON_WINDOW_CLOSE      : constant := 16#01F9#;    -- for 'Get' and 'SetOption' parameter. 
  305.  
  306.  
  307.  
  308.    GLUT_RENDERING_CONTEXT   : constant := 16#01FD#; 
  309.  
  310.    GLUT_CREATE_NEW_CONTEXT  : constant := 0; 
  311.    GLUT_USE_CURRENT_CONTEXT : constant := 1; 
  312.  
  313.    -- Used to set options for features exclusive to the freeglut implementation 
  314.    -- replaced by "null" here 
  315.    procedure SetOption (option_flag : Integer;   value : Integer); 
  316. --     pragma Import (StdCall, SetOption, "glutSetOption"); 
  317.  
  318.    procedure InitDisplayMode (Mode : Unsigned); 
  319.    pragma Import (StdCall, InitDisplayMode, "glutInitDisplayMode"); 
  320.  
  321.    procedure InitDisplayString (String : Interfaces.C.Strings.Chars_Ptr); 
  322.    pragma Import (StdCall, InitDisplayString, "glutInitDisplayString"); 
  323.  
  324.    procedure InitDisplayString (Name : String); 
  325.  
  326.    procedure InitWindowPosition (X : Integer; Y : Integer); 
  327.    pragma Import (StdCall, InitWindowPosition, "glutInitWindowPosition"); 
  328.  
  329.    procedure InitWindowSize (Width : Integer; Height : Integer); 
  330.    pragma Import (StdCall, InitWindowSize, "glutInitWindowSize"); 
  331.  
  332.    procedure MainLoop; 
  333.    pragma Import (StdCall, MainLoop, "glutMainLoop"); 
  334.  
  335.    -- Feature exclusive to the freeglut implementation 
  336.    -- replaced by "null" here 
  337.    procedure LeaveMainLoop; -- FreeGLUT 
  338. --     pragma Import (StdCall, LeaveMainLoop, "glutLeaveMainLoop"); 
  339.  
  340.    procedure MainLoopEvent; -- FreeGLUT 
  341.    pragma Import (StdCall, MainLoopEvent, "glutMainLoopEvent"); 
  342.  
  343.    --  GLUT window sub-API. 
  344.  
  345.    function CreateWindow 
  346.      (Title : Interfaces.C.Strings.Chars_Ptr) 
  347.       return Integer; 
  348.    pragma Import (StdCall, CreateWindow, "glutCreateWindow"); 
  349.  
  350.    function CreateWindow (Title : String) return Integer; 
  351.  
  352.    function CreateSubWindow 
  353.      (Win    : Integer; 
  354.       X      : Integer; 
  355.       Y      : Integer; 
  356.       Width  : Integer; 
  357.       Height : Integer) 
  358.       return Integer; 
  359.    pragma Import (StdCall, CreateSubWindow, "glutCreateSubWindow"); 
  360.  
  361.    procedure DestroyWindow (Win : Integer); 
  362.    pragma Import (StdCall, DestroyWindow, "glutDestroyWindow"); 
  363.  
  364.    procedure PostRedisplay; 
  365.    pragma Import (StdCall, PostRedisplay, "glutPostRedisplay"); 
  366.  
  367.    procedure PostWindowRedisplay (Win : Integer); 
  368.    pragma Import (StdCall, PostWindowRedisplay, "glutPostWindowRedisplay"); 
  369.  
  370.    procedure SwapBuffers; 
  371.    pragma Import (StdCall, SwapBuffers, "glutSwapBuffers"); 
  372.  
  373.    function GetWindow return Integer; 
  374.    pragma Import (StdCall, GetWindow, "glutGetWindow"); 
  375.  
  376.    -- Feature exclusive to the freeglut implementation 
  377.    -- replaced by an implementation based on Ada.Containers.OrderedMaps 
  378.    function GetWindowData return system.Address; -- FreeGLUT 
  379. --   pragma Import (StdCall, GetWindowData, "glutGetWindowData"); 
  380.  
  381.    procedure SetWindow (Win : Integer); 
  382.    pragma Import (StdCall, SetWindow, "glutSetWindow"); 
  383.  
  384.    -- Feature exclusive to the freeglut implementation 
  385.    -- replaced by an implementation based on Ada.Containers.OrderedMaps 
  386.    procedure SetWindowData (Data : system.Address); -- FreeGLUT 
  387. --   pragma Import (StdCall, SetWindowData, "glutSetWindowData"); 
  388.  
  389.    procedure SetWindowTitle (Title : Interfaces.C.Strings.Chars_Ptr); 
  390.    pragma Import (StdCall, SetWindowTitle, "glutSetWindowTitle"); 
  391.  
  392.    procedure SetWindowTitle (Title : String); 
  393.  
  394.    procedure SetIconTitle (Title : Interfaces.C.Strings.Chars_Ptr); 
  395.    pragma Import (StdCall, SetIconTitle, "glutSetIconTitle"); 
  396.  
  397.    procedure SetIconTitle (Title : String); 
  398.  
  399.    procedure PositionWindow (X : Integer; Y : Integer); 
  400.    pragma Import (StdCall, PositionWindow, "glutPositionWindow"); 
  401.  
  402.    procedure ReshapeWindow (Width : Integer; Height : Integer); 
  403.    pragma Import (StdCall, ReshapeWindow, "glutReshapeWindow"); 
  404.  
  405.    procedure PopWindow; 
  406.    pragma Import (StdCall, PopWindow, "glutPopWindow"); 
  407.  
  408.    procedure PushWindow; 
  409.    pragma Import (StdCall, PushWindow, "glutPushWindow"); 
  410.  
  411.    procedure IconifyWindow; 
  412.    pragma Import (StdCall, IconifyWindow, "glutIconifyWindow"); 
  413.  
  414.    procedure ShowWindow; 
  415.    pragma Import (StdCall, ShowWindow, "glutShowWindow"); 
  416.  
  417.    procedure HideWindow; 
  418.    pragma Import (StdCall, HideWindow, "glutHideWindow"); 
  419.  
  420.    procedure FullScreen; 
  421.    pragma Import (StdCall, FullScreen, "glutFullScreen"); 
  422.  
  423.    procedure SetCursor (Cursor : Integer); 
  424.    pragma Import (StdCall, SetCursor, "glutSetCursor"); 
  425.  
  426.    procedure WarpPointer (X : Integer; Y : Integer); 
  427.    pragma Import (StdCall, WarpPointer, "glutWarpPointer"); 
  428.  
  429.    type Glut_SpecialUp is access procedure 
  430.      (Key : Integer; 
  431.       X   : Integer; 
  432.       Y   : Integer); 
  433.  
  434.    procedure SpecialUpFunc (Func : Glut_SpecialUp); 
  435.    pragma Import (StdCall, SpecialUpFunc, "glutSpecialUpFunc"); 
  436.    procedure SpecialUpFunc (Func : System.Address); 
  437.  
  438.    type Glut_Joystick is access procedure 
  439.      (ButtonMask : Unsigned; 
  440.       X          : Integer; 
  441.       Y          : Integer; 
  442.       Z          : Integer); 
  443.  
  444.    procedure JoystickFunc (Funct : Glut_Joystick; PollInterval : Integer); 
  445.    pragma Import (StdCall, JoystickFunc, "glutJoystickFunc"); 
  446.  
  447.    --  GLUT overlay sub-API. 
  448.  
  449.    procedure EstablishOverlay; 
  450.    pragma Import (StdCall, EstablishOverlay, "glutEstablishOverlay"); 
  451.  
  452.    procedure RemoveOverlay; 
  453.    pragma Import (StdCall, RemoveOverlay, "glutRemoveOverlay"); 
  454.  
  455.    procedure UseLayer (Layer : GL.enum); 
  456.    pragma Import (StdCall, UseLayer, "glutUseLayer"); 
  457.  
  458.    procedure PostOverlayRedisplay; 
  459.    pragma Import (StdCall, PostOverlayRedisplay, 
  460.                   "glutPostOverlayRedisplay"); 
  461.  
  462.    procedure PostWindowOverlayRedisplay (Win : Integer); 
  463.    pragma Import (StdCall, PostWindowOverlayRedisplay, 
  464.                   "glutPostWindowOverlayRedisplay"); 
  465.  
  466.    procedure ShowOverlay; 
  467.    pragma Import (StdCall, ShowOverlay, "glutShowOverlay"); 
  468.  
  469.    procedure HideOverlay; 
  470.    pragma Import (StdCall, HideOverlay, "glutHideOverlay"); 
  471.  
  472.    --  GLUT menu sub-API. 
  473.  
  474.    type Glut_Proc_1 is access procedure (P1 : Integer); 
  475.  
  476.    function CreateMenu (P1 : Glut_Proc_1) return Integer; 
  477.    pragma Import (StdCall, CreateMenu, "glutCreateMenu"); 
  478.    function CreateMenu (P1 : System.Address) return Integer; 
  479.  
  480.    procedure DestroyMenu (Menu : Integer); 
  481.    pragma Import (StdCall, DestroyMenu, "glutDestroyMenu"); 
  482.  
  483.    function GetMenu return Integer; 
  484.    pragma Import (StdCall, GetMenu, "glutGetMenu"); 
  485.  
  486.    procedure SetMenu (Menu : Integer); 
  487.    pragma Import (StdCall, SetMenu, "glutSetMenu"); 
  488.  
  489.    procedure AddMenuEntry 
  490.      (Label : Interfaces.C.Strings.Chars_Ptr; 
  491.       Value : Integer); 
  492.    pragma Import (StdCall, AddMenuEntry, "glutAddMenuEntry"); 
  493.  
  494.    procedure AddMenuEntry (Label : String; Value : Integer); 
  495.  
  496.    procedure AddSubMenu 
  497.      (Label   : Interfaces.C.Strings.Chars_Ptr; 
  498.       Submenu : Integer); 
  499.    pragma Import (StdCall, AddSubMenu, "glutAddSubMenu"); 
  500.  
  501.    procedure AddSubMenu (Label : String; Submenu : Integer); 
  502.  
  503.    procedure ChangeToMenuEntry 
  504.      (Item  : Integer; 
  505.       Label : Interfaces.C.Strings.Chars_Ptr; 
  506.       Value : Integer); 
  507.    pragma Import (StdCall, ChangeToMenuEntry, "glutChangeToMenuEntry"); 
  508.  
  509.    procedure ChangeToMenuEntry 
  510.      (Item  : Integer; 
  511.       Label : String; 
  512.       Value : Integer); 
  513.  
  514.    procedure ChangeToSubMenu 
  515.      (Item    : Integer; 
  516.       Label   : Interfaces.C.Strings.Chars_Ptr; 
  517.       Submenu : Integer); 
  518.    pragma Import (StdCall, ChangeToSubMenu, "glutChangeToSubMenu"); 
  519.  
  520.    procedure ChangeToSubMenu 
  521.      (Item    : Integer; 
  522.       Label   : String; 
  523.       Submenu : Integer); 
  524.  
  525.    procedure RemoveMenuItem (Item : Integer); 
  526.    pragma Import (StdCall, RemoveMenuItem, "glutRemoveMenuItem"); 
  527.  
  528.    procedure AttachMenu (Button : Integer); 
  529.    pragma Import (StdCall, AttachMenu, "glutAttachMenu"); 
  530.  
  531.    procedure DetachMenu (Button : Integer); 
  532.    pragma Import (StdCall, DetachMenu, "glutDetachMenu"); 
  533.  
  534.    --  GLUT callback sub-API. 
  535.  
  536.    type Glut_Proc_2 is access procedure; 
  537.  
  538.    -- Feature exclusive to the freeglut implementation 
  539.    -- replaced by "null" here 
  540.    procedure CloseFunc (Callback : Glut_Proc_2); 
  541. --   pragma Import (StdCall, CloseFunc, "glutCloseFunc"); 
  542.  
  543.    procedure DisplayFunc (P1 : Glut_Proc_2); 
  544.    pragma Import (StdCall, DisplayFunc, "glutDisplayFunc"); 
  545.    procedure DisplayFunc (P1 : System.Address); 
  546.  
  547.    type Glut_Proc_3 is access procedure (Width : Integer; Height : Integer); 
  548.  
  549.    procedure ReshapeFunc (P1 : Glut_Proc_3); 
  550.    pragma Import (StdCall, ReshapeFunc, "glutReshapeFunc"); 
  551.    procedure ReshapeFunc (P1 : System.Address); 
  552.  
  553.    subtype Key_type is Interfaces.C.Unsigned_Char; 
  554.  
  555.    type Glut_Proc_4 is access 
  556.      procedure (Key : Key_type; X : Integer; Y : Integer); 
  557.  
  558.    procedure KeyboardFunc (P1 : Glut_Proc_4); 
  559.    pragma Import (StdCall, KeyboardFunc, "glutKeyboardFunc"); 
  560.    procedure KeyboardFunc (P1 : System.Address); 
  561.  
  562.    type Glut_KeyUpFunc is access procedure 
  563.      (Key : Key_type; 
  564.       X   : Integer; 
  565.       Y   : in Integer); 
  566.  
  567.    procedure KeyboardUpFunc(P1 : Glut_KeyUpFunc); 
  568.    pragma Import (StdCall, KeyboardUpFunc, "glutKeyboardUpFunc"); 
  569.    procedure KeyboardUpFunc(P1 : System.Address); 
  570.  
  571.    type Glut_Proc_5 is access procedure 
  572.      (Button : Integer; State : Integer; X : Integer; Y : Integer); 
  573.  
  574.    procedure MouseFunc (P1 : Glut_Proc_5); 
  575.    pragma Import (StdCall, MouseFunc, "glutMouseFunc"); 
  576.    procedure MouseFunc (P1 : System.Address); 
  577.  
  578.    type Glut_Proc_6 is access procedure (X : Integer; Y : Integer); 
  579.  
  580.    procedure MotionFunc (P1 : Glut_Proc_6); 
  581.    pragma Import (StdCall, MotionFunc, "glutMotionFunc"); 
  582.    procedure MotionFunc (P1 : System.Address); 
  583.  
  584.    type Glut_Proc_7 is access procedure (X : Integer; Y : Integer); 
  585.  
  586.    procedure PassiveMotionFunc (P1 : Glut_Proc_7); 
  587.    pragma Import (StdCall, PassiveMotionFunc, "glutPassiveMotionFunc"); 
  588.    procedure PassiveMotionFunc (P1 : System.Address); 
  589.  
  590.    type Glut_Proc_8 is access procedure (State : Integer); 
  591.  
  592.    procedure EntryFunc (P1 : Glut_Proc_8); 
  593.    pragma Import (StdCall, EntryFunc, "glutEntryFunc"); 
  594.  
  595.    type Glut_Proc_9 is access procedure (State : Integer); 
  596.  
  597.    procedure VisibilityFunc (P1 : Glut_Proc_9); 
  598.    pragma Import (StdCall, VisibilityFunc, "glutVisibilityFunc"); 
  599.  
  600.    type Glut_Proc_10 is access procedure; 
  601.  
  602.    procedure IdleFunc (P1 : Glut_Proc_10); 
  603.    pragma Import (StdCall, IdleFunc, "glutIdleFunc"); 
  604.    procedure IdleFunc (P1 : System.Address); 
  605.  
  606.    type Glut_Proc_11 is access procedure (Value : Integer); 
  607.  
  608.    procedure TimerFunc 
  609.      (Millis : Unsigned; 
  610.       P2     : Glut_Proc_11; 
  611.       Value  : Integer); 
  612.    pragma Import (StdCall, TimerFunc, "glutTimerFunc"); 
  613.  
  614.    type Glut_Proc_12 is access procedure (State : Integer); 
  615.  
  616.    procedure MenuStateFunc (P1 : Glut_Proc_12); 
  617.    pragma Import (StdCall, MenuStateFunc, "glutMenuStateFunc"); 
  618.  
  619.    type Glut_Proc_13 is access procedure 
  620.      (Key : Integer; X : Integer; Y : Integer); 
  621.  
  622.    procedure SpecialFunc (P1 : Glut_Proc_13); 
  623.    pragma Import (StdCall, SpecialFunc, "glutSpecialFunc"); 
  624.    procedure SpecialFunc (P1 : System.Address); 
  625.  
  626.    type Glut_Proc_14 is access 
  627.      procedure (X : Integer; Y : Integer; Z : Integer); 
  628.  
  629.    procedure SpaceballMotionFunc (P1 : Glut_Proc_14); 
  630.    pragma Import (StdCall, SpaceballMotionFunc, "glutSpaceballMotionFunc"); 
  631.  
  632.    type Glut_Proc_15 is access 
  633.      procedure (X : Integer; Y : Integer; Z : Integer); 
  634.  
  635.    procedure SpaceballRotateFunc (P1 : Glut_Proc_15); 
  636.    pragma Import (StdCall, SpaceballRotateFunc, "glutSpaceballRotateFunc"); 
  637.  
  638.    type Glut_Proc_16 is access procedure (Button : Integer; State : Integer); 
  639.  
  640.    procedure SpaceballButtonFunc (P1 : Glut_Proc_16); 
  641.    pragma Import (StdCall, SpaceballButtonFunc, "glutSpaceballButtonFunc"); 
  642.  
  643.    type Glut_Proc_17 is access procedure (Button : Integer; State : Integer); 
  644.  
  645.    procedure ButtonBoxFunc (P1 : Glut_Proc_17); 
  646.    pragma Import (StdCall, ButtonBoxFunc, "glutButtonBoxFunc"); 
  647.  
  648.    type Glut_Proc_18 is access procedure (Dial : Integer; Value : Integer); 
  649.  
  650.    procedure DialsFunc (P1 : Glut_Proc_18); 
  651.    pragma Import (StdCall, DialsFunc, "glutDialsFunc"); 
  652.  
  653.    type Glut_Proc_19 is access procedure (X : Integer; Y : Integer); 
  654.  
  655.    procedure TabletMotionFunc (P1 : Glut_Proc_19); 
  656.    pragma Import (StdCall, TabletMotionFunc, "glutTabletMotionFunc"); 
  657.  
  658.    type Glut_Proc_20 is access procedure 
  659.      (Button : Integer; State : Integer; X : Integer; Y : Integer); 
  660.  
  661.    procedure TabletButtonFunc (P1 : Glut_Proc_20); 
  662.    pragma Import (StdCall, TabletButtonFunc, "glutTabletButtonFunc"); 
  663.  
  664.    type Glut_Proc_21 is access procedure 
  665.      (Status : Integer; X : Integer; Y : Integer); 
  666.  
  667.    procedure MenuStatusFunc (P1 : Glut_Proc_21); 
  668.    pragma Import (StdCall, MenuStatusFunc, "glutMenuStatusFunc"); 
  669.  
  670.    type Glut_Proc_22 is access procedure; 
  671.  
  672.    procedure OverlayDisplayFunc (P1 : Glut_Proc_22); 
  673.    pragma Import (StdCall, OverlayDisplayFunc, "glutOverlayDisplayFunc"); 
  674.  
  675.    type Glut_Proc_23 is access procedure (State : Integer); 
  676.  
  677.    procedure WindowStatusFunc (P1 : Glut_Proc_23); 
  678.    pragma Import (StdCall, WindowStatusFunc, "glutWindowStatusFunc"); 
  679.  
  680.    --  GLUT color index sub-API. 
  681.  
  682.    procedure SetColor 
  683.      (P1    : Integer; 
  684.       Red   : GL.float; 
  685.       Green : GL.float; 
  686.       Blue  : GL.float); 
  687.    pragma Import (StdCall, SetColor, "glutSetColor"); 
  688.  
  689.    function GetColor 
  690.      (Ndx       : Integer; 
  691.       Component : Integer) 
  692.       return GL.float; 
  693.    pragma Import (StdCall, GetColor, "glutGetColor"); 
  694.  
  695.    procedure CopyColormap (Win : Integer); 
  696.    pragma Import (StdCall, CopyColormap, "glutCopyColormap"); 
  697.  
  698.    --  GLUT state retrieval sub-API. 
  699.  
  700.    function Get (Type_Id : GL.enum) return Integer; 
  701.    pragma Import (StdCall, Get, "glutGet"); 
  702.  
  703.    function DeviceGet (Type_Id : GL.enum) return Integer; 
  704.    pragma Import (StdCall, DeviceGet, "glutDeviceGet"); 
  705.  
  706.    --  GLUT extension support sub-API 
  707.  
  708.    function ExtensionSupported 
  709.      (Name : Interfaces.C.Strings.Chars_Ptr) 
  710.       return Integer; 
  711.    pragma Import (StdCall, ExtensionSupported, "glutExtensionSupported"); 
  712.  
  713.    function ExtensionSupported (Name : String) return Integer; 
  714.  
  715.    function GetModifiers return Integer; 
  716.    pragma Import (StdCall, GetModifiers, "glutGetModifiers"); 
  717.  
  718.    function LayerGet (Type_Id : GL.enum) return Integer; 
  719.    pragma Import (StdCall, LayerGet, "glutLayerGet"); 
  720.  
  721.    --  GLUT font sub-API 
  722.  
  723.    procedure BitmapCharacter 
  724.      (Font      : System.Address; 
  725.       Character : Integer); 
  726.    pragma Import (StdCall, BitmapCharacter, "glutBitmapCharacter"); 
  727.  
  728.    function BitmapWidth 
  729.      (Font      : System.Address; 
  730.       Character : Integer) 
  731.       return Integer; 
  732.    pragma Import (StdCall, BitmapWidth, "glutBitmapWidth"); 
  733.  
  734.    procedure StrokeCharacter 
  735.      (Font      : System.Address; 
  736.       Character : Integer); 
  737.    pragma Import (StdCall, StrokeCharacter, "glutStrokeCharacter"); 
  738.  
  739.    function StrokeWidth 
  740.      (Font      : System.Address; 
  741.       Character : Integer) 
  742.       return Integer; 
  743.    pragma Import (StdCall, StrokeWidth, "glutStrokeWidth"); 
  744.  
  745.    function StrokeLength 
  746.      (Font   : System.Address; 
  747.       String : Interfaces.C.Strings.Chars_Ptr) 
  748.       return Integer; 
  749.    pragma Import (StdCall, StrokeLength, "glutStrokeLength"); 
  750.  
  751.    function BitmapLength 
  752.      (Font   : System.Address; 
  753.       String : Interfaces.C.Strings.Chars_Ptr) 
  754.       return Integer; 
  755.    pragma Import (StdCall, BitmapLength, "glutBitmapLength"); 
  756.  
  757.    --  GLUT pre-built models sub-API 
  758.  
  759.    procedure WireSphere 
  760.      (Radius : GL.double; 
  761.       Slices : GL.int; 
  762.       Stacks : GL.int); 
  763.    pragma Import (StdCall, WireSphere, "glutWireSphere"); 
  764.  
  765.    procedure SolidSphere 
  766.      (Radius : GL.double; 
  767.       Slices : GL.int; 
  768.       Stacks : GL.int); 
  769.    pragma Import (StdCall, SolidSphere, "glutSolidSphere"); 
  770.  
  771.    procedure WireCone 
  772.      (Base   : GL.double; 
  773.       Height : GL.double; 
  774.       Slices : GL.int; 
  775.       Stacks : GL.int); 
  776.    pragma Import (StdCall, WireCone, "glutWireCone"); 
  777.  
  778.    procedure SolidCone 
  779.      (Base   : GL.double; 
  780.       Height : GL.double; 
  781.       Slices : GL.int; 
  782.       Stacks : GL.int); 
  783.    pragma Import (StdCall, SolidCone, "glutSolidCone"); 
  784.  
  785.    procedure WireCube (Size : GL.double); 
  786.    pragma Import (StdCall, WireCube, "glutWireCube"); 
  787.  
  788.    procedure SolidCube (Size : GL.double); 
  789.    pragma Import (StdCall, SolidCube, "glutSolidCube"); 
  790.  
  791.    procedure WireTorus 
  792.      (InnerRadius : GL.double; 
  793.       OuterRadius : GL.double; 
  794.       Sides       : GL.int; 
  795.       Rings       : GL.int); 
  796.    pragma Import (StdCall, WireTorus, "glutWireTorus"); 
  797.  
  798.    procedure SolidTorus 
  799.      (InnerRadius : GL.double; 
  800.       OuterRadius : GL.double; 
  801.       Sides       : GL.int; 
  802.       Rings       : GL.int); 
  803.    pragma Import (StdCall, SolidTorus, "glutSolidTorus"); 
  804.  
  805.    procedure WireDodecahedron; 
  806.    pragma Import (StdCall, WireDodecahedron, "glutWireDodecahedron"); 
  807.  
  808.    procedure SolidDodecahedron; 
  809.    pragma Import (StdCall, SolidDodecahedron, "glutSolidDodecahedron"); 
  810.  
  811.    procedure WireTeapot (Size : GL.double); 
  812.    pragma Import (StdCall, WireTeapot, "glutWireTeapot"); 
  813.  
  814.    procedure SolidTeapot (Size : GL.double); 
  815.    pragma Import (StdCall, SolidTeapot, "glutSolidTeapot"); 
  816.  
  817.    procedure WireOctahedron; 
  818.    pragma Import (StdCall, WireOctahedron, "glutWireOctahedron"); 
  819.  
  820.    procedure SolidOctahedron; 
  821.    pragma Import (StdCall, SolidOctahedron, "glutSolidOctahedron"); 
  822.  
  823.    procedure WireTetrahedron; 
  824.    pragma Import (StdCall, WireTetrahedron, "glutWireTetrahedron"); 
  825.  
  826.    procedure SolidTetrahedron; 
  827.    pragma Import (StdCall, SolidTetrahedron, "glutSolidTetrahedron"); 
  828.  
  829.    procedure WireIcosahedron; 
  830.    pragma Import (StdCall, WireIcosahedron, "glutWireIcosahedron"); 
  831.  
  832.    procedure SolidIcosahedron; 
  833.    pragma Import (StdCall, SolidIcosahedron, "glutSolidIcosahedron"); 
  834.  
  835.    function VideoResizeGet (Param : GL.enum) return Integer; 
  836.    pragma Import (StdCall, VideoResizeGet, "glutVideoResizeGet"); 
  837.  
  838.    procedure SetupVideoResizing; 
  839.    pragma Import (StdCall, SetupVideoResizing, "glutSetupVideoResizing"); 
  840.  
  841.    procedure StopVideoResizing; 
  842.    pragma Import (StdCall, StopVideoResizing, "glutStopVideoResizing"); 
  843.  
  844.    procedure VideoResize 
  845.      (X      : Integer; 
  846.       Y      : Integer; 
  847.       Width  : Integer; 
  848.       Height : Integer); 
  849.    pragma Import (StdCall, VideoResize, "glutVideoResize"); 
  850.  
  851.    procedure VideoPan 
  852.      (X      : Integer; 
  853.       Y      : Integer; 
  854.       Width  : Integer; 
  855.       Height : Integer); 
  856.    pragma Import (StdCall, VideoPan, "glutVideoPan"); 
  857.  
  858.    -- GLUT debugging sub-API 
  859.  
  860.    procedure ReportErrors; 
  861.    pragma Import (StdCall, ReportErrors, "glutReportErrors"); 
  862.  
  863.    -- GLUT device control sub-API 
  864.  
  865.    procedure IgnoreKeyRepeat (Ignore : Integer); 
  866.    pragma Import (StdCall, IgnoreKeyRepeat, "glutIgnoreKeyRepeat"); 
  867.  
  868.    procedure SetKeyRepeat (RepeatMode : Integer); 
  869.    pragma Import (StdCall, SetKeyRepeat, "glutSetKeyRepeat"); 
  870.  
  871.    procedure ForceJoystickFunc; 
  872.    pragma Import (StdCall, ForceJoystickFunc, "glutForceJoystickFunc"); 
  873.  
  874.    --  GLUT game mode sub-API 
  875.  
  876.    procedure GameModeString (String : Interfaces.C.Strings.Chars_Ptr); 
  877.    pragma Import (StdCall, GameModeString, "glutGameModeString"); 
  878.  
  879.    function EnterGameMode return Integer; 
  880.    pragma Import (StdCall, EnterGameMode, "glutEnterGameMode"); 
  881.  
  882.    procedure LeaveGameMode; 
  883.    pragma Import (StdCall, LeaveGameMode, "glutLeaveGameMode"); 
  884.  
  885.    function GameModeGet (Mode : GL.enum) return Integer; 
  886.    pragma Import (StdCall, GameModeGet, "glutGameModeGet"); 
  887.  
  888. end Glut;