1. -- 
  2. -- Copyright (c) 2013 Kevin Wellwood 
  3. -- All rights reserved. 
  4. -- 
  5. -- This source code is distributed under the Modified BSD License. For terms and 
  6. -- conditions, see license.txt. 
  7. -- 
  8.  
  9. with Interfaces;                        use Interfaces; 
  10.  
  11. -- Allegro 5.0.9 - State 
  12. package Allegro.State is 
  13.  
  14.     type Allegro_State is private; 
  15.     type A_Allegro_State is access all Allegro_State; 
  16.  
  17.     type Allegro_State_Flags is new Unsigned_32; 
  18.  
  19.     ALLEGRO_STATE_NEW_DISPLAY_PARAMETERS : constant Allegro_State_Flags := 16#0001#; 
  20.     ALLEGRO_STATE_NEW_BITMAP_PARAMETERS  : constant Allegro_State_Flags := 16#0002#; 
  21.     ALLEGRO_STATE_DISPLAY                : constant Allegro_State_Flags := 16#0004#; 
  22.     ALLEGRO_STATE_TARGET_BITMAP          : constant Allegro_State_Flags := 16#0008#; 
  23.     ALLEGRO_STATE_BLENDER                : constant Allegro_State_Flags := 16#0010#; 
  24.     ALLEGRO_STATE_NEW_FILE_INTERFACE     : constant Allegro_State_Flags := 16#0020#; 
  25.     ALLEGRO_STATE_TRANSFORM              : constant Allegro_State_Flags := 16#0040#; 
  26.     ALLEGRO_STATE_BITMAP                 : constant Allegro_State_Flags := ALLEGRO_STATE_TARGET_BITMAP or 
  27.                                                                            ALLEGRO_STATE_NEW_BITMAP_PARAMETERS; 
  28.     ALLEGRO_STATE_ALL                    : constant Allegro_State_Flags := 16#ffff#; 
  29.  
  30.     procedure Al_Store_State( state : in out Allegro_State; flags : Allegro_State_Flags ); 
  31.     pragma Import( C, Al_Store_State, "al_store_state" ); 
  32.  
  33.     procedure Al_Restore_State( state : in out Allegro_State ); 
  34.     pragma Import( C, Al_Restore_State, "al_restore_state" ); 
  35.  
  36.     function Al_Get_Errno return Integer; 
  37.     pragma Import( C, Al_Get_Errno, "al_get_errno" ); 
  38.  
  39.     procedure Al_Set_Errno( errnum : Integer ); 
  40.     pragma Import( C, Al_Set_Errno, "al_set_errno" ); 
  41.  
  42. private 
  43.  
  44.     type Allegro_State is 
  45.         record 
  46.             -- internally, a thread-local structure is placed here 
  47.             tls : String(1..1024); 
  48.         end record; 
  49.     pragma Convention( C, Allegro_State ); 
  50.  
  51. end Allegro.State;