Re: [AD] Add timeBeginPeriod(1) to wtimer.c |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Hi All,
Over the weekend I have put a little demo and benchmark program together.
Now being almost ready for upload, should I mail it or put it into the
forum? Somehow it is wip, but could serve as a little demo for a gameloop
already, without much more actually.
So, having done a lot of experiments, including investigations with Rational
Quantify, I'm now utterly confused about the effects of putting
timeBeginPeriod(ticks) into
a) tim_win32_rest()
and
b) tim_win32_high_perf_thread
and maybe even both, with ticks being some numbers e.g. 1, 5 or 10. Program
behaviour is absolutely crazy.
There's one thing I discovered by debugging into draw_sprite: When I use the
result of load_bitmap, then that bitmap is neither system nor video bitmap.
So drawing is then implemented differently, compared to creating a system
bitmap and blitting the result of load_bitmap into that. So, when I do it
that way, the program is fastest and always suffers slowdown from adding any
timeBeginPeriod(anything) anywhere.
Bearing this in mind, I would now suggest to not make any changes, but do
more investigations actually. All this confusion could go back to some wrong
or inefficient usage of data, but this is not really explained anywhere I
think. For example, there no word about the type of bitmap which is returned
from load_bitmap, so I was thinking it should be a system bitmap really.
Wrong thought though.
One question is, why does draw_sprite need so many critical sections? Just
wondering. I saw n calls to draw_sprite call 3*n times EnterCritialSection
and LeaveCriticalSection.
Best regards
Tobias