- Renderables (have brand new rendering interface)
This commit is contained in:
parent
1d2cc9c01a
commit
6c731231f9
|
@ -1,4 +0,0 @@
|
|||
with Video.Stencils;
|
||||
|
||||
package Video.Renderables.Color.Stencil
|
||||
is new Renderables.Color.Generic_Stencil (Stencil_Type => Video.Stencils.Stencil'Class);
|
|
@ -1,3 +0,0 @@
|
|||
with Video.Colors;
|
||||
|
||||
package Video.Renderables.Color is new Paint_Renderables (Colors.Color);
|
|
@ -1,3 +0,0 @@
|
|||
with Video.Images;
|
||||
|
||||
package Video.Renderables.Image is new Video.Renderables.Generic_Image (Images.Image'Class);
|
|
@ -1,93 +0,0 @@
|
|||
with Video.Integer_Geometry;
|
||||
use Video.Integer_Geometry;
|
||||
|
||||
package Video.Renderables with Pure is
|
||||
-- Basic rendering interface.
|
||||
|
||||
type Root_Renderable is limited interface;
|
||||
-- Basic type for an entity that can render.
|
||||
-- It can be
|
||||
-- - A canvas with rendering procedures attached
|
||||
-- - A rendering session with target locked
|
||||
-- - A hardware device driver (display, printer)
|
||||
|
||||
function Bounding_Box (S : Root_Renderable) return Box is abstract;
|
||||
-- Coordinate limits of a surface
|
||||
|
||||
procedure Sync (S : in out Root_Renderable) is null;
|
||||
-- Make painting available to outer world by e.g.
|
||||
-- - pushing data to the attached graphic device,
|
||||
-- - waiting for painting process to be complete.
|
||||
--
|
||||
-- Alternatively synchronization should be done
|
||||
-- on the destruction of the renderable object
|
||||
|
||||
generic
|
||||
type Paint_Type is private;
|
||||
-- This is a type for something to fill area with
|
||||
package Paint_Renderables is
|
||||
|
||||
type Renderable is limited interface and Root_Renderable;
|
||||
|
||||
procedure Clear (
|
||||
Target : in out Renderable;
|
||||
Paint : Paint_Type) is abstract;
|
||||
|
||||
procedure Write_Pixel (
|
||||
Target : in out Renderable;
|
||||
A : in Point;
|
||||
Paint : in Paint_Type) is abstract;
|
||||
|
||||
procedure Fill_Rectangle (
|
||||
Target : in out Renderable;
|
||||
Bounds : in Box;
|
||||
Paint : in Paint_Type) is abstract;
|
||||
|
||||
procedure Line (
|
||||
Target : in out Renderable;
|
||||
A, B : in Point;
|
||||
Paint : in Paint_Type) is abstract;
|
||||
|
||||
type Curve_Renderable is limited interface and Renderable;
|
||||
|
||||
procedure Circle (
|
||||
Target : in out Curve_Renderable;
|
||||
Center : in Point;
|
||||
Radius : in Distance;
|
||||
Paint : in Paint_Type) is abstract;
|
||||
|
||||
procedure Ellipse (
|
||||
Target : in out Curve_Renderable;
|
||||
Bounds : in Box;
|
||||
Paint : in Paint_Type) is abstract;
|
||||
|
||||
generic
|
||||
type Stencil_Type (<>) is limited private;
|
||||
package Generic_Stencil is
|
||||
type Stencil_Renderable is limited interface and Root_Renderable;
|
||||
|
||||
procedure Fill (
|
||||
Target : in out Stencil_Renderable;
|
||||
A : in Point;
|
||||
Shape : in Stencil_Type;
|
||||
Paint : in Paint_Type) is abstract;
|
||||
end Generic_Stencil;
|
||||
|
||||
end Paint_Renderables;
|
||||
|
||||
--
|
||||
-- Base interface for rendering image (sprite) to image (renderable)
|
||||
--
|
||||
generic
|
||||
type Image_Type (<>) is limited private;
|
||||
package Generic_Image is
|
||||
type Image_Renderable is limited interface and Root_Renderable;
|
||||
|
||||
procedure Paste (
|
||||
Target : in out Image_Renderable;
|
||||
A : Integer_Geometry.Point;
|
||||
Source : Image_Type) is abstract;
|
||||
|
||||
end Generic_Image;
|
||||
|
||||
end Video.Renderables;
|
Loading…
Reference in New Issue