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