Jump to content
  • Advertisement
Sign in to follow this  
GAFO

2D DX9 Multiple Devices for Seperation

Recommended Posts

Hello Community,

I wanted to seperate drawings - different "IDirect3DDevice9Ex"  Devices for different purposes.

The problem I have is that Device A is drawing the background and if I add Device B for drawing simple geometricts or even a simple line.. the background turns black but the line is drawn. So I dont really know how to configure device B that it only overwrite the pixels at e.g. destination of the line and not all pixels of device A.

So what are the correct settings to archive the mentioned goal ?  (D3DPRESENT_PARAMETERS, Present/Clear)

,greetings

Share this post


Link to post
Share on other sites
Advertisement
30 minutes ago, GAFO said:

So what are the correct settings to archive the mentioned goal ? 

If you want these different parts to contribute to drawing the same image, use one device.

Share this post


Link to post
Share on other sites
28 minutes ago, Hodgman said:

If you want these different parts to contribute to drawing the same image, use one device.

so there is absolutely no way that the second device only overwrites the backbuffer parts of e.g. lines location instead of everything ? 

 

Share this post


Link to post
Share on other sites
6 minutes ago, GAFO said:

so there is absolutely no way that the second device only overwrites the backbuffer parts of e.g. lines location instead of everything ? 

 

I don't think you can share the backbuffer (aka swap chain) between devices... You can share other resources, such as intermediate render-targets (https://msdn.microsoft.com/en-us/library/bb219800(VS.85).aspx#Sharing_Resources) so technically it's possible. It's likely slower and more wasteful on memory to create multiple devices when one would do though. It's also a lot more complicated as you'll have to use event queries to force your commands to be executed by the GPU in the intended order, which may harm GPU throughput.

 Why do you need to create multiple devices?

Share this post


Link to post
Share on other sites
4 minutes ago, Hodgman said:

Why do you need to create multiple devices?

well I want design a way which allows me to have a base programm and additional modules which can be loaded for additional rendering 

without them knowing the private environment of the base nor the other way around. So every module manages and renders itself and the only knowledge they share is the window handle.

Share this post


Link to post
Share on other sites
23 minutes ago, GAFO said:

So every module manages and renders itself and the only knowledge they share is the window handle.

Instead of sharing the window handle, share the device pointer instead :) 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!