with Allegro.Bitmaps; use Allegro.Bitmaps;
with Allegro.Truecolor; use Allegro.Truecolor;
with Font_API; use Font_API;
package Drawing_Contexts is
type Layer_Type is (Background, Foreground);
type Drawing_Context is private;
function Create_Drawing_Context( bmp : not null A_Bitmap;
offx,
offy : Integer;
layer : Layer_Type ) return Drawing_Context;
procedure Blit( dc : Drawing_Context;
source : A_Bitmap;
source_x,
source_y,
dest_x,
dest_y : Integer;
width,
height : Natural );
procedure Clear_To_Color( dc : Drawing_Context; color : Color_Type );
procedure Draw_Alpha_Sprite( dc : Drawing_Context;
sprite : A_Bitmap;
x, y : Integer );
procedure Draw_Sprite( dc : Drawing_Context;
sprite : A_Bitmap;
x, y : Integer );
function Get_Layer( dc : Drawing_Context ) return Layer_Type;
procedure Line( dc : Drawing_Context;
x1, y1,
x2, y2 : Integer;
color : Color_Type );
procedure Rect( dc : Drawing_Context;
x1, y1,
x2, y2 : Integer;
color : Color_Type;
opacity : Natural := 255 );
pragma Precondition( opacity <= 255 );
procedure Rectfill( dc : Drawing_Context;
x1, y1,
x2, y2 : Integer;
color : Color_Type;
opacity : Natural := 255 );
pragma Precondition( opacity <= 255 );
procedure Stretch_Blit( dc : Drawing_Context;
bmp : A_Bitmap;
source_x,
source_y : Integer;
source_width,
source_height : Positive;
dest_x,
dest_y : Integer;
dest_width,
dest_height : Positive );
procedure Stretch_Sprite( dc : Drawing_Context;
sprite : A_Bitmap;
x, y : Integer;
w, h : Positive;
proportional : Boolean );
procedure Textout( dc : Drawing_Context;
f : Font_Type;
s : String;
x, y : Integer;
color : Color_Type;
smooth : Boolean );
procedure Triangle( dc : Drawing_Context;
x1, y1 : Integer;
x2, y2 : Integer;
x3, y3 : Integer;
color : Color_Type;
opacity : Natural := 255 );
pragma Precondition( opacity <= 255 );
private
type Drawing_Context is
record
bmp : A_Bitmap := null;
offx,
offy : Integer := 0;
layer : Layer_Type := Background;
end record;
end Drawing_Contexts;