| Введение | |
| Скачивание библиотеки SFML2 | |
| Создание проекта в Visual Studio | |
| C/C++ General - include | |
| Linker General - lib | |
| Linker Input | |
| SFML2.dll | |
| Видео |
Скачать SFML2 можно на сайте sfml-dev.org
Затем архив нужно распаковать, например, создав директорию
C:\Development\SFML2
После этого в Visual Studio создайте пустой C++ проект. Консольное приложение для win32, например. И в этом проекте создайте файл main.cpp
В
C/C++ → General → Additional Include Directories
Нужно добавить путь до директории include
C:\Development\SFML2\include
В
Linker → General → Additional Library Directories
Нужно добавить путь до директории lib
C:\Development\SFML2\lib
В
Linker → Input → Additional Dependencies
Нужно добавить следующие библиотеки
sfml-audio-d.lib sfml-graphics-d.lib sfml-network-d.lib sfml-system-d.lib sfml-window-d.lib
#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;
}
| I recommend our hosting beget.ru |
| Write to info@urn.su, info@aredel.com if you: |
| 1. Want to write an article for our site or translate an article into your native language. |
| 2. Want to place thematically relevant ads on the site. |
| 3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail |
| 4. Found a mistake, inaccuracy, bug, etc. on the site. ... ....... |
|
5. Articles can be shared on social media by clicking a network icon:
|