Scott A Thisse wrote:
> I tried the attached code (after cloning another png file to be
> splash-bg3.png) and I still get the noticeable delay that the OP was
> concerned with.
>
> Doubling the delay loop gave a corresponding increase in delay before
> the splash screen _image_ was displayed. I get:
>
> splash win background -- delay -- splash image -- delay -- main win
>
> The sleep/usleep appears to be suspending everything before the image
> has a chance to display. If I made the loop condition a hundred times
> bigger (300) and the sleep/usleep a hundred times smaller (10/10000),
> the image displays quickly.
>
> ===== ===== =====
>
> for (int i=0; i<300; i++ ) {
> Fl::check(); // call this first
> #ifdef WIN32
> Sleep ( 10 );
> #else
> usleep( 10000 );
> #endif
> }
>
> ===== ===== =====
I can't see this with a normal Windows program, but I can also see this with an
X11 version (even with a local display on my Windows box (FLTK 1.3)).
<guess-mode>
I think that this has to do with the X11 protocol, and the first Fl::check() is
maybe too early to process the window show event and/or some other rendering or
drawing calls. Making the delay shorter (with more loops, like you did), makes
the image appear quickly. I don't know enough about the X11 internals to do
more
than guessing here. Maybe someone else can confirm this.
</guess-mode>
Just for testing I added a small delay with Fl::check() in the constructor, and
this made the image also appear quickly. Seems to confirm this.
However, this is now somewhat academical. I'll post another "two independent
windows" example without these problems in another reply.
Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk