-1

这可能是一个非常愚蠢的问题,但我找不到任何相关信息,也找不到要搜索的内容。

你如何实时制作东西?例如,假设我们有一个游戏,它如何在不调用程序不同部分的 tick() 方法的情况下连续运行?

4

1 回答 1

1

If you are developing the program to run at a time in particular the best way I know of is to develop it to run at a particular loop rate using timed delays.

IE:

while(forever) {
    do something
    test how long it took
    take up the remainder amount of time for the loop to run at a rate (ie 100Hz)
}

If you are desperate for real time applications you can develop and use QNX:

http://www.qnx.com/

But this certainly wouldn't be a good environment for programming games.

于 2012-08-01T05:38:26.100 回答