I have the data in one thread, and it´s in a byte array , which i guess is the buffer(in ram). Though that´s in jpeg currently (if i use jpeg).
So i will have to decode it into Texture. And to do that, the easiest way would be to just use, Texture.FromMemory(....).
now you're gettin' with it! <g>.
i've played with dynamic buffers but not textures. i personally haven't needed dynamic textures until that colored world map thing i came up with the other day for the new version of Global War. i use bmp format, as its microsoft's default, and they wrote directx. so bmp is sort of the defacto default uncompressed public format for directx. DDS is directx's internal native format. i use create texture from file.
if you need to use create texture from memory to do the jpg -> dds conversion for you, then you'll want to release and recreate for each new image transmitted. actually a little simpler than than lock and unlock.
again, orders of magnitude faster than your transmission rate, so no performance issues there.
and since you create once, then draw, that is - by definition - a STATIC texture.
so, think you'll have it running by snack time this afternoon? (its 10am here in Washington DC now). <g>
I think you have to much hope in me there;P
The problem is, i don´t know how to Release/Recreate.
Or well, maybe, if that means, Dispose, Initialize.
But the problem is, that´s what i am doing currently, I have to Dispose and Remake a Texture all the time, and i am thinking,
That isn´t a good idea, to remake it.
I simply want to Fill the texture with new data, as that should be faster?
EDIT: Missed your post:
3. lock the texture
4. memcpy your buffer to the texture
5. unlock the texture
Those are what i don´t get how to do.
memcpy, perhaps. But lock and unlock, i just don´t get how to do it:S
EDIT 2:
I am guessing, something like this makes a Texture with Null data.
using (tex = new Texture(device, -2, -2, 1, SharpDX.Direct3D9.Usage.None, SharpDX.Direct3D9.Format.X8R8G8B8, SharpDX.Direct3D9.Pool.Default))
Though, i can´t use -2 (NoPowerof2) with that, i have to write something. And it doesn´t seem to allow many resolutions at all.
Meaning, i can add to it when i want?
Do, i don´t get how to add to it, other than to use
tex = SharpDX.Direct3D9.Texture.FromMemory(device, tempBytes, -2, -2, 1, SharpDX.Direct3D9.Usage.Dynamic, SharpDX.Direct3D9.Format.X8R8G8B8, SharpDX.Direct3D9.Pool.Default, SharpDX.Direct3D9.Filter.None, SharpDX.Direct3D9.Filter.None, 0)
Which i think, remakes it.