Jump to content
  • Advertisement
Sign in to follow this  
jmallios

DX8 v DX9: windowed app, tooltips, context menus and other windows

This topic is 3832 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

My windowed app is embedded in a web page using ActiveX, ATL and DirectX. We upgraded to the 11/07 DX SDK a few months back and it runs well except for a performance lag whenever a GDI tooltip or context menu appears or another window is dragged over the DX window. Often, in the case of an overlapping window, a stale backbuffer appears in the DX window to the left and right of the overlapping window...in other words the scene will be animating as usual above and below the obscuring window, but to the right and left it will just display a single, expired, unanimated frame. This occurs on some, but not all, NVIDIA and ATI cards. The one I test on is an NVIDIA Geforce Go 7400 in a Sony VAIO and it repros the bug consistently. The same app built and run with a DX8 implementation does not experience this performance lag. The device is created with the same creation flags and presentation parameters. I was able to reproduce the bug using several samples in the 11/07 SDK, so it does not seem to be specific to my app. It seems to be specific to DX9 and several video cards that supposedly support DX9. Anyone experience something like this? Any solutions out there? Any clues as to what might have changed in DX9 to cause this?

Share this post


Link to post
Share on other sites
Advertisement
I'm taking a total shot in the dark here, but you might consider modifying this line of code in your program:

Direct3DCreate8(D3D_SDK_VERSION);

to whatever the version of your old SDK was (probably somewhwere in the 10s). Also anywhere else that constant appears. I've noticed MS does change some things unexpectadly in new versions that makes legacy code harder to work with.

Share this post


Link to post
Share on other sites
Unfortunately you're going to get performance problems whenever a GDI element (like a tooltip) has to be blended onto a D3D backbuffer. GDI and D3D9 are completely seperate systems, and getting them to work together in this way requires a lot of slow synchronization and reading of data from slow pipelines.

Share this post


Link to post
Share on other sites
I'm aware of the myriad caveats against GDI and DX, but the fact remains that DX8 handled the synchronization better. I'm referring specifically to D3D_SDK_VERSION 220.

I'm trying to figure out the fundamental difference between DX8 and DX9 with respect to GDI. I'm not using WPF, and I always see the problem on certain cards, be they installed on an XP or Vista box, so DWM doesn't resolve it.

For instance, I notice ID3DXFont::DrawText defers to GDI in 8, whereas 9 defers to its D3DX standalone. Was 8 relying on GDI to render, while 9 was made more autonomous?

Is there an application level solution using 9 that forces the type of synchronization 8 had? Please feel free to refer me to other forums or communities. Thanks.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!