For my texture manager I'm trying load a .png file and it keeps giving me an error.
void Engine::loadTextures() {
if (textureManager->loadTexture("tileset.png")) {
rw->draw(textureManager->getTexture("tileset.png"));
}
}
When I'm trying to draw to the renderwindow (rw) it gives me this error: "No matching member function for call to 'draw'
Heres my .h file of my TextureManager class:
namespace Engine {
class TextureManager {
private:
std::map<std::string, sf::Texture> textureList;
public:
TextureManager();
~TextureManager();
bool loadTexture(std::string fileName);
sf::Texture getTexture(std::string fileName);
};
static TextureManager* textureManager;
}
And .cpp file:
Engine::TextureManager::TextureManager() {
}
Engine::TextureManager::~TextureManager() {
}
bool Engine::TextureManager::loadTexture(std::string fileName) {
sf::Texture tempTexture;
if (!tempTexture.loadFromFile(resourcePath() + fileName))
return false;
textureList[fileName] = tempTexture;
return true;
}
sf::Texture Engine::TextureManager::getTexture(std::string fileName) {
return textureList[fileName];
}
Anybody know what the problem is?