2
« le: Avril 25, 2012, 09:14:15 pm »
Salut!
Lorsque j'essaie de charger une texture, je ne peux voir que le rectangle englobant de celle-ci (un rectangle blanc). De plus, dans la console, j'ai l'erreur: "An internal OpenGL call failed in Texture.cpp (147) : GL_INVALID_ENUM, an unacceptable value has been specified for an enumerated argument".
Voici mon code:
for (unsigned int i = 0; i < IMAGE_TYPE::END; i++)
{
sf::Image img;
sf::Texture text;
sf::Sprite sprite;
string ressToGet = "Ressources\\Textures\\"+ini.Get(boost::lexical_cast<string>(i),"");
cout << "Essaie de charger: " << ressToGet << endl;
if (ressToGet != "" && ressToGet != "Ressources\\Textures\\")
{
if (img.loadFromFile(ressToGet))
{
this->images.push_back(img);
text.loadFromImage(img);
cout << "1" << endl;
this->textures.push_back(text);
cout << "2" << endl;
sprite.setTexture(text);
this->sprites.push_back(sprite);
cout << "Texture chargee" << endl;
}
else
{
//throw std::exception("Impossible de charger la texture");
cout << "Impossible de charger la texture" << endl;
}
}
}
Merci!