Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have built a slideshow in slimDX and is scrolling a text at the bottom of the images. But I am running through a problem that when my new image is loaded in by the help of Texture.FromFile() function and i am giving the new image to the texture it is giving a little pause that is due to the loading of the image and moving text seems to jerky as it waits for some milli seconds when the new image is loaded. I am trying to resolve this problem by the help of a thread and also threadPool but is not getting the right output. Can any body please help me out in this context.

share|improve this question
    
You're going to have to provide some more information -- what exactly are you trying to do (i.e., code) and what exactly the incorrect output is. You probably don't want to be using the DX ThreadPool class, C#'s BackgroundWorker or Tasks library is easier to work with. –  Josh Petrie Jul 21 '11 at 14:34

1 Answer 1

up vote 3 down vote accepted

Could you open all of the images before you start the slide show? Store them in an array of textures and then just loop through?

If not, then I would suggest using the c# threading classes Josh Petrie suggested, or using the Thread class itself, which can be easier to use than it looks.

If you are new to threading I would suggest avoiding it unless you are prepared to read up on a lot of nuances and problems unique to threading. It is certainly incredibly useful and powerful but you can end up causing a lot of problems if you're inexperienced.

share|improve this answer
1  
You should probably mention that the logic when using threading would be to have two textures, while one is displayed, the other one is loaded in a worker thread. When you change images just swap them around. –  Jonathan Connell Aug 1 '11 at 15:28
1  
Yes, good point. If I had the reputation I'd upvote your comment. Shame rep doesn't carry across stackexchange sites (I'm new to gamedev but more established in traditional stack overflow) –  Nick Udell Aug 1 '11 at 15:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.