Move sf::Rect printer to GraphicsUtil

This commit is contained in:
Chris Thrasher 2022-03-24 12:14:49 -06:00 committed by Lukas Dürrenberger
parent 9b3735c05f
commit bc7ec1277a
2 changed files with 9 additions and 9 deletions

View File

@ -8,6 +8,8 @@
#include "WindowUtil.hpp"
#include <SFML/Graphics/Rect.hpp>
namespace sf
{
struct BlendMode;
@ -17,6 +19,13 @@ namespace sf
std::ostream& operator <<(std::ostream& os, const BlendMode& blendMode);
std::ostream& operator <<(std::ostream& os, const Color& color);
std::ostream& operator <<(std::ostream& os, const Transform& transform);
template <typename T>
std::ostream& operator <<(std::ostream& os, const sf::Rect<T>& rect)
{
os << "(left=" << rect.left << ", top=" << rect.top << ", width=" << rect.width << ", height=" << rect.height << ")";
return os;
}
}
#endif // SFML_TESTUTILITIES_GRAPHICS_HPP

View File

@ -8,21 +8,12 @@
#include "SystemUtil.hpp"
#include <SFML/Graphics/Rect.hpp>
// String conversions for doctest framework
namespace sf
{
class VideoMode;
std::ostream& operator <<(std::ostream& os, const sf::VideoMode& videoMode);
template <typename T>
std::ostream& operator <<(std::ostream& os, const sf::Rect<T>& rect)
{
os << "(left=" << rect.left << ", top=" << rect.top << ", width=" << rect.width << ", height=" << rect.height << ")";
return os;
}
}
#endif // SFML_TESTUTILITIES_WINDOW_HPP