   Vsync (PresentationInterval One) not working in fullscreen
  Well like it says in the topic I have a D3D9 application.Now as I use a time variable that has to be incremented at the same speed on faster/slower systems I want to use the 60fps maximum of the vsync.So I set the PresentationInterval to One, which works in windowed mode but in fullscreen it doesn't. Why is that?And does this even limit the time variable which I increment in my Draw Method ?If not how can I do that ?   
Quote:Original post by lipsrymeNow as I use a time variable that has to be incremented at the same speed on faster/slower systems I want to use the 60fps maximum of the vsync.That's not a reason why to use vsync. If you want some variable to be updated at the same speed regardless the power of the current PC, you cannot just variable++ it every frame, you must use some timer and tie the value to real time.You'll get the best precision with QueryPerformaceCounter.Please note that your solution with vsync is not even right because vsync on 60 Hz WON'T guarantee you 60 FPS! If the PC is not able to render 60 frames per second, your FPS will drop to 30 FPS (nothing in between!) and your time variable will be screwed.Quote:Original post by lipsrymeSo I set the PresentationInterval to One, which works in windowed mode but in fullscreen it doesn't. Why is that?What do you mean by "doesn't work"? Do you get some error? Or is it running but at different FPS? How do you measure it?Quote:Original post by lipsrymeAnd does this even limit the time variable which I increment in my Draw Method ?If not how can I do that ?See the beginning of my reply.;  I know that it's not the purpose of using vsync but it would work if the frames per second were always 60 or higher, right ?It doesn't work because the fps are much higher than 60 which means there's no vsync going on in fullscreen, while it appears to works in windowed mode.I know that because I've got a frame rate counter in my app.While I tried that with the time value, it still updates faster on more fps.If you could help me why that is ?This is my framerate calculation method that I'm calling right after a draw call.void CEngine::CalculateFramesPerSecond(){static double framesPerSecond = 0.0;static double lastTime = 0.0;// Time of the last Framestatic double frameTime = 0.0f;// Time of the current Framestatic WCHAR strFps[10] = {0};// string for FPS// get current time in secondsdouble currentTime = timeGetTime() * 0.001;static double frameInterval = currentTime - frameTime;frameTime = currentTime;++framesPerSecond;// Increase FPS counter// HLSL xTime Value// gets updated every 0.5 milliseconds// to synchronize on slower/faster machinesif(currentTime - lastTime > 0.0005){m_pCGraphics->IncrementTimeValue(0.0005f);}// if 1 second has passed...if(currentTime - lastTime > 1.0){lastTime = currentTime;wsprintf(strFps, L"FPS: %d", (int)framesPerSecond);m_pCGraphics->SetFpsValue(strFps);framesPerSecond = 0;}}UPDATE: Alright got the vsync issue working now.It seems like the vmware fusion graphics device doen't like the fullscreen vsync.But works in native windows environment.Still there's the problem with the time variable.UPDATE2: Ok, I've solved the time update now,too.[Edited by - lipsryme on April 18, 2010 11:21:05 AM];  You are not computing FPS correctly. You can get the immediate FPS value as the reciprocal value of frame time (= time between two frames).Something like this:static double prevFrame = 0.0;double currentFrame = timeGetTime() * 0.001;double timeBetweenFrames = currentFrame - prevFrame;prevFrame = currentFrame;double fps = 1.0 / timeBetweenFrames;I don't know what's the IncrementTimeValue method for, but you probably should pass the timeBetweenFrames there and not a constant value.Btw, don't forget that this:static double frameInterval = currentTime - frameTime;will be computed only once, not every frame.   