Sign in to follow this  

Threading

This topic is 3593 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I use HGE graphics engine for one of my projects and it's only single threaded unfortunately (VC++) so everytime I load a graphic from disk the animation stops dead. This is very irritating in a graphics engine where I want to be constantly loading up a buffer in the background for the next animation. I run HGE as a thread under the Win API (child window etc) so I'm wondering if anybody has experience with handing the file loading over the Win API (m/t) then doing a fast buffer swap into the graphics engine? So far I can't get this working because HGE load function expects to write a file in from disk, not out of a memory buffer. Anybody out there experienced with this sort of thing? m0ng00se

Share this post


Link to post
Share on other sites
Your options really depend on exactly how the loading function works, if it takes some sort of file class/structure you might be able to manipulate that into loading the data from memory. If it takes a file name string as the argument, you're probably going to have to write your own loading function that creates something usable with the engine.

The simplest option though might be to use Boost.Threads Which is independent of the Windows API and allows you to work with multiple threads within the engine itself.

Share this post


Link to post
Share on other sites
Um thanx Puck.

Did you say "simplest"? I'm still reading that link you gave me for about the fifth time trying to get my head around all of it. Sheesh it's more complicated than my entire program.

But yea I think you're right and it probably is what I need if I can only work out how to implement it properly in my code.

In fact it looks perfect. Thanx.

m0ng00se

Share this post


Link to post
Share on other sites

This topic is 3593 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this