Thanks for the fast reply. Unfortunately my mistake with the event loop was not the cause of the displaying problems.
This code:
window.clear();
window.draw(sprite);
window.draw(circle);
window.draw(rect);
window.display();
produces this output:
and this code:
window.clear();
window.draw(circle);
window.draw(rect);
window.draw(sprite);
window.display();
produces this output, although I expected to see a picture.
This is my whole code:
#include <iostream>
#include <SFML/Graphics.hpp>
using namespace std;
int main() {
sf::RenderWindow window;
sf::Event myEvent;
sf::Texture texture;
sf::Sprite sprite;
sf::CircleShape circle;
sf::RectangleShape rect;
//=========================>
if (!texture.loadFromFile("gothic.bmp"))
return -1;
sprite.setPosition(0, 0);
sprite.setTexture(texture);
sprite.setScale(0.5, 0.5);
circle.setPosition(100, 100);
circle.setRadius(10);
circle.setOutlineColor(sf::Color::Red);
rect.setPosition(500, 300);
rect.setSize(sf::Vector2f(20, 20));
window.create(sf::VideoMode(800, 600), "MyWindow");
while (window.isOpen()) {
while(window.pollEvent(myEvent)) {
if (myEvent.type == sf::Event::Closed) {
window.close();
}
}
window.clear();
window.draw(sprite);
window.draw(circle);
window.draw(rect);
window.display();
}
return 0;
}
This is the picture I want to display [it's not for a special purpose].
For your information: I have an AMD graphics card. Maybe thats important to know for you because SFML 1.6 didn't work with it.
[attachment deleted by admin]