什么是SFML:Simple and Fast Multimedia Library
SFML库由五个模块组成(官网详细介绍戳这里):
System module
Window module
Audio module
Graphcs module
Network module
环境搭建:
1.VS2013对应的SFML的下载地址
https://www.sfml-dev.org/download/sfml/2.4.2/
2.VS20123与SFML配置
https://www.sfml-dev.org/tutorials/2.4/start-vc.php
测试程序:
#include "stdafx.h"
#include <SFML/Graphics.hpp>
int _tmain(int argc, _TCHAR* argv[])
{
sf::RenderWindow window(sf::VideoMode(640, 480), "SFML Application");
sf::CircleShape shape;
shape.setRadius(40.f);
shape.setPosition(200.f, 200.f);
shape.setFillColor(sf::Color::Cyan);
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;
}
开始SFML之旅