Strange GLFW window delay

cameronking wrote on Monday, July 05, 2010:

I have recently noticed what may be a bug, or perhaps I’m doing something
wrong.

* Setup a window, title and window size.
* Load a “loading” texture.
* GLFW buffer swap (My window should be set-up by now and this swap should
be displaying my “loading” texture, but it isn’t!)
* Load all other images now.
* GLFW sleep for 2 seconds (only when 2 seconds expire and buffer swap
called after does the title and canvas show update!)
* Removes “loading” texture
* GLFW buffer swaps in loop for main menu. (Suddenly the canvas updates and
the window is given the requested title!)

I find that by the point of “sleep for 2 seconds”, the window is still
displaying the stock “GLFW Window”, title and the canvas is black. -Only when
the 2 second (or 10 second or whatever delay you like) has passed does the
GLFW set-up the display and show the “loading” texture.

The reason I find this weird is that immediately I set-up a window and load a
texture, I call GLFW buffer swap. So I’m expecting to see the canvas loaded
with that image.

Why is GLFW sleep delaying the set-up of the window and the canvas??

Thanks for any help,

Cameron

elmindreda wrote on Wednesday, July 07, 2010:

What system are you on?

cameronking wrote on Wednesday, July 07, 2010:

This is on Ubuntu 10.04, Macbook Pro 5,1 with Nvidia 9600M GT.

cameronking wrote on Tuesday, July 13, 2010:

Thanks for taking a look at this elmindreda, would you prefer I simply filed a
bug for this or do you thing I’m doing something wrong?

I can assist with an example if that would help?

You have done a magnificent job with GLFW, it’s truly excellent work, thank
you.

elmindreda wrote on Tuesday, July 13, 2010:

Sorry for not getting back to you sooner.

Does this work as expected?

http://paste.pocoo.org/show/237047/

cameronking wrote on Friday, July 16, 2010:

Hi,

Took some time to work it out. Yes that works fine. My problem was caused by
my own frame rate manager. I was initialising the set-up and then calling
Sleep before the frame rate manager could decide correctly whether to draw or
not. This has been fixed.

Your software is 37 shades of awesome. Thanks.

Cameron