NEED HELP WITH TIMERS

Started by
9 comments, last by SeiferAlmasy 18 years, 8 months ago
Something bizarre is going on here I left this question in beginner section but no reply. DXtimer, Threadedtimer and fasttimer components no longer work properly after I reinstalled my OS months ago. They will not run at anything faster than an interval of 10. In otherwords they cannot achieve 100-1000th of a second which I need desperately to work again. Weird thing is, when I open DXDiag (from run)or get the actual program to play music the timer works at the proper resolution???! regardless the compiled exe will not run at proper intervals on other peoples computers no matter what. It is not the fault of delphi/delphix from what I can see. It seems to be a computer/OS problem. Any ideas please really need help.
Advertisement
looks like i am out of luck....question 2 however

how the hell do i stop labels flickering when they are being updated as regular intervals...its getting annoying now.

question 3. is there anywy to make my usb joypad work with force feedback, it just will not work with delphix :(

thanks
Answer to 2: there can't be done much about it. As you are regulary updating it, is has to redraw. You can try to make it update slightly less (once per second).

Answer to 3: Try to use the DirectInput libray for force feedback.

Crafter 2D: the open source 2D game framework

?Github: https://github.com/crafter2d/crafter2d
Twitter: [twitter]crafter_2d[/twitter]

There is a way to stop flickering in windows GDI, but however, available in delphi I don't know, easy to accomplish anyway? no...

I've tried but never truly succeeded, I know in VB there was this little neat trick of locking the window buffer, that did it, not perfect, but stopped the worse flickering at a marginal cost, haven't seen this somewhere else those.


Test your application on another computer and see if the DXTimer calls start working again, it could be a code issue.
--m_nPostCount++
To resolve the flickering issue, you might want to look into Layered Windows (UpdateLayeredWindow() is the API function. Only available on XP and 2k, I believe).
Basically they replace the standard window drawing mechanism with a back buffer you can draw on any way you like, and then call the API function to draw it on the screen.
tested the app on other computers same thing. (i tested the app, i am more than certain if i loaded my project in delphi on another machien, the built app would then work)

intervals of 1-10 are running at 100th of a sec and not their individul speeds.

intervals of 10-20 are running at what 20 should be alone and so on.

in otherwords: only the 10's intervals are working properly. intervals inbetween like 1-9 and 41-49 are running at 10 and 50 respectively, its very very weird. maybe an os/directx problem?

-------
on the directinput library, I am hardly expret, any examples anywhere.

Thanks alot all those who replied, much appreciated

Daniel

I will check out that flickering solution, however in answer to someone earlier, once a second update is way too little for a stopwatch updating once every 100th a second.
This most certainly feels like the low-resolution timers commonly used in Windows, which has intervals at about 9-10ms by default, which can be "temporarily" improved all down to 1ms using a simple command (can't remember right now though).

However, you shouldn't rely on that, there must be some real high-resolution timer for Delphi? Such as the performance timer which is generally used when available.


no this is the official delphix timer too...none of the HR timers work after i reinstalled the os :(
for those that don't know I figured out 1 problem. The flickering can be stopped by this code.

Mainfm.Doublebuffered:=true; You must do that for things like tabs too.

Dunno about those other things I mentioned though

This topic is closed to new replies.

Advertisement