Original Post
Hello. I am writing a program that lets you view mesh files. I let the user choose a mesh and a texture respectively. However, sometimes I don't want to draw a texture onto a mesh. It seems though that if I load a mesh with a texture, the device remembers that texture and draws it on mesh I load. My code for drawing the mesh looks like,
if (bTextured == true)
{
for (int i = 0; i < mesh_Material.Length; i++)
{
graphicsDevice.Material = mesh_Material;
graphicsDevice.SetTexture(0, mesh_Texture);
mesh_Object.DrawSubset(0);
}
}
else
{
mesh_Object.DrawSubset(0);
}
Even though I am not trying to draw the texture if bTextured == false, the texture is still drawn on top of the mesh. Is there a way that I can free the device texture memory? I have tried setting the mesh_Material and mesh_Texture to null so that C#'s gc would delete it for me but that doesn't work. Any ideas? Thanks in Advance! GOD Bless you Always!!!!!