libSDL2pp/SDL2pp/SDLTTF.hh
2014-12-28 03:32:13 +03:00

83 lines
2.6 KiB
C++

/*
libSDL2pp - C++11 bindings/wrapper for SDL2
Copyright (C) 2014 Dmitry Marakasov <amdmi3@amdmi3.ru>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef SDL2PP_SDLTTF_HH
#define SDL2PP_SDLTTF_HH
namespace SDL2pp {
////////////////////////////////////////////////////////////
/// \brief Object taking care of SDL_image library (de-)initialization
///
/// \ingroup image
///
/// \headerfile SDL2pp/SDLTTF.hh
///
/// To use SDL_ttf functions, SDL_ttf library must be initialized first.
/// This initialization and automatic deinitialization is handled by
/// this class. You may only use SDL_ttf (Font class) functionality
/// while SDLTTF object lives. SDL itself must not be initialized to use
/// TTF
///
/// Usage example:
/// \code
/// int main() {
/// SDL2pp::SDLTTF ttf;
///
/// // ...use SDL_ttf functions...
///
/// // SDL_ttf library is automatically deinitialized before exit
/// return 0;
/// }
/// \endcode
///
////////////////////////////////////////////////////////////
class SDLTTF {
public:
////////////////////////////////////////////////////////////
/// \brief Initializes SDL_ttf library
///
/// \throws SDL2pp::Exception
///
/// \see https://www.libsdl.org/projects/SDL_ttf/docs/SDL_ttf.html#SEC8
///
////////////////////////////////////////////////////////////
SDLTTF();
////////////////////////////////////////////////////////////
/// \brief Destructor, deinitializes SDL_ttf library
///
/// \see https://www.libsdl.org/projects/SDL_ttf/docs/SDL_ttf.html#SEC10
///
////////////////////////////////////////////////////////////
virtual ~SDLTTF();
// Deleted copy/move constructors and assignments
SDLTTF(const SDLTTF& other) = delete;
SDLTTF(SDLTTF&& other) = delete;
SDLTTF& operator=(const SDLTTF& other) = delete;
SDLTTF& operator=(SDLTTF&& other) = delete;
};
}
#endif