windowsmobile directx unloading mesh problem

Started by
-1 comments, last by outsider84 16 years, 5 months ago
In my newly created 3D terrain engine i have a problem of being out of memory in C# managed environment for windows mobile 5.0 os. The engine is supposed to load and unload tiles as camera moves around in the area. the problem is after a little bit of tripping around, i got either of invaliddrivercallException while trying to loadtexture from file or outofmemory exception while trying to load a new mesh. I have written a GraphicsMesh class to wrap directx.mesh, i am trying to unload and load mesh via methods of this wrapper class. The thing is i always unload meshes that are out of sight before loading new ones. But memory pool goes down and down(checked with device.GetAvailablePoolMem(Pool.SystemMemory)). I can supply code, but here is the very simplified version of what i am doing. while unloading a mesh. this.mesh.dispose(); this.mesh = null; this.texture = null; while loading the following are called: TextureLoader.FromFile(device, texturefilename); mesh = MeshLoader.LoadMesh(device, dataStream, MeshFlags.SystemMemory, out meshMaterials, out textureFilenames); i kind of simplified it. thanks for any information in advance. ps: i am total newbie opening a new thread in a forum. I am not sure i have given enough information and positive feed-back would be great.

This topic is closed to new replies.

Advertisement