Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Performance sfml窗口事件轮询非常慢_Performance_Events_Sfml_Polling - Fatal编程技术网

Performance sfml窗口事件轮询非常慢

Performance sfml窗口事件轮询非常慢,performance,events,sfml,polling,Performance,Events,Sfml,Polling,(我在Debian Linux上使用GNU GCC编译器的代码块) 我用sfml创建了一个游戏,除非我实现了通常的 while (window->pollEvent(event)){ //optional code } 循环 我用微软的Visual Studio在Windows上试过同样的代码,效果非常好。即使我只执行了一个命令,游戏仍然落后很多 window->pollEvent(event); 即使根本没有任何事件,也只行一次。为什么那行代码要

(我在Debian Linux上使用GNU GCC编译器的代码块)

我用sfml创建了一个游戏,除非我实现了通常的

    while (window->pollEvent(event)){
    //optional code
    }
循环

我用微软的Visual Studio在Windows上试过同样的代码,效果非常好。即使我只执行了一个命令,游戏仍然落后很多

    window->pollEvent(event);
即使根本没有任何事件,也只行一次。为什么那行代码要花这么多时间?(它需要的时间相当于没有它的情况下大约需要10帧)。

尝试使用window.pollEvent(event)而不是window->pollEvent,到目前为止,我从未见过使用pollEvent的这种形式