For my 2D game :
While playing, I have to load some large texture2D (2000x2500 pixels) and Unload some others.
Of course I want to Load and Unload texture2D without game/draw freeze (or the lesser...) :x
I don't know if it's possible.
I already use a thread to load some texture while drawing the "Loading screen"
//thread Loading
ThreadStart th_loadingScreen = delegate { DisplayLoading(LoadingScreen); };
new Thread(th_loadingScreen).Start();
But I think it's pretty different.
Of course, I tried something :
private void LoadUnload()
{
for (int j = 0; j <= NbrRow; j++)
for (int i = 0; i <= NbrCol; i++)
{
if(somethingTrue)
{
ThreadStart th_LoadInGame = delegate
{
LoadInGame(i, j, TextureStringPathToLoad);
};
new Thread(th_LoadInGame).Start();
}
}
}
But I have a little freeze.
And, I know how to unload the content, but I don't know how to unload a single loaded texture :x