Код: Выделить всё
#include
int main()
{
float widthWindow = 1200;
float heightWindow = 800;
sf::RenderWindow window(sf::VideoMode(sf::Vector2u(widthWindow, heightWindow)), "Power off!");
sf::Font font("Inter-Regular.otf");
sf::Text text(font, "Click me", 24);
while (window.isOpen())
{
while (const std::optional event = window.pollEvent())
{
if (event->is())
window.close();
if (event->is())
{
sf::Vector2u size = window.getSize();
window.setView(sf::View(sf::FloatRect({0, 0}, {size.x, size.y})));
}
}
window.clear(sf::Color(0x4F6A6E));
window.display();
}
}
Подробнее здесь: https://stackoverflow.com/questions/795 ... sfml-3-0-c
Мобильная версия