sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
#include <SFML/Graphics.hpp>
using namespace std;
using namespace sf;
int main()
{
RenderWindow window(VideoMode(1080, 900), " ");
RectangleShape* Rectangle = new RectangleShape;
Rectangle->setSize(Vector2f(100,100));
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == Event::Closed)
window.close();
}
if (Keyboard::isKeyPressed(Keyboard::W))
{
delete Rectangle;
}
window.clear();
window.draw(*Rectangle);
window.display();
}
return 0;
}