Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Trajar

Using DDraw and D3D Together

This topic is 6928 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have searched the archives for threads on using DDraw and D3D. I found that a LOT of people ask this same question, and everyone has a different answer. I, too, looked at Microsoft''s documentation, and in DX7, found that they are based on the same type of surfaces. I know that to use DDraw you have to wait until the D3D device is done rendering, and you HAVE to call it outside the rendering scene code for D3D. This much I have experimented withBut does this slow it down that much, or at all? I''m using D3D to draw a tile engine, akin to the article on GameDev a while back, so I don''t want to draw EVERYTHING with D3D, because I want to have dynamic lighting for about 50-100 64x32 tiles, which should render pretty quick. I have posted this before, without a good response. Does anyone have a DIFINITIVE answer to this question? If so, I''d LOVE to hear it. Thanks in advance Trajar Ok, I have posted

Share this post


Link to post
Share on other sites
Advertisement
It _can_ slow down your engine it all depends on how you allocate your resources. But for a tile engine I wouldn't worry to much about it as it probably doesn't require too much rendering time.

If you are really paranoid about your idle processor time, make sure that you put some other code in between rendering the 3D part and the 2D part. You could for example check the user inputs or do some AI stuff.

You can easily measure the slowdown, by getting the time just after you have called EndScene() and then again just after the first DirectDraw operation that must wait for Direct3D to finish first. Don't forget to subtract the time it takes to perform the DirectDraw operation as well.

Direct3D has to wait for DirectDraw to finish as well, so you may have some idle time before BeginScene() as well. Another place where you may have idle time is just before UpdateScene() or whatever the function is called to show the backbuffer, traditionally this is solved with triple buffering but that costs a lot of videomemory so I wouldn't recommend it.

- WitchLord



Edited by - WitchLord on 5/2/00 12:33:17 PM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!