1. ------------------------------------------------------------------------------ 
  2.  --  File :            Game_control.ads 
  3.  --  Description :     Command set for games, based on GLUT 
  4.  --  Copyright (c) Gautier de Montmollin/Rod Kay 2007 
  5.  ------------------------------------------------------------------------------ 
  6.  
  7.  -- with GLOBE_3D; 
  8.  -- with GL; 
  9.  -- with Game_control; 
  10.  
  11. package GLUT.Devices is 
  12.  
  13.    procedure Initialize; 
  14.    -- 
  15.    -- Sets up the GLUT mouse and keybaord devices. 
  16.  
  17.    -- Keyboard 
  18.    -- 
  19.  
  20.    type Key_set         is array (Character) of Boolean; 
  21.    type Modifier_set    is array (GLUT.Active_Shift .. GLUT.Active_Alt) of Boolean; 
  22.    type Special_set     is array (1 .. 200) of Boolean; 
  23.    type Special_key_set is array (1 .. 128) of Boolean; 
  24.  
  25.    type Keyboard is 
  26.       record 
  27.          normal_set      : Key_set   := (others => False); 
  28.          normal_set_mem  : Key_set   := (others => False); 
  29.  
  30.          modif_set        : Devices.Modifier_set    := (others => False); 
  31.          special_set      : Devices.Special_set     := (others => False); 
  32.          special_set_mem  : Devices.Special_key_set := (others => False); 
  33.       end record; 
  34.  
  35.    type p_Keyboard is access all Keyboard; 
  36.  
  37.    default_Keyboard  : aliased Keyboard; 
  38.  
  39.    function Strike_once (c  :        Character; 
  40.                          kb : access Keyboard := default_Keyboard'Access) return Boolean; 
  41.  
  42.    function Strike_once (special :        Integer; 
  43.                          kb      : access Keyboard := default_Keyboard'Access) return Boolean; 
  44.  
  45.    -- Mouse 
  46.    -- 
  47.  
  48.    type mouse_button_Set is array (GLUT.LEFT_BUTTON .. GLUT.RIGHT_BUTTON) of Boolean; 
  49.  
  50.    type Mouse is 
  51.       record 
  52.          oldx, oldy, mx, my  : Integer          := 0; 
  53.          button_state        : mouse_button_Set := (others => False); 
  54.       end record; 
  55.  
  56.    type p_Mouse is access all Mouse; 
  57.  
  58.    default_Mouse  : aliased Mouse; 
  59.  
  60. end GLUT.Devices;