# Strange GLFW window delay

**URL:** <https://discourse.glfw.org/t/strange-glfw-window-delay/308>\
**Category:** support\
**Created:** [July 5, 2010, 9:15am UTC](https://discourse.glfw.org/t/strange-glfw-window-delay/308 "2010-07-05T09:15:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 5, 2010, 9:15am UTC](https://discourse.glfw.org/t/strange-glfw-window-delay/308/1 "2010-07-05T09:15:49Z")

</div>

**[cameronking](https://sourceforge.net/u/cameronking/)** wrote on [Monday, July 05, 2010](https://sourceforge.net/p/glfw/discussion/247562/thread/4513328e/#6d76):

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 7, 2010, 12:35am UTC](https://discourse.glfw.org/t/strange-glfw-window-delay/308/2 "2010-07-07T00:35:10Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Wednesday, July 07, 2010](https://sourceforge.net/p/glfw/discussion/247562/thread/4513328e/#5a13):

What system are you on?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 7, 2010, 8:05am UTC](https://discourse.glfw.org/t/strange-glfw-window-delay/308/3 "2010-07-07T08:05:39Z")

</div>

**[cameronking](https://sourceforge.net/u/cameronking/)** wrote on [Wednesday, July 07, 2010](https://sourceforge.net/p/glfw/discussion/247562/thread/4513328e/#0d61):

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 13, 2010, 2:07pm UTC](https://discourse.glfw.org/t/strange-glfw-window-delay/308/4 "2010-07-13T14:07:01Z")

</div>

**[cameronking](https://sourceforge.net/u/cameronking/)** wrote on [Tuesday, July 13, 2010](https://sourceforge.net/p/glfw/discussion/247562/thread/4513328e/#8189):

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 13, 2010, 3:23pm UTC](https://discourse.glfw.org/t/strange-glfw-window-delay/308/5 "2010-07-13T15:23:46Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Tuesday, July 13, 2010](https://sourceforge.net/p/glfw/discussion/247562/thread/4513328e/#be77):

Sorry for not getting back to you sooner.

Does this work as expected?

[http://paste.pocoo.org/show/237047/](http://paste.pocoo.org/show/237047/)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 16, 2010, 3:57pm UTC](https://discourse.glfw.org/t/strange-glfw-window-delay/308/6 "2010-07-16T15:57:48Z")

</div>

**[cameronking](https://sourceforge.net/u/cameronking/)** wrote on [Friday, July 16, 2010](https://sourceforge.net/p/glfw/discussion/247562/thread/4513328e/#9f04):

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
