Windows cpp目标在较高分辨率时会变慢 [英] Windows cpp target slows down in higher resolutions

查看:97
本文介绍了Windows cpp目标在较高分辨率时会变慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用以下设置构建Windows(cpp)目标时,我的haxeflixel游戏遇到一些意外的性能问题

I'm having some unexpected performance issues with my haxeflixel game when building a windows (cpp) target with the following settings

    <window if="cpp" width="480" height="270" fps="60" background="#000000"
        hardware="false" vsync="true" />

我注意到,当我将窗口调整为更大的分辨率或全屏显示1920x1080p时,游戏变得越来越慢和滞后.但是,根据flixel调试控制台,所有分辨率的帧频都相同.

I notice that when I'm re-sizing the window to bigger resolutions, or going full-screen up to 1920x1080p, the game becomes slower and lagging. However according to the flixel debug console, the frame rate is the same for all the resolutions.

更有意思的是,我的Flash导出运行起来更加流畅,而我希望cpp目标运行得更快.

Something even more interesting is that my flash export runs much more fluid, while I expected the cpp target to run faster.

这是一款2D平台游戏,包含约6个图块图(最大的图块图为1600x1440)和32x32或16x16的精灵.我没想到在任何现代系统上都会出现性能问题.因此,我担心自己做错了什么,例如缺少明显的设置.

It's a 2d platform game with about 6 tilemaps (The biggest tilemap is 1600x1440) and 32x32 or 16x16 sprites. I did not expect to have performance issues on any modern system. So I'm concerned that I'm doing something wrong like missing an obvious setting.

这正常吗?我应该检查一些关键的渲染性能因素吗?如果您认为这有帮助,请随意询问我任何细节.

Is this normal? Are there any key rendering performance factors I should check? Please fell free to ask me for any details if you think this would help.

使用Haxeflixel 3.3.12

using Haxeflixel 3.3.12

推荐答案

我一直在用不同的配置测试我的应用程序设置,当我最终发现关闭vsync选项将产生最大的影响时.会有一些垂直抖动,但是游戏最终运行得很快,并且Windows目标要比Flash快.

I've been testing my app settings with different configurations, when I've finally found out that turning off the vsync option would make the biggest impact. There is some vertical jittering, but the game runs fast finally, and windows target is faster than flash.

事实证明,我当前的笔记本电脑具有IntelHD GPU,并且vsync功能似乎已损坏.我记得我以前的PC配备了低端AMD GPU时没有这个问题.

Turns out that my current laptop has an IntelHD GPU, and the vsync feature seems to be broken. I remember that my previous PC, equipped with a low end AMD GPU didn't have this issue.

我将考虑添加一个游戏内选项来切换vsync,以便非英特尔用户可以从vsync中受益.

I will consider adding an in-game option to switch vsync, so that non-intel users could benefit from vsync.

其他似乎有所帮助的事情是:

Other things that seem to have helped are:

  1. 按照@Jon O的建议关闭antialiasing
  2. 打开hardware
  1. Switching off antialiasing as @Jon O suggested
  2. Turning hardware on

作为参考,我当前的设置是

For reference, my current setting is

<window if="cpp" width="960" height="540" fps="60" background="#000000" hardware="true" vsync="false" antialiasing="0" />

这篇关于Windows cpp目标在较高分辨率时会变慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆