Hi people,Have experimented with all the TBB website and O'Reilly Intel Threading Building Blocks bookcodebut just wondered if there was anything else to work with out there.
Does anyone know of any good simple game code examples which implement TBB? Not looking for a full blown graphics or physics engine example; just something simple which can be used to further understand the fundamentals of this amazing library in an applied way.
All I wish to do is implement TBB into a game which has one player avoiding three enemies on screen. There will be collision detection and animation as well. Any advice would be appreciated. It is just a simple game made with the WinAPI.
My Seismic Duck game is open source and uses TBB. See my old blogfor links to the game source on Source Forge.
It's not a particulary simple example. The TBB is used for the physics and rendering. For the wavefield physics and rendering, the screen is partitioned into horizontal panels and each panel is updated in parallel.The overall control flow of the game is similar to writing serial code except for the fork-join parts that do the wavefield and reservoir physics. See Parallel.hfor the generictemplate for doing parallel updatesthatthe code uses. It may or may not apply to your situation. Sometimes a tbb::parallel_for works just fine for this sort of thing.
Thanks for the reply; managed to download your game and play it but had no luck in finding the source code to go with it. My lecturer/tutor already suggested that I'd be able to use the tbb::parallel_for for most of what I need. Guess that's what I'll work with to get this done; just wondered if there were any appropriate perhaps even applied examples to have a look at other than the one's on the site and book. Just so happens the game threading example from the book is not included with the download for it.
Did see this example before but kind of overlooked it because I thouhght it was intended solely for DirectX 11; my graphics card only being 10.1 compatible. Have not programmed with DirectX yet so was looking for an example which uses the WinAPI or OpenGL. Still the feedback is appreciated and I will be sure to have a look over this example; thanks.