Hi,
I made a function that is supposed to draw a text on a RenderTarget. But I an error message saying that "No instance of overloaded function could be found.". Here is my function:
void DrawStringInBox(const sf::RenderTarget &xindox, const std::string& String, const sf::Font& font) {
sf::Text text(String, font);
xindox.draw(text);
}
But, it works fine when I remove the const before the RenderTarget:
void DrawStringInBox(sf::RenderTarget &xindox, const std::string& String, const sf::Font& font) {
sf::Text text(String, font);
xindox.draw(text);
}
Why? Isn't draw() a const function? And if it isn't, why wouldn't it be?