diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-12-07 11:22:54 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-12-07 11:22:54 +0100 |
| commit | 9b47ade2394becce870d195f198c235b3275ed34 (patch) | |
| tree | 0f6967b8014c76096a3edf464d1324c83da1be1b | |
| parent | 6f2fc1af33d8f1ead133f9ea4ef05c026be5c9e2 (diff) | |
| download | snake-9b47ade2394becce870d195f198c235b3275ed34.tar.gz snake-9b47ade2394becce870d195f198c235b3275ed34.tar.bz2 snake-9b47ade2394becce870d195f198c235b3275ed34.zip | |
Basic Graphics (bindings are working! game/graphics/queue packages draft
| -rw-r--r-- | game.adb | 0 | ||||
| -rw-r--r-- | game.ads | 0 | ||||
| -rw-r--r-- | graphics.adb | 0 | ||||
| -rw-r--r-- | graphics.ads | 17 | ||||
| -rw-r--r-- | main.adb | 27 | ||||
| -rw-r--r-- | queue.adb | 0 | ||||
| -rw-r--r-- | queue.ads | 21 |
7 files changed, 64 insertions, 1 deletions
diff --git a/game.adb b/game.adb new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/game.adb diff --git a/game.ads b/game.ads new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/game.ads diff --git a/graphics.adb b/graphics.adb new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/graphics.adb diff --git a/graphics.ads b/graphics.ads new file mode 100644 index 0000000..78a4542 --- /dev/null +++ b/graphics.ads @@ -0,0 +1,17 @@ +with SDL; + +with Game; + + +package Graphics is + + type T_State is record + running: Boolean; + window: SDL.Window; + renderer: SDL.Renderer; + game: T_Game; + end record; + + procedure EventHandler( + +end Graphics; @@ -2,10 +2,35 @@ with Ada.Text_IO; use Ada.Text_IO; with SDL; +with SDL.Error; +with SDL.Video.Renderers; +with SDL.Video.Windows; + +with SDL.Timers; + +with SDL.Video.Windows.Makers; +use SDL.Video.Windows.Makers; + +with SDL.Video.Renderers.Makers; +use SDL.Video.Renderers.Makers; + procedure Main is + window: SDL.Video.Windows.Window; + renderer: SDL.Video.Renderers.Renderer; begin if not SDL.Initialise then - Put("Error"); + Put(SDL.Error.Get); + return; end if; + + Create(window, "bonjour", 10, 10, 400, 400); + Create(renderer, window); + + SDL.Timers.Wait_Delay(1000); + + + + + SDL.Finalise; end Main; diff --git a/queue.adb b/queue.adb new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/queue.adb diff --git a/queue.ads b/queue.ads new file mode 100644 index 0000000..e0da54c --- /dev/null +++ b/queue.ads @@ -0,0 +1,21 @@ +generic + type T_Data is limited private; +package Queue is + + type T_Queue is record + front: T_List; + back: T_List; + end record; + + type T_List_Cell; + type T_List is access T_List_Cell; + type T_List_Cell is record + data: T_Data; + next: T_List; + end record; + + procedure Enqueue(queue: T_Queue; + data: T_Data); + procedure Dequeue(queue: T_Queue); + +end Queue; |
