From 855db3375ca77edf30b1bb24f82a2b0634f6372a Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Sat, 23 May 2020 11:08:50 +0200 Subject: [PATCH] Added build flag to switch to Allegro backend. Added logs that print which backend is used. --- cmd/tins2020/tins2020.go | 3 --- cmd/tins2020/tins2020_allegro.go | 13 +++++++++++++ cmd/tins2020/tins2020_sdl.go | 13 +++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 cmd/tins2020/tins2020_allegro.go create mode 100644 cmd/tins2020/tins2020_sdl.go diff --git a/cmd/tins2020/tins2020.go b/cmd/tins2020/tins2020.go index 759b133..9e27834 100644 --- a/cmd/tins2020/tins2020.go +++ b/cmd/tins2020/tins2020.go @@ -12,9 +12,6 @@ import ( "opslag.de/schobers/zntg/play" "opslag.de/schobers/zntg/ui" - _ "opslag.de/schobers/zntg/sdlui" // rendering backend - // _ "opslag.de/schobers/zntg/allg5ui" // rendering backend - rice "github.com/GeertJohan/go.rice" "github.com/veandco/go-sdl2/sdl" "opslag.de/schobers/tins2020" diff --git a/cmd/tins2020/tins2020_allegro.go b/cmd/tins2020/tins2020_allegro.go new file mode 100644 index 0000000..c95ac49 --- /dev/null +++ b/cmd/tins2020/tins2020_allegro.go @@ -0,0 +1,13 @@ +// +build allegro + +package main + +import ( + "log" + + _ "opslag.de/schobers/zntg/allg5ui" // rendering backend +) + +func init() { + log.Println("Using Allegro5 rendering backend") +} diff --git a/cmd/tins2020/tins2020_sdl.go b/cmd/tins2020/tins2020_sdl.go new file mode 100644 index 0000000..6302110 --- /dev/null +++ b/cmd/tins2020/tins2020_sdl.go @@ -0,0 +1,13 @@ +// +build !allegro + +package main + +import ( + "log" + + _ "opslag.de/schobers/zntg/sdlui" // SDL rendering backend +) + +func init() { + log.Println("Using SDL rendering backend") +}