asmodehn / sdlut

SDL utility toolkit - A C++ wrapper arount SDL 1.2
BSD 2-Clause "Simplified" License
2 stars 1 forks source link

Add an event rate management #17

Open asmodehn opened 10 years ago

asmodehn commented 10 years ago

XorfacX: In order to optimize p0 we need to be able to set an event check rate different of the framerate. He should be set when the mainlop is launched. Something like mainloop(framerate = 60, eventrate = 30) Perhaps also add a prerender/postrender rate ?

asmodehn commented 10 years ago

Well I am not even sure a event rate is really usefull, so wait and see before discussing post and prerender functions ;) Question : what should we do if the event rate is faster than the frame rate ? ignoring it is easy, but if we want to take it into account, the code calculating the time might be too heavy and slow things down too much to be usefull. :p

asmodehn commented 10 years ago

XorfacX: never go faster than the refresh rate. it's not useful and will certainly cause unpredictable result. the objective is to optimize speed not add a functionnality, if it's useful, we'll thik about it later

asmodehn commented 10 years ago

Alright ;-) thats what I thought but I prefer having a confirmation. Thats done and should now be tested :-p If the eventrate is faster than the refresh rate, then it will be ignored, and event will happen every frame anyway.

asmodehn commented 10 years ago

task for event rate management added. should be tested... (Browse SVN revision 800)

asmodehn commented 10 years ago

XorfacX: This work with the latest version of p0. Can you conform me u let this event rate management in latest commits of SDLut ? If yes, please close this ticket.