From 22e73779f55b051d34fc0490fbb55045f3f321d9 Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 8 Dec 2019 10:09:30 +0100 Subject: Snake Drawing --- graphics.ads | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'graphics.ads') diff --git a/graphics.ads b/graphics.ads index 1450381..1f58de3 100644 --- a/graphics.ads +++ b/graphics.ads @@ -1,19 +1,10 @@ with SDL; - --- with Game; --- use Game; - -with SDL.Video.Windows.Makers; -use SDL.Video.Windows.Makers; - -with SDL.Video.Renderers.Makers; -use SDL.Video.Renderers.Makers; - +with SDL.Video.Windows; with SDL.Video.Renderers; -use SDL.Video.Renderers; +with SDL.Video.Palettes; -with SDL.Video.Windows; -use SDL.Video.Windows; +with Game; +use Game; package Graphics is @@ -23,9 +14,14 @@ package Graphics is WINDOW_WIDTH: constant SDL.Positive_Dimension := 400; WINDOW_HEIGHT: constant SDL.Positive_Dimension := 400; + COLOR_WHITE: constant SDL.Video.Palettes.Colour := (255, 255, 255, 255); + COLOR_BLACK: constant SDL.Video.Palettes.Colour := (0, 0, 0, 255); + COLOR_RED: constant SDL.Video.Palettes.Colour := (255, 0, 0, 255); + COLOR_GREEN: constant SDL.Video.Palettes.Colour := (0, 255, 0, 255); + type T_State is record running: Boolean; - -- game: T_Game; + game: T_Game; window: SDL.Video.Windows.Window; renderer: SDL.Video.Renderers.Renderer; end record; @@ -33,6 +29,11 @@ package Graphics is procedure Init(state: out T_State); procedure Quit(state: T_State); procedure Run(state: in out T_State); + +private + procedure Event_Handler(state: in out T_State); - procedure Update(state: T_State); + procedure Update(state: in out T_State); + procedure Draw_Square(state: in out T_State; + pos: T_Position); end Graphics; -- cgit