with Allegro.Truecolor; use Allegro.Truecolor;
package Allegro.Bitmaps is
type Gfx_Vtable is private;
type A_Gfx_Vtable is access all Gfx_Vtable;
type Bitmap is private;
type A_Bitmap is access all Bitmap;
pragma No_Strict_Aliasing( A_Bitmap );
procedure Acquire_Bitmap( bmp : not null A_Bitmap );
procedure Acquire_Screen;
procedure Add_Clip_Rect( bmp : not null A_Bitmap; x1, y1, x2, y2 : Integer );
function Bitmap_Color_Depth( bmp : not null A_Bitmap ) return Integer;
function Bitmap_Mask_Color( bmp : not null A_Bitmap ) return Color_Type;
function Create_Bitmap( width, height : Positive ) return A_Bitmap;
function Create_Bitmap_Ex( color_depth, width, height : Positive ) return A_Bitmap;
function Create_Sub_Bitmap( parent : not null A_Bitmap;
x, y : Integer;
width,
height : Positive ) return A_Bitmap;
function Create_System_Bitmap( width, height : Positive ) return A_Bitmap;
function Create_Video_Bitmap( width, height : Positive ) return A_Bitmap;
procedure Destroy_Bitmap( bmp : in out A_Bitmap );
procedure Get_Clip_Rect( bmp : not null A_Bitmap;
x1, y1,
x2, y2 : out Integer );
function Get_Clip_State( bmp : not null A_Bitmap ) return Integer;
function Get_Dat( bmp : A_Bitmap ) return Address;
function Get_Height( bmp : A_Bitmap ) return Integer;
function Get_Screen return A_Bitmap;
function Get_Screen_H return Integer;
function Get_Screen_W return Integer;
function Get_Virtual_H return Integer;
function Get_Virtual_W return Integer;
function Get_Width( bmp : A_Bitmap ) return Integer;
function Is_Inside_Bitmap( bmp : not null A_Bitmap; x, y, clip : Integer ) return Integer;
function Is_Linear_Bitmap( bmp : A_Bitmap ) return Integer;
function Is_Memory_Bitmap( bmp : A_Bitmap ) return Integer;
function Is_Planar_Bitmap( bmp : A_Bitmap ) return Integer;
function Is_Same_Bitmap( bmp1, bmp2 : A_Bitmap ) return Integer;
function Is_Screen_Bitmap( bmp : A_Bitmap ) return Integer;
function Is_Sub_Bitmap( bmp : A_Bitmap ) return Integer;
function Is_System_Bitmap( bmp : A_Bitmap ) return Integer;
function Is_Video_Bitmap( bmp : A_Bitmap ) return Integer;
procedure Lock_Bitmap( bmp : not null A_Bitmap );
procedure Release_Bitmap( bmp : not null A_Bitmap );
procedure Release_Screen;
procedure Set_Clip_Rect( bmp : not null A_Bitmap; x1, y1, x2, y2 : Integer );
procedure Set_Clip_State( bmp : not null A_Bitmap; state : Integer );
private
type Gfx_Vtable is
record
color_depth : Integer;
mask_color : Integer;
unwrite_bank : Address;
set_clip : Address;
acquire : Address;
release : Address;
create_sub_bitmap : Address;
created_sub_bitmap : Address;
getpixel : Address;
putpixel : Address;
vline : Address;
hline : Address;
hfill : Address;
line : Address;
fastline : Address;
rectfill : Address;
triangle : Address;
draw_sprite : Address;
draw_256_sprite : Address;
draw_sprite_v_flip : Address;
draw_sprite_h_flip : Address;
draw_sprite_vh_flip : Address;
draw_trans_sprite : Address;
draw_trans_rgba_sprite : Address;
draw_lit_sprite : Address;
draw_rle_sprite : Address;
draw_trans_rle_sprite : Address;
draw_trans_rgba_rle_sprite : Address;
draw_lit_rle_sprite : Address;
draw_character : Address;
draw_glyph : Address;
blit_from_memory : Address;
blit_to_memory : Address;
blit_from_system : Address;
blit_to_system : Address;
blit_to_self : Address;
blit_to_self_forward : Address;
blit_to_self_backward : Address;
blit_between_formats : Address;
masked_blit : Address;
clear_to_color : Address;
pivot_scaled_sprite_flip : Address;
do_stretch_blit : Address;
draw_gouraud_sprite : Address;
draw_sprite_end : Address;
blit_end : Address;
polygon : Address;
rect : Address;
circle : Address;
circlefill : Address;
elipse : Address;
elipsefill : Address;
arc : Address;
spline : Address;
floodfill : Address;
polygon3d : Address;
polygon3d_f : Address;
triangle3d : Address;
triangle3d_f : Address;
quad3d : Address;
quad3d_f : Address;
draw_sprite_ex : Address;
end record;
pragma Convention( C, Gfx_Vtable );
type Bitmap is
record
w, h : Integer;
clip : Integer;
cl, cr,
ct, cb : Integer;
vtable : A_Gfx_Vtable;
write_bank : Address;
read_bank : Address;
dat : Address;
id : Unsigned_64;
extra : Address;
x_ofs,
y_ofs : Integer;
seg : Integer;
line : Address;
end record;
pragma Convention( C, Bitmap );
pragma Import( C, Acquire_Bitmap, "acquire_bitmap" );
pragma Import( C, Acquire_Screen, "acquire_screen" );
pragma Import( C, Add_Clip_Rect, "add_clip_rect" );
pragma Import( C, Bitmap_Color_Depth, "bitmap_color_depth" );
pragma Import( C, Bitmap_Mask_Color, "bitmap_mask_color" );
pragma Import( C, Create_Bitmap, "create_bitmap" );
pragma Import( C, Create_Bitmap_Ex, "create_bitmap_ex" );
pragma Import( C, Create_Sub_Bitmap, "create_sub_bitmap" );
pragma Import( C, Create_System_Bitmap, "create_systsem_bitmap" );
pragma Import( C, Create_Video_Bitmap, "create_video_bitmap" );
pragma Import( C, Get_Clip_Rect, "get_clip_rect" );
pragma Import( C, Get_Clip_State, "get_clip_state" );
pragma Import( C, Get_Screen, "get_screen" );
pragma Import( C, Get_Screen_H, "get_screen_h" );
pragma Import( C, Get_Screen_W, "get_screen_w" );
pragma Import( C, Get_Virtual_H, "get_virtual_h" );
pragma Import( C, Get_Virtual_W, "get_virtual_w" );
pragma Import( C, Is_Inside_Bitmap, "is_inside_bitmap" );
pragma Import( C, Is_Linear_Bitmap, "is_linear_bitmap" );
pragma Import( C, Is_Memory_Bitmap, "is_memory_bitmap" );
pragma Import( C, Is_Planar_Bitmap, "is_planar_bitmap" );
pragma Import( C, Is_Same_Bitmap, "is_same_bitmap" );
pragma Import( C, Is_Screen_Bitmap, "is_screen_bitmap" );
pragma Import( C, Is_Sub_Bitmap, "is_sub_bitmap" );
pragma Import( C, Is_System_Bitmap, "is_system_bitmap" );
pragma Import( C, Is_Video_Bitmap, "is_video_bitmap" );
pragma Import( C, Lock_Bitmap, "lock_bitmap" );
pragma Import( C, Release_Bitmap, "release_bitmap" );
pragma Import( C, Release_Screen, "release_screen" );
pragma Import( C, Set_Clip_Rect, "set_clip_rect" );
pragma Import( C, Set_Clip_State, "set_clip_state" );
end Allegro.Bitmaps;