sf::RenderWindow 不呈现任何内容
sf::RenderWindow renders nothing
我基本上想做的是重写 this lesson,将代码放入不同的文件夹并添加 Box2D 支持。在我创建 EWorld
和 EGame
类 之前一切都很好。现在 RenderWindow
不呈现任何内容,尽管调用了 clear
方法。
我的代码 lives here,我不知道我对 RenderWindow
对象做错了什么。
clear
清空屏幕不显示任何内容。
要在每一帧上正确呈现内容,您需要遵循以下模式:
window.clear(); // clear drawn objects from previous frame
// window.draw(...); all the things for this frame
window.display(); // actually show drawn frame on screen
我基本上想做的是重写 this lesson,将代码放入不同的文件夹并添加 Box2D 支持。在我创建 EWorld
和 EGame
类 之前一切都很好。现在 RenderWindow
不呈现任何内容,尽管调用了 clear
方法。
我的代码 lives here,我不知道我对 RenderWindow
对象做错了什么。
clear
清空屏幕不显示任何内容。
要在每一帧上正确呈现内容,您需要遵循以下模式:
window.clear(); // clear drawn objects from previous frame
// window.draw(...); all the things for this frame
window.display(); // actually show drawn frame on screen