如何在Arch Linux上编写SFML代码 [英] How to write SFML code on Arch Linux

查看:105
本文介绍了如何在Arch Linux上编写SFML代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!

我想在我的计算机上编写SFML代码,但它是使用arch linux。我安装了SFML。那么现在我可以使用什么编辑器导致VIM为基本的Hello world代码提供错误。



Hello!
I want to write code on SFML on my computer, but it is with arch linux. I installed SFML. So now what editor could I use cause VIM gives an error for a basic "Hello world" code.

#include <SFML/Graphics.hpp>
 
int main()
{
    sf::RenderWindow Window(sf::VideoMode(800, 600, 32), "SFML Sample Application");
 
    while (Window.isOpened())
    {
        sf::Event Event;
        while (Window.pollEvent(Event))
        {
            switch (Event.type)
            {
            case sf::Event::Closed:
                Window.close();
                break;
            default:
                break;
            }
        }
 
        Window.clear(sf::Color(0, 255, 255));
        Window.display();
    }
 
    return 0;
}





错误:



ERROR:

testsfml.cpp: In function 'int main()':
testsfml.cpp:7:27: error: 'class sf::RenderWindow' has no member named 'isOpened'
             while (Window.isOpened())
                           ^

推荐答案

要调用的函数名称不是 IsOpened IsOpen
The function's name that you want to call is not IsOpened but IsOpen.


这篇关于如何在Arch Linux上编写SFML代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆