1
Graphics / std::map and sf::Texture
« on: August 20, 2011, 11:32:35 pm »
Hi, why this code throw
If I make a sprite, set the texture to it, and draw the sprite, works, but why throw "failed to create texture"?
Thanks.
Code: [Select]
Failed to create texture, invalid size (0x0)
Code: [Select]
#include <SFML/Graphics.hpp>
#include <map>
int main()
{
std::map<int,sf::Texture> myTexture;
myTexture[0].LoadFromFile("image.jpg");
return 0;
}
If I make a sprite, set the texture to it, and draw the sprite, works, but why throw "failed to create texture"?
Thanks.