diff --git a/interface.go b/interface.go index 092ff08..2c265a5 100644 --- a/interface.go +++ b/interface.go @@ -22,6 +22,7 @@ type Engine interface { // Clear the full canvas and set this color. Clear(Color) + SetTitle(string) DrawPoint(Color, Point) DrawLine(Color, Point, Point) DrawRect(Color, Rect) diff --git a/sdl/sdl.go b/sdl/sdl.go index 9bdd1e7..a3a176a 100644 --- a/sdl/sdl.go +++ b/sdl/sdl.go @@ -84,6 +84,12 @@ func (r *Renderer) Setup() error { return nil } +// SetTitle sets the SDL window title. +func (r *Renderer) SetTitle(title string) { + r.title = title + r.window.SetTitle(title) +} + // GetTicks gets SDL's current tick count. func (r *Renderer) GetTicks() uint32 { return sdl.GetTicks()