EmilyMansfield / citybuilder

Source code for my SFML Citybuilder tutorial
MIT License
199 stars 51 forks source link

OpenGL doesn't like textures being pushed around #11

Open luitzenhietkamp opened 5 years ago

luitzenhietkamp commented 5 years ago

The solution is to change the loadTexture function. The following should do the trick:

void TextureManager::loadTexture(const std::string& name, const std::string& filename) {
    /* Create the texture in the std::map, then load the texture */
    textures.emplace(name, sf::Texture());
    this->textures[name].loadFromFile(filename);

    return;
}