Can anyone ease my head and tell me when executing the code below why the 'Alpha' never (or only occasionaly) make it to 1.00000000?
If I change the screen refresh to 60 (instead of the current refresh rate) the 'Alpha' makes it to 1.00000000
If I change 'Flip 1' to 'Flip 0', again 'Alpha' makes it to 1.00000000
I am a little tierd, and cant seem to figure it out!
Many thanks,
Strict Type TMyType Field Alpha:Float Field StartTime:Float Field ElapsedTime:Float Method ResetAlpha() Alpha = 0 End Method Method ResetTimers() StartTime = MilliSecs() ElapsedTime = 0 End Method Method CalculateElapsedTime() ElapsedTime = MilliSecs()-StartTime End Method Method Fade(FadeTimer:Int = 5000) ResetTimers() While ElapsedTime <= FadeTimer Alpha = ElapsedTime/FadeTimer Draw() CalculateElapsedTime() Wend DrawText "Done. Final Alpha: "+ Alpha , 0, 0 Flip End Method Method Draw() SetBlend ALPHABLEND SetAlpha Alpha SetColor 255, 255, 255 DrawText Alpha, 0, 0 DrawText "Working", 0, 10 Flip 1; Cls End Method End Type Local iRefreshRate:Int = GetDeviceCaps(GetDC(PrimaryDevice.hwnd), VREFRESH) SetGraphicsDriver GLMax2DDriver() Graphics 800, 600, 32, iRefreshRate ' And the code.. Local myScreen:TMyType = New TMyType myScreen.Fade() WaitKey
If I change the screen refresh to 60 (instead of the current refresh rate) the 'Alpha' makes it to 1.00000000
If I change 'Flip 1' to 'Flip 0', again 'Alpha' makes it to 1.00000000
I am a little tierd, and cant seem to figure it out!
Many thanks,