[Gambas-user] Timer controls and other timing-related issues

Benoit Minisini gambas at ...1...
Fri Jan 27 21:41:49 CET 2006


On Friday 27 January 2006 19:31, Christopher Brian Jack wrote:
> <<<this is a repost with an appropriate subject line>>>
>
> I was just on the subject of timer controls on another response and a
> situation that may be of importance to me is how well code can keep up
> with the timer.
>
> I know slow stuff like graphics rendering is going to play havoc with
> timing so I know that I need to decouple the beat counter from the
> scheduling code.  I believe the easiest way is for the scheduling to
> figure out the next beat index it needs notification on and have the
> high-speed beatcounter only raise a schedule event when the target beat is
> reached.  To get true concurrency would the schedule event need to be in a
> separate class.  The best I can glean out of the documentation is that an
> event declaration of one class cannot be triggered by a separate class
> (mind you a LOT of documentation is incomplete).  What is the best way to
> go about this?
>
> I also need another level of separation.  The game dynamics update runs at
> a fixed rate but again is decoupled with rendering capacity.  This means
> the game logic runs at a constant rate despite a weak link in potential
> rednering (eg: operations on Pictures/Images like alpha blends -- thinking
> on either unacellerated or systems which do not support acelleration
> available on the installed hardware, a constant problem under Linux --
> which is another missing image/picture operation -- it's supported but
> only if the format is PNG or GIF and told to enable transparency and
> images don't do it at all AFAIK - so if I was fading graphics in and out I
> would need prerendered "alpha"ized slices of each image and draw them in
> sequence to do fade ins or fade outs -- umm, but what if I want to
> PictureObject.Grab, and fade the image in the DrawingArea out?)
>
> Any suggestions here?
> Maybe a gb.imageops.lib is needed?
>
> But
>   DrawPictureWithAlpha(alpha,imageobject,x,y,imgx,imgy,imgw,imgh)
>   DrawImageWithAlpha(alpha,imageobject,x,y,imgx,imgy,imgw,imgh)
>
> Would need to be added to the current Image and Picture objects so that
> you can use blending levels in order to execute "fade" type effects (it
> can also do higlighting type effects as well).
>

The next step of graphics under Linux and X-Window is not yet reached. By the 
next step, I mean full support for accelerated alpha-blending in X11 drivers, 
and stable QT-4 and Cairo libraries.

As soon as the QT and GTK+ components will use the new rendering models based 
on QT-4 and Cairo, you will have all transparent drawings you need.

At the moment, I don't have the time to do that, but the support for these new 
rendering model is not very good (things seems to be very slow most of the 
time).

In a few words, we must be patient... :-)

Anyway, a gambas component that can do effects on image stored in memory could 
be interesting. Is there a good library for that anywhere ?

Regards,

-- 
Benoit Minisini





More information about the User mailing list