   DirectX on Windows Vista & A good timer
  Hello.1) I have a problem with DirectX on Vista.I have a program made in DirectX 9 on Windows XP (Visual C++) and when I run it on Vista I don't see the same things (the light source is not the same,etc...but the objects are in the same place)2) Please tell me a good timer for my dx app.I use GetTickCount() but I have the CPU 100% use all time.Thanks   
Quote:Original post by johnny_alexandru20071) I have a problem with DirectX on Vista.I have a program made in DirectX 9 on Windows XP (Visual C++) and when I run it on Vista I don't see the same things (the light source is not the same,etc...but the objects are in the same place)What debugging have you done? Whilst you'd assume identical hardware performs the same under both XP and Vista there isn't strictly a guarantee as they'll be using different drivers. Are you sure you're not relying on a feature that is unsupported under your current Vista drivers? You'll need to do a lot more investigating and post a lot more info before we can give you serious help.Quote:Original post by johnny_alexandru20072) Please tell me a good timer for my dx app.I use GetTickCount() but I have the CPU 100% use all time.The timer has little to do with CPU usage. If you're throwing your application into a tight processing loop then is it really of any surprise that you're using 100% of the CPU's time?!?!Look into timeGetTime() or QueryPerformanceCounter() if you want better timers. I believe there's also a technical whitepaper in the SDK on this topic.hthJack;  1 - Maybe is a driver problem.I use Nvidia GForce FX5200.2 - When I run my application with Task Manager the CPU is at 100% usage and the computer runs slow.I use this code in the Message Loop:DWORD starting_point = GetTickCount();// check PeekMessage(), render a frame, etc.while ((GetTickCount() - starting_point) < 25);;Quote:Original post by johnny_alexandru2007while ((GetTickCount() - starting_point) < 25);That's your problem. You're forcing the CPU to use 100% of the CPU there, because it's having to loop over and over.Try this instead to tell the OS that you're not doing anything:if(GetTickCount() < starting_point+25)   Sleep(25-(GetTickCount() - starting_point));Note that GetTickCount() is only accurate to about 10ms though, so even this isn't an ideal solution.   ;  How I use QueryPerfomanceCounter() and Sleep()????Please give me some code   ;Sleep, QueryPerformanceCounter. Please, do some of the work yourself next time.   ;I done some work because and I had this but is not working and I'm not very sore about the ".LowPart" thing (LowPart - DWORD...and I need a DWORD for Sleep())// 30 FPSQueryPerformanceCounter(&render_starting_point);Render();QueryPerformanceCounter(&render_finish_point);if(render_finish_point.LowPart  < render_starting_point.LowPart + 30)   Sleep(30 - (render_finish_point.LowPart - render_starting_point.LowPart));How can I see what FPS has my program?Thanks...;  I found something on internet:QueryPerformanceCounter(&render_starting_point);QueryPerformanceFrequency(&render_frequency);render_microsecunds_start = render_frequency.QuadPart / render_starting_point.QuadPart * 1000000;Render();QueryPerformanceCounter(&render_finish_point);render_microsecunds_finish = render_frequency.QuadPart / render_finish_point.QuadPart * 1000000;if(render_microsecunds_finish - render_microsecunds_start < 30)Sleep(30 - (render_microsecunds_finish - render_microsecunds_start));It seems like it works..but how can I see the FPS of my program?   ;  To be honest, your code is very very broken. I'd spend some more time trying to find an example - a few seconds on live.com found The CPerfTimer timer class example. Even if that code doesn't work exactly out of the box the description suggests that it's a good example for you to base your code own off.Quote:how can I see the FPS of my program?This is a complete seperate issue - you'll have to either write it to some sort of debug log or render it to the screen. But if your code works then you already know what it's going to say [wink]Jack   