织梦CMS - 轻松建站从此开始!

abg欧博官网|登陆|游戏|

当前位置: abg欧博官网|登陆|游戏| > abg欧博 > 文章页

Ogre Forums

时间:2024-09-30 01:39来源: 作者:admin 点击: 49 次
Thanks! Yous guys have answered all my questions thus far! However, new ones have come up: 1. My understanding of how SDL renders frames is that, w

Thanks! Yous guys have answered all my questions thus far! However, new ones have come up:

1. My understanding of how SDL renders frames is that, when you call SDL_flip (which flips the 2 video buffers), it will NOT flip the buffers unless the graphics card is ready to, thus letting the graphics card to display the game at a variable framerate without affecting the speed of the game loop. Whether my understanding is correct or not, does OGRE's renderOneFrame method do this, or does it render one frame unconditionally, thus making the famerate exactly 1 frame per game loop iteration always?

2. My current game loop, which is given above and which is based on the game loop I used 6 months ago to make some SDL-based games, runs up to a specified speed, and renders (up to) one frame per loop iteration. If the frames will be rendered conditionally--that is, if the graphics card is 100% done rendering the previous frame--then my current game loop will give a variable frame rate and a consistent game speed--the two are decoupled.

HOWEVER, from discussions I have read on this and other forums, everyone seems to be using a different technique: They run the the game loop itself at a variable rate, but calculate everything (physics, AI, game logic) based on how long that respective iteration takes to compute, rendering included. This is not too difficult to write with the help of a physics engine since all the physics engines support variable step times.

Among these two styles of game loop, which is preferable--which gives better speed and consistency (accuracy)?

(责任编辑:)
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:
发布者资料
查看详细资料 发送留言 加为好友 用户等级: 注册时间:2025-05-18 08:05 最后登录:2025-05-18 08:05
栏目列表
推荐内容