   Managed Directx is too slow could the problem be in the settings ... (Corrected)
  hi guys  i am making a car racing game using c# but i am facing a big problem that is it runs very slow on VGA 128MB and CPU speed 2.8 GHz and 1.0 GB Ram the same game with same graphics was created before by another guy using visual C++ and directx 8.0 it is working on the same PC very Good !!!!!!!  so what could be the problem ???  is Managed DirectX slower this much from Unmanaged DirectX or what could be the possible errors i made in my game and what are the things that affect the performance ??? i am simply loading the Stage and the Car .X files  and  drawing them  what more i need to do to maximize the performance ???[Edited by - jad_salloum on December 3, 2005 3:19:24 AM]
  Are you utilizing the same D3D optimization techniques as the "another guy"? Also, in managed code, the message pump has to be handled a little differently than in c++ to be of optimal performance.There could be million different things affecting the performance of your application, so there's no general solution to your problem.   ;  no i am not using the same tecnique  coz i don't know how he made the game coz i have only the executable for it . can u give some Common or important reasons to test if it is the problem  or any recource to check with plzz  and thanks alot for ur help   ;Quote:Original post by Nik02Are you utilizing the same D3D optimization techniques as the "another guy"? Also, in managed code, the message pump has to be handled a little differently than in c++ to be of optimal performance.There could be million different things affecting the performance of your application, so there's no general solution to your problem.Nik,Can you provide some hints or links that refer to handling input in MDX?   ;  Managed DirectX is a fantastic counterpart to the native API and where performance are almost identical. The fact that it's slow gives me a couple of things in mind to look at. 1) What Message loop are you using?2) What Graphics Card do you have?3) What kind of things are you using? (Shaders etc...)?....There are so questions I could ask and a few of them I can help you to look at.1) Tom Millers Render loop is what everyone has been looking at and it's really good and efficient.2) When using a card like the fx5200 and a simple normal mapping shader with specular highlights you could seriously slow down your game to a slow 5 Frames per second. This is not due to bad programming but the lack of speed on the fx5200.It's all really relative to what you are using and looking at.I hope this helps.Take care.   ;  I was referring to Tom's method, to which Armadon provided the link, when I mentioned the message pump. The Application.DoEvents is bad because it allocates extra memory every time it is called, thus taxing the garbage collector (and causing stalling of the loop) - OnIdle doesn't have this disadvantage.   ;  Thanks for the heads up. I was using Application.DoEvents(), but I am just starting on my way through MDX heaven.   ; could be the problem in the settings of the device ?? i noticed that in the SDK's they test the device for alot of details like choosing specific configurations for the adapter while i am using the default adapter and flags HardWareVertexProcessing and   createFlags.PureDevice .   ;  *bump*   ;  The creation of the device and the present parameters that you create the device with are certainly a scenario to investigate. The width and the height of the backbuffer, the type of device you are creating (ie. Software, Reference, Hardware) also the Creation flags you specify (ie. HardwareVertexProcessing, SoftwareVertexProcessing). This all has an effect on the performance of your application and to gain the most out of your specific hardware alot of tests can be done to assure that you are using the opitimal performance of your graphics card like creating a device with HardwareVertexProcessing and specifying DeviceType.Hardware (the Hardware rasterization. Shading is done with software, hardware, or mixed transform and lighting.)I hope this helps.Take care.   