Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: GLFW window opening extremely slow?

  1. #1
    Intern Contributor
    Join Date
    May 2011
    Posts
    56

    GLFW window opening extremely slow?

    Okay, so I'm trying to start a project using GLFW. But every time I open a window, it at first appears to have frozen (white window, "waiting" cursor, wont accept any input whatsoever), but after about 30-60 seconds it creates the window that it's supposed to. I've tried this with 3 or 4 different programs and the result is always the same. Am I setting up my project wrong or something?

    I'm using Visual Studio 2010 Ultimate. Here's my source code:
    Code :
    #define GLEW_STATIC
     
    #include "GL/glew.h"
    #include "GL/wglew.h"
    #include "GL/glfw.h"
     
    #include <stdio.h>
     
    #pragma comment (lib, "glfw.lib")
    #pragma comment (lib, "opengl32.lib")
    #pragma comment (lib, "glu32.lib")
     
    int main(int argc, char** args)
    {
    	bool running = true;
    	glfwInit();
    	glewInit();
    	glfwOpenWindow(640, 480, 8, 8, 8, 8, 24, 0, GLFW_WINDOW);
    	glClearColor(0.5, 0.5, 1.0, 1.0);
    	while (running)
    	{
    		 /////////////////////
    		// Begin Main Loop //
    		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
     
    		glfwSwapBuffers();
     
    		running = !glfwGetKey(GLFW_KEY_ESC) &amp;&amp; glfwGetWindowParam(GLFW_OPENED);
    	}
     
    	glfwTerminate();
    	return 0;
    }
    It's not the cleanest code, but like I said I've tried a few different simple programs and the result is the same - a 30 second - minute long delay until the window opens.

  2. #2
    Junior Member Regular Contributor
    Join Date
    Jun 2006
    Location
    Edinburgh - Scotland
    Posts
    147

    Re: GLFW window opening extremely slow?

    I'm using GLFW on Windows 7 with ATI card compiling with minGW and I've not seen this, but I did have a problem with fullscreen taking over a minute to start up. A couple of driver updates later and the problem disappeared. Does fullscreen take the same time?

    So all I can suggest is check you've got the latest drivers. Only other thing that stands out is glewInit. I've not used that so don't know if it could be an issue.

    You could also try using freeGlut to see what it does.

  3. #3
    Intern Contributor
    Join Date
    May 2011
    Posts
    56

    Re: GLFW window opening extremely slow?

    I've tried commenting out all glew-related code, but nothing changes. I don't want to use glut because it doesn't support the features I want - GLFW does everything I need it to (except disabling the windows DWM, but that's only one thing, and I can code that in myself).

    I'm using an NVidia card on windows 7, and I have the latest driver version (280.26). Fullscreen gives the same delay.

  4. #4
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,714

    Re: GLFW window opening extremely slow?

    Do you know what the exact function is that's getting the slowdown? Can you step through your main function and see which function is taking a long time?

    Also, is this a release build?

  5. #5
    Intern Contributor
    Join Date
    May 2011
    Posts
    56

    Re: GLFW window opening extremely slow?

    The function that's taking forever is glwOpenWindow(). I tried release, debug, and even a build I compiled myself, same result.

  6. #6
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: GLFW window opening extremely slow?

    And when you break the debug build in the middle the 60 seconds, can you see where inside glwOpenWindow() you fall into ?

    BTW, can you describe your hardware setup, os version, driver version ?

  7. #7
    Junior Member Regular Contributor
    Join Date
    Jun 2006
    Location
    Edinburgh - Scotland
    Posts
    147

    Re: GLFW window opening extremely slow?

    Quote Originally Posted by WIld Sage
    I don't want to use glut because it doesn't support the features I want
    The point was to see if this is something specific to GLFW.

    You could build a debug version with a static GLFW and step through it's code to see exactly what's going on. Also, you could use gDEBugger (now free) and break on every openGL call to see which one is taking the time (http://www.gremedy.com/).

  8. #8
    Intern Contributor
    Join Date
    May 2011
    Posts
    56

    Re: GLFW window opening extremely slow?

    Okay, I tried opening a glut window with similar problems. Rather than displaying a frozen window, however, glut simply takes it's minute before it opens any window.

  9. #9
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,714

    Re: GLFW window opening extremely slow?

    So, did you debug into the library? Where was it stalled?

  10. #10
    Intern Contributor
    Join Date
    May 2011
    Posts
    56

    Re: GLFW window opening extremely slow?

    Couldn't figure out how ._.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •