sf::RenderWindow window(sf::VideoMode(800, 600), "My Window"); sf::CircleShape circle(100.f); circle.setFillColor(sf::Color::Red); window.draw(circle); window.display();
sf::RenderWindow window(sf::VideoMode(800, 600), "My Window"); sf::RectangleShape rectangle(sf::Vector2f(200.f, 100.f)); rectangle.setFillColor(sf::Color::Blue); rectangle.setPosition(300.f, 250.f); window.draw(rectangle); window.display();In this example, we create a window with a size of 800x600 pixels and a title of "My Window". We then create a RectangleShape object with a size of 200x100 pixels and set its fill color to blue. We then set its position to (300, 250) pixels on the window. Finally, we call the window's draw function to draw the rectangle on the window and call display to show the rectangle on the window. Package Library: SFML is an open-source library and can be downloaded from its official website. However, there are also package libraries for various platforms, such as SFML.Net for .NET applications, SFML for Python for Python applications, and many others.