From bd1d685c20634316881a276a6ac2b82728df764e Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Mon, 25 May 2020 22:54:58 +0200 Subject: [PATCH] Hid console window for Windows Allegro builds. Removed explicit SDL dependency in game. --- cmd/tins2020/tins2020.go | 8 ++++---- cmd/tins2020/tins2020_windows_allegro.go | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 cmd/tins2020/tins2020_windows_allegro.go diff --git a/cmd/tins2020/tins2020.go b/cmd/tins2020/tins2020.go index 627c8dc..28a454e 100644 --- a/cmd/tins2020/tins2020.go +++ b/cmd/tins2020/tins2020.go @@ -12,7 +12,6 @@ import ( "opslag.de/schobers/zntg/ui" rice "github.com/GeertJohan/go.rice" - "github.com/veandco/go-sdl2/sdl" "opslag.de/schobers/tins2020" ) @@ -135,8 +134,9 @@ func run() error { } defer settings.Store() - if settings.Window.Location == nil { - settings.Window.Location = ptPtr(sdl.WINDOWPOS_UNDEFINED, sdl.WINDOWPOS_UNDEFINED) + var location *geom.PointF32 + if settings.Window.Location != nil { + location = &geom.PointF32{X: float32(settings.Window.Location.X), Y: float32(settings.Window.Location.Y)} } if settings.Window.Size == nil { settings.Window.Size = ptPtr(800, 600) @@ -146,7 +146,7 @@ func run() error { settings.Window.VSync = &vsync } renderer, err := ui.NewRenderer("Botanim - TINS 2020", settings.Window.Size.X, settings.Window.Size.Y, ui.NewRendererOptions{ - Location: &geom.PointF32{X: float32(settings.Window.Location.X), Y: float32(settings.Window.Location.Y)}, + Location: location, Resizable: true, VSync: *settings.Window.VSync, }) diff --git a/cmd/tins2020/tins2020_windows_allegro.go b/cmd/tins2020/tins2020_windows_allegro.go new file mode 100644 index 0000000..66bc469 --- /dev/null +++ b/cmd/tins2020/tins2020_windows_allegro.go @@ -0,0 +1,6 @@ +// +build windows,allegro + +package main + +// #cgo LDFLAGS: -Wl,-subsystem,windows +import "C"