C# - Changing the Texture's device

I doubt that you can change the device. I'm just guessing here, but I would think that once you create the texture, it is tied to a physical device (represented by the device class) which cannot be changed, and which is why the device must be passed to the constructor.
 
Machaira said:
Why do you need to change the device?

So that I can use the same texture into several DXDevices instead of loading the same picture n times for n devices and wasting precious resources with repetive objects...

Alternatively, is it possible to extract ONLY the picture loaded into a texture and pass it to another texture?
 
Last edited:
Device 1: Controls the map graphics
Device 2: Shows the seletected picture to add in the map
Device 3: Desplays all the available graphics to choose from

Devices.jpg


Too make all working as shown on the screenshot I'm loading the graphics 3 times! If I could just change the device associated to the texture I would only need to load them once...
 
Last edited:
Machaira said:
You might be able to get away with not using DirectX for what you're showing with the 2nd and 3rd devices.

Well, both 2nd and 3rd devices were implanted with DX because the old way I had (which was not using DX at all) had some problems with transparent pictures. There transparent pixels become full of artifacts like in this pic:

GraghicsV2.jpg


See the strange numbers on the available graphical buttons? Those numbers appear precisely on the transparent pixels of each tile (don't ask me why), yet, most of those tiles are displaying 100% unaccurate images... They are a total mess. What they should display is precisely what is displayed in my previous post... So, I was forced to use DX in order to kill this stupid issue...
 
A texture cannot be moved like that from device to device. If you want to "copy" a texture to another device you'll have to copy the bits to a system memory chunk and then copy that to the other texture. This also means that if you load the same texture in those 3 devices you will have 3 copies of that texture in video memory.

Multiple devices are bad. You would be better off creating multiple swap chains (essentially multiple unrelated backbuffers) and just using one device.
 
Back
Top