[SlimDX] Exception despite AlwaysIgnore (Out of Memory)

Started by
1 comment, last by Tubos 14 years ago
Hi, I'm using D3D9 and SlimDX (August 09). I'd like to handle out-of-memory without using exceptions. Init code:

Configuration.EnableObjectTracking = true;
Configuration.ThrowOnError = false;
Configuration.AddResultWatch(ResultCode.OutOfVideoMemory, ResultWatchFlags.AlwaysIgnore);
However, when I allocate too much GPU memory, SlimDX still throws:
Quote:SlimDX.Direct3D9.Direct3D9Exception {"E_OUTOFMEMORY: Ran out of memory (-2147024882)"}
I have verified that at the moment of the allocation, Configuration.m_Watches[ResultCode.OutOfVideoMemory] is set to AlwaysIgnore and ThrowOnError==false. How can I disable this exception?
Advertisement
If this is inside a constructor, you'll have to resort to catching the exception, since we force them to always throw so that you don't get partially initialized objects.
Mike Popoloski | Journal | SlimDX
Thanks Mike!

This topic is closed to new replies.

Advertisement