Skip to main content
GameDev.net gamedev.net
🔒 Locked

question about textures

Started by mike25025 Jul 2, 2004 at 4:26 PM 5 replies 550+ views
Original Post
mike25025
mike25025
im useing dx9 i want to know if a texture that is loaded by one device can be used in another thanks if no one knows can someone tell me where to look dx docs have nothing on this [Edited by - mike25025 on July 2, 2004 5:03:24 PM]
Supernat02
Supernat02
It can only be associated with one device when you create it, so no you can't use it with another device.

Chris
Chris ByersMicrosoft DirectX MVP - 2005
Sr_Guapo
Sr_Guapo
I know that this is an issue when you want to use multiple viewports (ie - a 3D modeler). There are ways around this, I *think* you can create multiple viewports with one device (don't quote me on that...). Otherwise, you will have to load all the textures to each device. The same thing has to be done if you re-create a device after it was lost. Hope that helps...
Sean Henley [C++ Tutor]Rensselaer Polytechnic Institute
mike25025
mike25025
then is i posible to create two windows that display differnt things but use the same device (multitask safe)?
mike25025
mike25025
Quote:
The same thing has to be done if you re-create a device after it was lost.


i never had to do this
Sr_Guapo
Sr_Guapo
Yes, I have never had to do this, so I can't be of much help... I think it involves rendering to a surface, having multiple PRESENT_PARAMETERS, and a few other things... I'm sure someone else in this forum would be a much better help than myself...

PS, the only tutorial I know of for this is for VB6 and DX8, but I'm sure the basic concepts are still the same... The site is:

DirectX4VB.com

Just scroll down to the "Quick Snippets section, there is a section in there dealing with Multiple Viewports...
Sean Henley [C++ Tutor]Rensselaer Polytechnic Institute
Namethatnobodyelsetook
Namethatnobodyelsetook
Quote:
Original post by mike25025
then is i posible to create two windows that display differnt things but use the same device (multitask safe)?


Present allows you to present your backbuffer to any window. If you want a different sized backbuffer for a different sized window, or just want different present parameters you'll want swap chains. Look into CreateAdditionalSwapChain.

When using swapchains some things are a bit odd... you can ask a swapchain what it's backbuffer surface is (for use in SetRenderTarget()), but you can't query it's ZBuffer. As such, in your swapchain's presentparameters it's useless (and a waste of video memory) to use AutoDepthStencil... I'm surprised to see that problem still exists in DX9.

Swapchains and present to different windows are fine for single monitor (or single device multi-mon) situations. If you're hoping to display to a second window on a second monitor, you'll need to create a second device. On the second device you'll need to create it's own versions of textures, vertex buffers, etc.

Topic Locked

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

Sign in to reply to this topic.