Skip to main content
GameDev.net gamedev.net
🔒 Locked

multi-threading problems with DevIL

Started by BloodLust666 Sep 30, 2008 at 11:43 PM 0 replies 950+ views
Original Post
BloodLust666
BloodLust666
I just put in a feature to, when I load models, I create a separate thread to load the file, read in all the data, and load texture data when I come to it in the second thread with DevIL. It works when I have my test program with only one model. It loads right away and has the program running, then my model pops into the screen when it's fully loaded. Only problem is when I have several models being loaded in their own threads. It breaks when I get to ilLoadImage() so I'm guessing there's something in DevIL that could preventing me from loading 2 different images on different threads at the same time. Anyone else having this problem? Any idea for a fix? I was thinking of having a completely separate thread that coninuously loads textures from a queue; whenever model data needs to load a texture, it will add it to the queue to be loaded. That way, only one thread touches the DevIL stuff. Good? Bad? other ideas?
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.