【问题标题】:sf::RenderWindow renders nothingsf::RenderWindow 什么都不渲染
【发布时间】:2016-09-10 11:11:40
【问题描述】:

我实际上要做的是重写this lesson,将代码放入不同的文件夹并添加Box2D支持。在我创建 EWorldEGame 类之前,一切都很好。现在RenderWindow 什么都不渲染,虽然clear 方法被调用了。

我的代码 lives here 和我不知道我对 RenderWindow 对象做错了什么。

【问题讨论】:

    标签: c++11 sfml


    【解决方案1】:

    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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-24
      • 1970-01-01
      • 1970-01-01
      • 2016-04-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多