winapi - Copying data of a IDirect3DSurface to another IDirect3DSurface which are created with two directx devices -


there window own direct3d device, lets call mainwindow. mainwindow , things created other people. have given me direct3d surfaces (idirect3dsurface9 pointers) drawing on mainwindow.
have started thread 1 of callbacks , created own window using winapi. ( had little bit similar case @ this question )
want draw rtt outputs on window. trying copy surfaces surfaces/textures have created in own directx device draws on window.

some stuff found while trying this,

  • this can done using d3dxsavesurfacetofileinmemory(...) , d3dxcreatetexturefromfileinmemory(...) functions.
  • strechrect(...) function doesn't work 2 surfaces created 2 devices.

i tried locking surfaces , copying data 1 another, didn't seem work. try again. ( locking surfaces 2 different devices @ once illegal? )

is there way people know or suggest this?

---edit---
msdn says (link page)

in windows vista createtexture can create texture system memory pointer allowing application more flexibility on use, allocation , deletion of system memory. example, application pass gdi system memory bitmap pointer , direct3d texture interface around it. using system memory pointer createtexture has following restrictions.

  • the pitch of texture must equal width multiplied number of bytes per pixel.
  • only textures single mipmap level supported. levels argument must 1.
  • the pool argument must d3dpool_systemmem.
  • the psharedhandle argument must valid pointer buffer can hold system memory point; *psharedhandle must valid pointer system memory size in bytes of texture width * texture height * bytes per pixel of texture format.

i couldn't find example creating texture in way ,but tried , got output full of noise , nothing else. if can me in that, guess problem solved extent.... there examples msdn says in here..??

if in vista/win7/win8, can use sharing_resources don't need copy it.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -