Skip to main content
gamedev.net
🔒 Locked

Managing textures...

Started by ItaySagui May 17, 2003 at 4:40 PM 8 replies 650+ views
Original Post
ItaySagui
ItaySagui
Is is possible to load a texture, and then use it in a device other than the one it was attached to? What I''m trying to do, is have all my textures in somekind of texture manager. The problem is, that when I want to support multiple devices, I can use the textures only in the device they were loaded in. Is there a way to overcome this?
billybob
billybob
i doubt it, but try messing with the D3DPOOL_x when you create them
ItaySagui
ItaySagui
Using the CreateTextureFromFileEx I''ve created my textures in POOL_DEFAULT, but to no avail....
It is strange, since I''m using 1 video card for the 2 devices, which means that the video card SHOULD have the texture in it''s memory. Why can''t it use it?
ItaySagui
ItaySagui
I just wanted to see if I could use 2 devices, to give different points of view to the same enviroment....
ctoan
ctoan
Aight, since this is the DirectX forum, might I recommend NOT talking about OpenGL? And BTW, DirectX rulez

Anyway, if you''re looking to give different views of the same environment, just change the view/proj matrices and change the render target (like if you''re making an editor or similar; it even works well with portals!) Well, every device is essentially ''new memory'' so I doubt that you can share between two of them... And the device only MOVES stuff on the video card; the video card has no idea what belongs to what, just what to render

Good luck!

Chris Pergrossi
< ctoan >
My Realm
Chris Pergrossi< ctoan >My Realm
PrincessDaisy
PrincessDaisy
quote:
Original post by ItaySagui
I just wanted to see if I could use 2 devices, to give different points of view to the same enviroment....


If you want to render to different windows, or different viewpoints, i suggest you use swapchains, rather than multiple devices, as DX isnt to keen on you doing that.
Unfortunatly, the Microsoft provided help is a bit crap so have a look here, http://www.fairyengine.com/, under articles and CreateAdditionalSwapChain(...)

There not hard to use, once you get past all the jargon, and that should solve your texture problem too.



________________________

Pretty In Pink
________________________
Pretty In Pink
JuNC
JuNC
A hidden quote in the Dx SDK docs:

quote:

Note All rendering devices created by a given Microsoft® Direct3D® object share the same physical resources. Although your application can create multiple rendering devices from a single Direct3D object, because they share the same hardware, extreme performance penalties will be incurred.



In other words, DONT

Coincoin
Coincoin
Yeah, if you want ot render the same scene from different angles, just use viewports and change your view and projection matrices.

If you want to render in another window, use additional swapchains.

______________________________
Oooh, you found the horadric cube!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.