aboutsummaryrefslogtreecommitdiff
path: root/graphics.ads
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-12-08 10:09:30 +0100
committerCharles <sircharlesaze@gmail.com>2019-12-08 10:09:30 +0100
commit22e73779f55b051d34fc0490fbb55045f3f321d9 (patch)
tree7ae37872135c135d3716a209cea4c8351691863c /graphics.ads
parentc06bc6767163f0215d0c12e04d5a0a54d7d8a167 (diff)
downloadsnake-22e73779f55b051d34fc0490fbb55045f3f321d9.tar.gz
snake-22e73779f55b051d34fc0490fbb55045f3f321d9.tar.bz2
snake-22e73779f55b051d34fc0490fbb55045f3f321d9.zip
Snake Drawing
Diffstat (limited to 'graphics.ads')
-rw-r--r--graphics.ads31
1 files changed, 16 insertions, 15 deletions
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;