tags:

views:

25

answers:

1

Hi, I think this is an easy question, sorry I am not really familiar with C++. I am using D3DImage in C++.Net project which is using it's SetBackBuffer method, and I am also using DX Surface. I don't know how to convert IDirect3DSurface9 to IntPtr as parameter in SetBackBuffer method. Anyone knows? please help.

A: 

If you are using C++ with the IDirect3DSurface9, the surface is a pointer. For example:

IDirect3DSurface9 * pSurface;
/* ... */
IntPtr backBuffer = IntPtr(pSurface);

I would also suggest using SlimDX as it is a thin .NET layer on top of D3D.

Jeremiah Morrill
Thank you for the answer, I've never tried managed and unmanaged C++ together.. it is really that simple (geez). also about the SlimDX I'll consider using it in this project cause I still don't know about the performance yet. Thank you.
Dave