#include <SFML/Graphics.hpp>
using namespace sf;
int main()
{
// create the window
RenderWindow window(VideoMode(800, 600), "My window");
// run the program as long as the window is open
while (window.isOpen())
{
// check all the window's events that were triggered since the last iteration of the loop
Event event;
while (window.pollEvent(event))
{
// "close requested" event: we close the window
if (event.type == Event::Closed)
window.close();
}
// clear the window with black color
window.clear(Color::Black);
// draw everything here...
// window.draw(...);
RectangleShape rect (Vector2f(100.f, 100.f));
rect.setFillColor(Color(100, 50, 200));
rect.setPosition(50.f, 50.f);
window.draw(rect);
// end the current frame
window.display();
}
return 0;
}