Should I use multiple threads within my OpenGL ES game?

后端 未结 2 1643
滥情空心
滥情空心 2021-01-13 18:15

I am developing an iPhone game which contains one player and many enemies. I use OpenGL ES to display the game visuals.

I am a little confused as to whether I shoul

2条回答
  •  忘掉有多难
    2021-01-13 19:02

    It really depends on lots of things. First of all you won't get any performance boost if you're using several threads (since all modern iOS-devices has single core processors, though iPad2 has 2). Second several threads make any application much more sophisticated, since you have to keep track of shared resources, synchronize threads and lots more.

    Use several threads only if you really need this. For example you're loading lots of textures into memory from file and it might take several seconds. If you do this on the same thread, where there rendering is performed, then all rendering would hang for that time. So it's better to do that on a separate thread and then give loaded data to the main one. Or you might update physics on a separate thread with higher update rate (however you benefit from this only on several cores).

    If you're a novice developer and making some simple game don't use multiple threads. This stuff requires lot of experience.

提交回复
热议问题