Strange Problem In Resizing Managed Direct3D Window

Hello,

I had a strange problem, I had created a Windows Forms project in Visual Studio 2005. I render to this window using Managed Direct3D. I typically used 3 managed vertex buffers for rendering. When I try to resize the rendering window, The resizing operation was too fast and catching up my mouse pointer inspite of it's speed, This is good. But this happens only in Debug or in Release mode while Visual Studio is open!!. If I closed the Visual Studio and opened the application. The resizing operation will be too slow and really not good.

I removed the vertex buffers and just the rendering routine clear the screen, I mean there no overhead to do. These artifact also happened.

I tried this with the DirectX SDK and it happens there is too, The resizing is so slow if Visual Studio isn't opened.

I tried this in two fast computers also happens there. And I don't know what to do I don't like this resizing performance.

Thanks,

Mustafa ELBanna



Answer this question

Strange Problem In Resizing Managed Direct3D Window

  • Gary B

    Hello,

    First, Thanks for replying. Second, I have june2005 version of the SDK. For the loop setup, Or by another means I do this for rendering: Ovveriding the paint message to render (Static rendering not animation). And as I told before I tried to render an empty blank screen without any resources !! and still do the same.And by slow I really mean slow more one second to move the outer frame from a position to another.

    Thanks,

    Mustafa ELBanna


  • Jdjr2

    A few things to try:

    Make sure you are setting the style of the control to AllPaintingInWmPaint and Opaque.

    Update DirectX SDK to at least the August 2005 release if not the December 2005 release.


  • ploskikl

    For the record, I'm seeing the same problem as well. Native samples are fine, managed samples resize funny. System setup is a Radeon X800 with Catalyst 5.10.
  • Hegbom

    Perhaps this is a bug. How are you rendering What kind of loop setup do you have What release of the DirectX SDK do you have By "slow" what do you mean, slow is a pretty relative term.

    I am running Dx 9.0c with VS2k5 and I have no problems resizing in and out of the IDE. I see some minor flickering but nothing skips. Perhaps you are trying to reset way too many objects, or maybe there is some bottle neck on the Device Reset/Lost event

    Hope this helps,
    John


  • Amr Noureldin

    Hello,

    The C++ samples and tutorials works smoothly as expected independent of how I open it. I tried to use another IDE called SharpDeveloper the version with .net framework 1.1 and remake the project with the Windows Forms 1. I started the application inside SharpDev developer it works very smoothly as expected. I closed SharpDeveloper and open the EXE and the surpise that it does the same effect!!. Ok, it seems that Visual Studio is innocent of all that. I thaught it may be something with JIT compilation ( Altough my self think this isn't true by 99% ). I used NGEN and make the pre-compilation process. The same is done!!

    I'm really don't know what to do to make this ugly effect vanish.

    Thanks,

    Mustafa ELBanna


  • rain_flow

    I believe it has been narrowed to either a driver or os error at this point. At least I can not think of anything else to check. Make sure you have the latest drivers. This truly is a very strange bug/error you are seeing.


  • James Juno

    Hello,

    I'v now the December 2005 version of the SDK and the same happens. I've tried the .net framework 2 examples and I found the same effect happens even there example don't try to draw or even reset the device while in the resizing operation. I open it with Visual Studio 2005 and guess what it work much much faster!!

    I know it's wired but it happens.

    Thanks,

    Mustafa ELBanna


  • Ali Enteshari

    Are you trying to redraw/reset the device while you resize The SDK samples don't do that, they wait till the resize is complete. I imagine that slows things down, but I can't understand how it works in VS2005 but not outside.

    (is this the 1st time anyone has ever heard of Visual Studio speeding things up !!!)



  • Kaiser28

    I think your instinct is right about the JIT compiler - the same JIT compiler would be used within and outside VS2005. If anything there is *more* stuff happening in VS2005, debuggers get loaded. MDAs are inserted into call chains etc.

    Plus the way JIT compilation works, once a particular bit of code is run its in x86 form and isn't compiled again so given the lack of code paths in your simple repro cases most of your code will be fully compiled by the 1st time you try to resize.



  • JackDanielsDrinker

    I had a logn chat with Mustafa on IRC tonight, the effect his seeing is that the window resize (the actual shape of the window) lags at least 1 second behind his mouse pointer. But *only* when he runs the EXE. If he runs the source code from within Visual Studio it works fine. It happens on any code using Managed DirectX. The SDK samples, the SDK tutorials and his own code. It doesn't happen with the native code he has written (Mustapha - can you try running the native SDK samples and let us know)

    I got him to comment lines out in tutorial1 and recompile until it stopped happening. Once he had commented out the device creation the window went back to normal.

    He says it happens on 3 machines, with 2 different graphics cards.

    I got him to check if he is running any background tools that use DirectX on all 3 - he is not.

    I am officially out of ideas - he's asked in gamedev too http://www.gamedev.net/community/forums/topic.asp topic_id=373356 maybe someone else has seen this one.



  • Strange Problem In Resizing Managed Direct3D Window