vanattab / slimdx

Automatically exported from code.google.com/p/slimdx
MIT License
0 stars 0 forks source link

DeviceEx.FromPointer() throws an exception #876

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am trying to wrap a DeviceEx object around an existing native IDirect3D9Ex 
object.
When I do this:
refSlimDXDevice9Ex = 
SlimDX::Direct3D9::DeviceEx::FromPointer((IntPtr)pNative->pD3DDevice);

I get the following exception from inside SlimDX:
A first chance exception of type 'System.InvalidCastException' occurred in 
SlimDX.dll

The regular Device.FromPointer() does work, but it does not give me any way to 
access the DeviceEx functionality (I cannot cast Device to DeviceEx, even 
though I created the Device from an IDirect3D9Ex object).

The same issue does not occur with Direct3DEx.FromPointer().
I do the same there:
refSlimDXDirect3D9Ex = 
SlimDX::Direct3D9::Direct3DEx::FromPointer((IntPtr)pNative->pD3D);

And that works without a problem.

I am using the SlimDX June 2010 SDK.

Original issue reported on code.google.com by Scal...@gmail.com on 19 Jul 2012 at 8:33

GoogleCodeExporter commented 9 years ago
Some more info:
SlimDX DLL version: 4.0.10.43
OS: Windows 7 Ultimate x64
Videocard: nVidia GeForce GTX460 (Driver 301.42 WHQL)
Using .NET 4.0 Client framework

Original comment by Scal...@gmail.com on 19 Jul 2012 at 8:51

GoogleCodeExporter commented 9 years ago
Looks like we don't overload for proper behavior here.

Original comment by Mike.Popoloski on 20 Jul 2012 at 4:30

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2204.

Original comment by Mike.Popoloski on 15 Sep 2012 at 6:09