I want to make my window when I click a button, slide off screen. I can easily do this by going x - 1 until its off screen, but what I want, is to make it like faster to slower motion moving in a left or right direction.

I think this can be done with the power function, Ive tried but its just going straight at a constant speed everytime.

Code:
                        //Function begin
bool hideWindow(int iWindow, double interval, int direction){
                        static double res = 0.99;

			static double iTime = timeGetTime() + interval;
			int iPresent = timeGetTime();
			
			if (iPresent > iTime) // timer went off
			{
				res = pow(res, res);
				iTime = double(timeGetTime()) +  res * interval; // reset the timer and make the new timer less time to make it faster
				window[iWindow].x += direction; // move left or right by x pixels
			}
                        if (window[iWindow].x > SCREEN_WIDTH) // process complete
                             return true;
                        return false; // process incomplete and the function will be recalled from main
}


This looks right to me,Its being called each frame, and my window is moving in the right direction until its off screen but i Need to change the speed.

Thanks if you have any ideas/modifications to what I have.