Hi!
The WindowsMobile.DirectX.Direct3D.VertexBuffer and WindowsMobile.DirectX.Direct3D.Texture objects I use always dispose themselves (and VertexBuffers recreate later) on Device.Reset() call even when I allocate them from the Pool.SystemMemory as opposed to non-Mobile Managed Direct3D behavior where only resources located in the Default Pool are recreated.
The prove is the disassembler result of WindowsMobile.DirectX.Direct3D.VertexBuffer, which is:
private void OnParentLost(object o, EventArgs eventg) { this.Dispose(!this.m_fRecreate); if (this.m_fRecreate) { base.m_device.DeviceReset += new EventHandler(this.OnParentReset); this.m_fResetReady = true; } }
while the one of the non-Mobile VertexBuffer is:
private void OnParentLost(object sender, EventArgs e) { Device device1 = null; device1 = (Device) sender; if (this.m_Pool == Pool.Default) { this.Dispose(); if ((device1 != null) && Device.IsUsingEventHandlers) { device1.DeviceLost += new EventHandler(this.OnParentLost); device1.DeviceReset += new EventHandler(this.OnParentReset); device1.Disposing += new EventHandler(this.OnParentDisposed); } } }
Setting the WindowsMobile.DirectX.Direct3D.Device.IsUsingEventHandlers to false, by the way, still does not help in case of Textures.
Can someone tell me if this behavior is by design
Thanks in advance,
Boris Gingberg.

WindowsMobile.DirectX.Direct3D.VertexBuffer and .Texture are always disposed on DeviceLost event.
ManishDotnet
Yes, this is by design, ALL resources must be disposed when the device is reset. This is a difference between the desktop D3D implementation and the device implementation.
David Wrighton
.NET Compact Framework
Cerberuss
Hi !
First of all, thank you for answering the question.
Secondly,
the D3DMobile Native documentation says
(http://msdn.microsoft.com/library/default.asp url=/library/en-us/wcemultimedia5/html/wce50conlostdevices.asp):
"...All video memory must be released before a device can be reset from a lost state to an operational state. This means that the application should release any swap chains created with IDirect3DMobileDevice::CreateAdditionalSwapChain and any resources placed in the D3DMPOOL_VIDEOMEM memory class. The application need not release resources in the D3DMPOOL_MANAGED or D3DMPOOL_SYSTEMMEM memory classes. Other state data is automatically destroyed by the transition to an operational state..."
so, if it's correct, than there is some contradiction between the Managed and Native implementations of the D3D Mobile :-(... do you think
Anyway, I thought I could suppress the managed implementation's behavior by setting the Device.IsUsingEventHandlers to false, in order to handle the device's reset by myself, but it seems that Textures continue to react to events.
Is there any way to suppress this default event handling for textures
Thank you once more.
Boris.