On Oct 12, 2007, at 3:59 AM, Felipe Monteiro de Carvalho wrote:

Creating a custom control is generally the best option to avoid
flickering. It's all documented here:

http://wiki.lazarus.freepascal.org/ Developing_with_Graphics#Motion_Graphics_-_How_to_Avoid_flickering

Thanks Felipe. Writing controls is fun. Am not concerned with flickering, just speed in the cases where direct draw makes sense.
====

On Oct 11, 2007, at 7:43 PM, Luiz Americo Pereira Camara wrote:

You can invalidate only the area that needs update using LCLIntf.InvalidateRect. Then you can get the update rect using the TLMPaint message. With this you can speed the drawing but will require a more sophisticated algorithm to define what to draw.

Luiz

Thanks Luiz. That is worthy to explore if direct drawing turns out infeasible on Carbon Lazarus.
====

On Oct 12, 2007, at 3:55 AM, Mattias Gaertner wrote:

3. LED Audio VU Meters-- [snip]

Make the LEDs controls.

I wrote audio VU Controls. But consider a mixer window with 24 or 48 VU meters, which should visually update about 15 to 30 times per second, while also maintaining realtime views in other sequencer windows (and of course should also play the music without staggering).

Controls I've written for heavy duplication (see screenshot link below)-- For rows of meters, sliders or knobs. They are written as non-windowed controls to minimize memory usage. They share imagelists so if you have a couple of hundred knobs in a mixer, at least all the knobs share the same image pool.

But even if you use controls, it can become a direct-draw issue- If there is a persistent 'pixel backing store' somewhere that individual controls can 'draw over' in small regions of the bigger canvas--

It is just plain faster to directly call the control's paint method somehow, than to invalidate each control and let a lot of messages percolate thru the system before the control finally decides to paint itself.

In Carbon LCL, haven't yet figured out how to directly call an OnPaint method and get anything to show on the screen. An object must be invalidated and called by the LCL before anything will show on the screen, so far.

In the past (non lazarus) it wasn't difficult to draw into a Mac window. Duh. It was much easier before Apple worked all those years to 'improve' it so much that it now causes permanent brain damage to figure out (grin).

Anyway, my sales pitch is not persuasive. Will let it go.

Here is a sequencer window full of some controls. It is a 1920 wide screenshot shrunk down. Reckon 30 times per second of invalidate- onpaint cycles on all these controls, is really gonna cut it?

www.errnum.com/tmpimages/ptw_scrn.jpg

Thanks

jcjr
_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to