Original Post
I'm currently making an isometric engine and want to make it so images are dynamically loaded as they become visible and discarded when they arent. My engine uses a single thread at the moment, so if I call createImage(Image source), the method blocks, and the frame rate suffers. Should I use two threads, one for loading (pictures, maps etc) and one for the main drawing loop? Im assuming this means that the createImage(Image source) method will be spread over several frames in its own thread, rather than interfering with the drawing code thread. OR Would it be better to use an inputstream in my main thread, and slowly read the image data in, then use createImage(byte[] imageData, int imageOffset,int imageLength) to create the image when it finishes? I'm thinking this would be better as it gives more control, although it would probably be slower. Just wondering which you experienced midp programmers have found to be better, or if you have come up with a better method for dynamic loading, feel free to share it! Thanks