【发布时间】:2016-09-10 11:11:40
【问题描述】:
我实际上要做的是重写this lesson,将代码放入不同的文件夹并添加Box2D支持。在我创建 EWorld 和 EGame 类之前,一切都很好。现在RenderWindow 什么都不渲染,虽然clear 方法被调用了。
我的代码 lives here 和我不知道我对 RenderWindow 对象做错了什么。
【问题讨论】:
我实际上要做的是重写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
【讨论】: