So, I'm trying to update my texture but when I do that my game triggers a assertion which tells me :
Assertion failed: x + window.getSize().x <= m_size.x, file (long path)\Texture.cpp
In my code, this line triggers the assertion :
gResourceMgr.GetTexture(textureName)->update(gGraphics.GetWindow());
GetTexture() is this :
sf::Texture* ResourceManager::GetTexture(std::string file)
{
if (textures.find(file) != textures.end())
{
return textures.find(file)->second;
}
else
{
std::cout << "Failed to get file : " << file << " from resource manager." << std::endl;
return nullptr;
}
}
And the textures map looks like this :
std::map<std::string, sf::Texture*> textures;
The gGraphics.GetWindow() function simply returns a reference to the games RenderWindow.
Unsure what I'm doing wrong :/