Implement Window::GetTitle()

This commit is contained in:
Dmitry Marakasov 2015-01-15 17:53:56 +03:00
parent 90fef8ab49
commit 49dd6d2225
2 changed files with 15 additions and 1 deletions

View File

@ -1,6 +1,6 @@
/* /*
libSDL2pp - C++11 bindings/wrapper for SDL2 libSDL2pp - C++11 bindings/wrapper for SDL2
Copyright (C) 2013-2014 Dmitry Marakasov <amdmi3@amdmi3.ru> Copyright (C) 2013-2015 Dmitry Marakasov <amdmi3@amdmi3.ru>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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()); SDL_SetWindowTitle(window_, title.c_str());
} }
std::string Window::GetTitle() const {
return SDL_GetWindowTitle(window_);
}
void Window::Maximize() { void Window::Maximize() {
SDL_MaximizeWindow(window_); SDL_MaximizeWindow(window_);
} }

View File

@ -180,6 +180,16 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetTitle(const std::string& title); 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 /// \brief Make a window as large as possible
/// ///