From 49dd6d222559b238bbf2351f468bc3b9fdab7bcb Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Thu, 15 Jan 2015 17:53:56 +0300 Subject: [PATCH] Implement Window::GetTitle() --- SDL2pp/Window.cc | 6 +++++- SDL2pp/Window.hh | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/SDL2pp/Window.cc b/SDL2pp/Window.cc index 71ef909..ba8c731 100644 --- a/SDL2pp/Window.cc +++ b/SDL2pp/Window.cc @@ -1,6 +1,6 @@ /* libSDL2pp - C++11 bindings/wrapper for SDL2 - Copyright (C) 2013-2014 Dmitry Marakasov + Copyright (C) 2013-2015 Dmitry Marakasov This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -79,6 +79,10 @@ void Window::SetTitle(const std::string& title) { SDL_SetWindowTitle(window_, title.c_str()); } +std::string Window::GetTitle() const { + return SDL_GetWindowTitle(window_); +} + void Window::Maximize() { SDL_MaximizeWindow(window_); } diff --git a/SDL2pp/Window.hh b/SDL2pp/Window.hh index adf9eee..e98baa5 100644 --- a/SDL2pp/Window.hh +++ b/SDL2pp/Window.hh @@ -180,6 +180,16 @@ public: //////////////////////////////////////////////////////////// void SetTitle(const std::string& title); + //////////////////////////////////////////////////////////// + /// \brief Get window title + /// + /// \returns Title of the window in UTF-8 format or "" if there is no title + /// + /// \see http://wiki.libsdl.org/SDL_GetWindowTitle + /// + //////////////////////////////////////////////////////////// + std::string GetTitle() const; + //////////////////////////////////////////////////////////// /// \brief Make a window as large as possible ///