Movement Slowdown in Fullscreen Mode

Posted By: JackParsons

Movement Slowdown in Fullscreen Mode - 02/19/09 02:51

Greetings:

I'm relatively new to A7, and have encountered a problem with a brief movement function I wrote to move the camera on a key press:

------------------

function motion1()
{
while(1)
{
if(key_v)
{
camera.x+=1;
}
wait(1);
}
}

--------------

This function works perfectly well in windowed mode, and moves the camera at the same rate in every resolution size A7 offers. However, whenever I switch to fullscreen mode, movement becomes incredibly slow.

Has anyone encountered this problem before, or know how I might go about amending this function so that movement is at the same rate in both windowed and fullscreen modes?

Regards,

J. Parsons.
Posted By: GamerX

Re: Movement Slowdown in Fullscreen Mode - 02/19/09 02:53

add *time_step to it its because there is probably a significant change in fps in full screen v windowed.
Posted By: JackParsons

Re: Movement Slowdown in Fullscreen Mode - 02/19/09 02:56

Thanks, GamerX! That did the trick.

I really appreciate it.

Regards,

-J. Parsons.
Posted By: delinkx

Re: Movement Slowdown in Fullscreen Mode - 02/19/09 02:58

usually the fps rate is slower in fullscreen mode than windowed mode. u can press F11 to get the details while running the application. u can compare then. for a more smooth motion, use time_step as GamerX mentioned above.
Posted By: JackParsons

Re: Movement Slowdown in Fullscreen Mode - 02/19/09 09:01

Thanks again. Out of curiosity, I assume the sleep() function is already tuned to adjust to the frame rate? Or, do I have to do sleep(1*time_step) also to ensure that my pause periods are the same on all systems?
Posted By: delinkx

Re: Movement Slowdown in Fullscreen Mode - 02/19/09 09:31

sleep() is no more used. we use wait() now. see manual for more details.
Posted By: Jaxas

Re: Movement Slowdown in Fullscreen Mode - 02/19/09 09:32

use fps_max wink and time_step of course smile
© 2024 lite-C Forums