Video_library/source/backends/sdl/video-backends-sdl-surfaces...

42 lines
1.1 KiB
Ada

with System;
use System;
with Video.Backends.SDL.Pixels, Video.Backends.SDL.Rects;
use Video.Backends.SDL.Pixels, Video.Backends.SDL.Rects;
package Video.Backends.SDL.Surfaces is
subtype Surface_Flags is Unsigned_32;
type Surface is record
flags : Surface_Flags;
format : Pixel_Format_Access;
w, h : C.int;
pitch : C.int;
pixels : Address;
userdata : Address;
locked : C.int;
list_blitmap : Address;
clip_rect : Rect;
map : Address;
refcount : C.int;
end record with Convention => C;
type Surface_Access is access all Surface with Convention => C;
generic
type Pixel is private;
type Raster is array (Integer range <>, Integer range <>) of aliased Pixel;
Default : Pixel;
package Raster_Conversions is
procedure Copy (
Source : in Raster;
Target : in out Surface)
with
Pre => Source'Length (1) = Target.h
and Source'Length (2) = Target.w
and Target.format.Bits_Per_Pixel = Pixel'Size;
-- Copy video raster to sdl surface. Source and target should have same dimensions
end Raster_Conversions;
end Video.Backends.SDL.Surfaces;