What is hardware cursor and how does it work?

前端 未结 3 986
醉话见心
醉话见心 2020-12-08 07:47

Is there anyone who can explain how hardware cursor works precisely? How does it relate to the graphics I\'m drawing on the screen? I\'m using OpenGL to draw, how does hardw

3条回答
  •  醉酒成梦
    2020-12-08 08:14

    Hardware cursors have less latency, and thus provide a better experience, because they are not tied to your game or engine frame rate but to the screen refresh rate.

    Software cursors, rendered by you as a screen-space sprite during your render loop, however, must run at the rate of your game engine. Thus, if your game experiences lag or otherwise drops below target fps, the cursor latency will get worse. A minor drop in game fps is usually acceptable, but a minor drop in cursor latency is very noticeable as a "sluggish cursor".

    You can test this easily by rendering a software cursor while leaving the hardware cursor on. (FYI, in Windows API the hw cursor function is ShowCursor). You'll find that the software cursor trails behind the hardware cursor.

提交回复
热议问题