Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Callbacks and Timers » TimerCallBack interval resolution
Re: TimerCallBack interval resolution [message #59489 is a reply to message #59484] Thu, 05 January 2023 09:29 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
superdev wrote on Wed, 04 January 2023 20:19
mirek wrote on Mon, 24 January 2022 10:47
deep wrote on Mon, 24 January 2022 09:56
Hi Mirek,

Thanks for explanation.

I was under impression that SetTimeCallback/TimeCallback as independent time trigger.

mirek wrote on Sun, 23 January 2022 00:02


It is supposed to be about 20ms by design and it is not even guaranteed. If you need more precise timing, you need to run it in separate thread.



Small code snippet or link will be helpful to setup repeat callback independent of GUI.


Frankly, the only time I did that was in SDL2 based sound synthetiser and there the period is set by SDL2 sound system.

Still, you can check it here:

https://github.com/ultimatepp/ultimatepp/blob/master/example s/Synth/Core.cpp

(or in examples/SDLSoundDemo)

So how to combine UPP GUI(Ctrl) and SDL2 window (>100 FPS)?
I've tried TopWindow::OpenMain(), then ProcessEvents and render in loop. It works but the loop freezes, for example during TopWindow resizing, dialog showing.


If you are doing a game, probably consider using VirtualGui. Otherwise, what about separate thread for SDL?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to do to stop progress zip file ?
Goto Forum:
  


Current Time: Tue Jun 11 07:59:43 CEST 2024

Total time taken to generate the page: 0.02049 seconds