Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

How do I access a texture in DirectX 9c?

Discussion in 'Scripting' started by CommitteeWind, Jul 3, 2012.

  1. CommitteeWind

    CommitteeWind

    Joined:
    Oct 20, 2010
    Posts:
    38
    I've been researching how to get access to the texture inside a native plugin (http://docs.unity3d.com/Documentation/Manual/NativePluginInterface.html). I've read, and implemented the sample project shown on that page.

    I also found the Texture.GetNativeTextureID method (http://docs.unity3d.com/Documentation/ScriptReference/Texture.GetNativeTextureID.html). However this only works for OpenGL\ES.

    Now that I have a pointer to an IDirect3DDevice9, I'd like to use its GetTexture method (I am not sure this is the right way to do this).

    However, I can't do this without access to the stage (index?). How can I access a texture in DirectX 9c as a plugin for Unity3D?
     
  2. CommitteeWind

    CommitteeWind

    Joined:
    Oct 20, 2010
    Posts:
    38
    Bump -- still no idea how to do this. Any suggestions?
     
  3. CommitteeWind

    CommitteeWind

    Joined:
    Oct 20, 2010
    Posts:
    38
    Bump -- does Unity3D support this? OpenGL won't work for us, so we must use DirectX to access the texture data.