1. ------------------------------------------------------------------------------ 
  2.  --  File :            Game_control.ads 
  3.  --  Description :     Command set for games, based on GLUT 
  4.  --  Copyright (c) Gautier de Montmollin 2002, 2005 .. 2008 
  5.  ------------------------------------------------------------------------------ 
  6.  -- Cannibalized from Game_Driving (see Engine_3D) 
  7.  
  8.  --  To do : programmable behaviour 
  9.  
  10. with GL, GLUT.Devices; 
  11.  
  12. package Game_Control is 
  13.  
  14.    type Command is ( 
  15.                     go_forward, 
  16.                     go_backwards, 
  17.                     go_graduated, 
  18.                     slide_left, 
  19.                     slide_right, 
  20.                     slide_lateral_graduated, 
  21.                     turn_left, 
  22.                     turn_right, 
  23.                     turn_lateral_graduated, 
  24.                     slide_up, 
  25.                     slide_down, 
  26.                     slide_vertical_graduated, 
  27.                     turn_up, 
  28.                     turn_down, 
  29.                     turn_vertical_graduated, 
  30.                     run_mode, 
  31.                     ctrl_mode, -- "shoot", but useless with GLUT 
  32.                     slide_mode, 
  33.                     swing_plus, 
  34.                     swing_minus, 
  35.                     jump, 
  36.                     special_plus, 
  37.                     special_minus, 
  38.                     photo, video, 
  39.                     toggle_10, 
  40.                     interrupt_game, 
  41.                     n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, -- numeric keys 
  42.                     bogus_command  -- a control can be directed on this 
  43.                    ); 
  44.    pragma Ordered (Command); 
  45.  
  46.   type Command_set is array (Command) of Boolean; 
  47.  
  48.   -- The empty command set: 
  49.   no_command : constant Command_set := (others => False); 
  50.  
  51.   -- Function Set_ .. . 
  52.  
  53.   --  keyboard_command_mapping : array (Multi_keys.key_value) of Command := 
  54.   --    (others => bogus_command); -- for later !! 
  55.  
  56.   --  mouse_command_mapping    : array (PC_Mouse.Mouse_button) of Command := 
  57.   --    (others => bogus_command); -- for later !! 
  58.  
  59.   -- Record game commands from peripherals (keyboard, mouse) -- 
  60.  
  61.   procedure Append_Commands (size_x, 
  62.                              size_y      :        Integer;                  -- screen dimensions for mouse 
  63.                              warp_mouse  :        Boolean;                  -- recenter mouse cursor 
  64.                              c           : in out Game_Control.Command_set; -- commands are added to c 
  65.                              gx, gy      :    out GL.Double;                -- mouse movement since last call 
  66.                              Keyboard    : access GLUT.Devices.Keyboard := GLUT.Devices.default_Keyboard'Access; 
  67.                              Mouse       : access GLUT.Devices.Mouse    := GLUT.Devices.default_Mouse'Access); 
  68.  
  69. end Game_Control;