This is my code:
int main()
{ ///Test to learn how to draw individual bullets
sf::RenderWindow window(sf::VideoMode(800, 600), "Bullet Testing"); ///Es necesario usar RenderWindow para dibujar algo.
sf::Event event;
sf::Texture Img;
Img.loadFromFile("S_Circle.psd");
sf::Sprite Sprite;
Sprite.setTexture(Img, true);
Sprite.setColor(sf::Color(255, 255, 255, 200));
Sprite.setScale(2.f, 2.f);
Sprite.setPosition(100, 25);
while (window.isOpen())
{
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(Sprite);
window.display();
}
return 0;
}
What I am trying to do is to call a 16x16 pixels photoshop file, the depth is 8 bits, therefore supported by SFML, but nothing is visible, the screen remains black as if I hadn't used the draw method. I've added more sets and even put them within the loop in the hope that it would change anything, but so far nothing has happened.
As there have been some changes between how you do things in 1.6 and 2.0rc, the 1.6 tutorial hasn't been much help in other than giving the base structure for the code and there aren't any graphics tutorials yet for 2.0rc, I've read the documentation over and over only to see if it was that I was omitting something, but haven't found anything noticeable so far.
I have drawn and made shapes visible, but this is my first time trying with a sprite and an external file. I use Code::Blocks. The image loads correctly, getting no compatibility problem message and the return is 0.
I'm not even trying to make the image move or anything for now, just make the image visible in the render window. But having read most of documentation of the classes I am using I still don't know what's wrong.
Thanks in advance for the help I may get.