You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers. No questions about C++ programming or topics which are answered in the tutorials!
for(int i = 0; i < filepath.size(); ++i)
{
tex.push_back( driver->getTexture( filepath[i].c_str() ) );
}
Is there any way to make it faster? And I'm not satisfied with better image compression ideas.... I can't modify them. Each image is in JPG format and has ~35 kB.
Loading depends mostly on your harddisc. So ... getting a faster hd would work. But maybe you can load first and display later - would that be a solution?
No, that's not the allocating - it's the loading. I don't know if the loader itself could be improved, but we use the jpeg lib for that so it's nothing we can change anyway without replacing that.
Don't know if it's really the loader to blame. In many cases, it's the driver. Make sure you disable mipmaps and avoid NPOT images. These may be scaled in SW otherwise.
you can thread your program to preload the textures, if you have a menu or something to begin with then it will work well. just load all the image files into memory or an IIMage then get the data back to the main thread and load them in as textures. This will make it so you don't have to load them all in at once rather over time and only from memory. This will leave the main thread running fast while the other thread takes on the slow disk reads. If you don't have a menu this is kind of useless... Then doing only one disk read like wing64 stated would most likely be the best choice.
you can create a texture from the image though can you not? makes it so the texture is loaded in the main thread by doesn't need to read from the hard disk only memory.
Well... multithreading seems to be useless in my case because that video sequence made of those textures must be shown right after the program starts. I could spread that into threads for loading just the first frame, set the video paused and then load the rest of images and create textures with a loading bar...
You could do it single-threaded by loading the first image and displaying it, then load the second image and display it, etc. So there is always an image on the screen and they do form a sort of movie. How fast the movie plays depends on how fast the images load, but at least you are showing something that is moving.
If this is all about movie rendering, you might want to look into the video lib support provided by several people here on the forum. This is usually far more resource preserving and uses less data to load from disk etc.
Most(if not all I played) of the games that show a movie at the start of the game first show some static image for some time (maybe loads the movie at that time?) and then plays the movie.