Original Post
Hey all, I'm trying to port the directshow.net custom allocator example to us vb.net and slimdx.. but I'm not entirely sure how to port one line of code. Notes: - the unmanagedSurfaces array is an array of Int32's - 85C31227-3DE5-4f00-9B3A-F11AC38C18B5 is the GUID for IDirect3DTexture9 - the line confusing me is Dim text As Texture = DirectCast(surf.GetContainer((New Guid("85C31227-3DE5-4f00-9B3A-F11AC38C18B5")), Texture) This line of code seems to be attempting to obtain the reference for a texture associated with the original surface based on the surface itself. It is backwards from creating a texture and referencing one of the texture surfaces. The slimDX version would require "Public Function GetContainer(Of TContainer As ComObject) As TContainer" (member function of the Surface class) but IDirect3DTexture seems to be undefined. Any ideas on how to get this texture? Thanks so much. - Michael Tanczos
surfaces = New Hashtable(unmanagedSurfaces.Length)
textures = New Hashtable(unmanagedSurfaces.Length)
For i As Integer = 0 To lpNumBuffers - 1
Dim surf As Surface = Surface.FromPointer(unmanagedSurfaces(i))
' How do I convert this line to work with slimDX?
Dim text As Texture = DirectCast(surf.GetContainer((New Guid("85C31227-3DE5-4f00-9B3A-F11AC38C18B5")), Texture)
surfaces.Add(unmanagedSurfaces(i), surf)
textures.Add(unmanagedSurfaces(i), text)
Next