我从 sfml 2.1 开始,但我找不到如何使程序流畅运行
我的意思是,程序可以运行,但除非我做某事,比如按下按钮或移动鼠标,否则主循环不会运行,
这是我的主循环代码的示例
window.setFramerateLimit(30); // set max fps to 30
while (window.isOpen())
{
// this code ignores the framerate limit and doesnt runs when an event is found
while (window.pollEvent(event))
{
// this code works fine but it wont run unless the user presses a key or moves the mouse
}
}
有任何想法吗?