Custom panel refresh rates
James Bigler
bigler at cs.utah.edu
Tue May 15 07:17:39 PDT 2007
Vadim Zeitlin wrote:
> On Mon, 14 May 2007 07:14:05 -0600 James Bigler <bigler at cs.utah.edu> wrote:
>
> JB> I'm not getting enough refreshes in the two "slower" windows.
>
> Maybe the redrawing is just too slow?
Probably. If I comment all the rendering code, then all the panels get
the same number of OnPaint callbacks. I was hoping that I would see the
same number of refreshes in each window, though.
> JB> So, even though refresh is called the same number of times, OnPaint is
> JB> called disproportionately fewer times on the second and third panels.
>
> I don't know how to explain it but in any case I don't think we can do
> anything about it. The paint events are generated by the underlying toolkit
> and wx just passes them through to your application. If you really need to
> achieve a certain number of FPS you shouldn't be running a normal event
> loop at all but just sit in a tight loop redrawing your windows. Of course,
> this is not recommended at all for the normal programs but maybe your case
> is special...
I knew this was probably an underlying window toolkit issue (outside of
wx). I was hoping someone might know a thing or two about the Windows'
toolkit and could shed light on how it distributes the OnPaint events.
I guess if I want them more even, I'll have to manage these updates
myself and call Update() when all the windows need refreshing.
Thanks,
James
More information about the wx-users
mailing list