SFML community forums

Help => Graphics => Topic started by: StrengthSauce on April 27, 2015, 09:24:31 pm

Title: How to load multiple textures and sprites efficiently?
Post by: StrengthSauce on April 27, 2015, 09:24:31 pm
Hi, I'm new to SFML, so I'm wondering how you would load multiple textures in the best way possible, and what exactly to put in the brackets in the middle.
What I have so far is:
//Load the textures. Textures start with a t.
        sf::Texture tVillage, tLogo;
        if (!tVillage.loadFromFile("Village.bmp"), (!tLogo.loadFromFile("Logo.png")))
        {
                //What exactly do I put in here?
        }
       
        //Load the sprites. Sprites start with an s.
        sf::Sprite sVillage, sLogo;
        sVillage.setTexture(tVillage), sLogo.setTexture(tLogo);
Title: Re: How to load multiple textures and sprites efficiently?
Post by: Nexus on April 27, 2015, 10:09:07 pm
Error handling... You should really read SFML's tutorials and documentation.

And your use of the comma operator indicates that you also lack some C++ knowledge... Maybe having another look at a good C++ book (http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list) before delving into SFML is a good idea.