Main loop/Movie FPS
Blitz3D Forums/Blitz3D Programming/Main loop/Movie FPS
| ||
..after latest Blitz3D update (1.91), I start to playing with movie as a texure again..my question is how to properly escape from locking ingame main loop FPS with movie FPS (movie is in loop all time)..so, how to keep separate main loop and movie FPS? I did something with stop updating movie within main loop, and its working, but picture is not smooth anymore...on another side, if I dont do that, main loop FPS following movie FPS (25 fps in my case)...so..anyone knows elegant solution for this issue? |
| ||
Someone said that in effect you couldn't/didn't need to control FPS - that Blitz will update the frame counter by the correct amount every time UpdateWorld is called. Otherwise with variable timings induced by changing in-game fps trying to also control smooth movie playback would be nitemare. In other words, movie playback has it's own internal timer(?). |
| ||
If you are using a frame-tweening technique, you must not call the DrawMovie() command inside the main loop. Each time you open a movie, it starts being played on the background, you have to write a separate code (outside the main loop) so that you only call the DrawMovie when you know for sure a new frame is in the animation, so if you have a 30fps movie then write a code which calls DrawMovie every 33 milliseconds and so ... something like this: ;--- VIDEO PROYECTADO --- movies_millis=MilliSecs()-movies_millis movies_storemillis=movies_storemillis+movies_millis movies_millis=MilliSecs() If movies_storemillis>32 movies_storemillis=0 DrawMovie() CopyRect (to texture here) EndIf ;---------------------------------- |
| ||
Also, its advisable to put a little Delay in your main loop. |
| ||
..Eurythmia..your advice working very well..thanks a lot to all of you guys... |