Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
9 Views

Simple Game

Jump to solution
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.
0 Kudos

Accepted Solutions
Highlighted
Employee
9 Views
Here's the top-level URL for the source: https://seismic-duck.svn.sourceforge.net/svnroot/seismic-duck/trunk/ . The portions that use TBB are in the Source/ subdirectory there.

View solution in original post

0 Kudos
6 Replies
Highlighted
Employee
9 Views
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.
0 Kudos
Highlighted
Beginner
9 Views
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.
0 Kudos
Highlighted
Employee
10 Views
Here's the top-level URL for the source: https://seismic-duck.svn.sourceforge.net/svnroot/seismic-duck/trunk/ . The portions that use TBB are in the Source/ subdirectory there.

View solution in original post

0 Kudos
Highlighted
Beginner
9 Views
Right enough a little bit more complex than what I was looking for but some nice code to read; thanks.
0 Kudos
Highlighted
New Contributor III
9 Views
You could also have a look at this sample game engine built on top of TBB.
0 Kudos
Highlighted
Beginner
9 Views
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.
0 Kudos