Introduction | |
Скачивание библиотеки SFML2 | |
Создание проекта в Visual Studio | |
C/C++ General - include | |
Linker General - lib | |
Linker Input | |
SFML2.dll | |
Видео |
Скачать SFML2 можно на сайте sfml-dev.org
После этого в Visual Studio создайте пустой C++ проект. Консольное приложение для win32, например. И в этом проекте создайте файл main.cpp
#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;
}
Share in social media:
|