zoukankan      html  css  js  c++  java
  • SFML从入门到放弃(0) 配置环境

    恩。。开始划水。。学sfml的时候顺便做点笔记什么的。。

    安装

    在linux里面打开终端

    然后输入

    sudo apt-get install libsfml-dev

    好了

    编译

    #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;
    }

    写一个程序测试一下

    编译的时候加入参数-lsfml-graphics -lsfml-window -lsfml-system应该就可以了

    g++ main.cpp -o test -lsfml-graphics -lsfml-window -lsfml-system

    ./test

    成功的话会看到一个绿色的球

    原文 https://www.cnblogs.com/karl07/p/10285680.html

  • 相关阅读:
    Service
    adb server is out of date
    Notification.Builder
    eclipse连接小米2调试程序的问题
    Date类
    this指向冒泡排序二分查找
    Dom事件键盘事件
    Dom事件键盘事件
    12.4Dom事件键盘事件
    事件对象
  • 原文地址:https://www.cnblogs.com/brady-wang/p/15080333.html
Copyright © 2011-2022 走看看