# Too much time spent on initialize GLUT

## Recommended Posts

As I record, the follows code :
glutWindowHandle = glutCreateWindow("SAXPY");

takes about 9 seconds to run, which is an unusual thing. What can be the reason behind this? My graphic card is Nvidia GeForce 6200 [Edited by - rosicky2005 on March 7, 2007 6:20:34 PM]

##### Share on other sites
yes that sounds way to much, dont know what the problem is, try running someone else glut code,
eg the glut version of the nehe code (lesson one). does it run much quicker?
if not perhaps reinstall your graphics cards drivers

##### Share on other sites
Quote:
 Original post by zedzyes that sounds way to much, dont know what the problem is, try running someone else glut code,eg the glut version of the nehe code (lesson one). does it run much quicker?if not perhaps reinstall your graphics cards drivers

I have tried to reinstall my graphic card driver. But the problem still exists.

Is that the problem of my graphic card setting? After installing the driver, should I set up anything else?

##### Share on other sites
There's too little information available to say what the problem is.

Do opengl games that don't use glut take a long time to start? (going to http://nehe.gamedev.net/ and downloading one of the prebuilt tutorials would be an excellent way to test this)

Do other glut programs take a long time? (ditto).

What version of glut are you using? Is it freeglut or regular glut?

If only other glut programs are starting slow, then the problem lies with glut. If all opengl programs are starting slow, then my money says it's a problem with your driver or video card.

Personally I'd discourage you from using glut anyways, as it has had little to no support for some time now. I strongly encourage you to use SDL instead.

##### Share on other sites
Quote:
 Original post by gharen2There's too little information available to say what the problem is.Do opengl games that don't use glut take a long time to start? (going to http://nehe.gamedev.net/ and downloading one of the prebuilt tutorials would be an excellent way to test this)Do other glut programs take a long time? (ditto).What version of glut are you using? Is it freeglut or regular glut?If only other glut programs are starting slow, then the problem lies with glut. If all opengl programs are starting slow, then my money says it's a problem with your driver or video card.Personally I'd discourage you from using glut anyways, as it has had little to no support for some time now. I strongly encourage you to use SDL instead.

I am using glut-3.7.6 now. But what's the difference between freeglut and regular glut?

http://www.xmission.com/~nate/glut.html

##### Share on other sites
The main difference with freeglut is that it's open source and more recent. That's not to say it's actually "better" per se, but maybe try it and see if it has the same problem.

http://freeglut.sourceforge.net/

##### Share on other sites
Quote:
 Original post by gharen2The main difference with freeglut is that it's open source and more recent. That's not to say it's actually "better" per se, but maybe try it and see if it has the same problem.http://freeglut.sourceforge.net/

I have tried to use Nvidia GeForce 6800 graphic card and the problem still exists.

Also, the freeglut is very difficult to install. There is no clear instruction
and no .lib files.

##### Share on other sites
Quote:
 Original post by rosicky2005I have tried to use Nvidia GeForce 6800 graphic card and the problem still exists.Also, the freeglut is very difficult to install. There is no clear instructionand no .lib files.

Come on, if you can compile your program you can certainly compile a library.
Are you able to debug your application and suspend it in the middle of the nine seconds of initialization, or to profile your application and get a report of where it spends time? What about the comparisons gharen2 suggests?

##### Share on other sites
Quote:
 Original post by rosicky2005glutWindowHandle = glutCreateWindow("SAXPY");takes about 9 seconds to run, which is an unusual thing.

Is the sample you are running your own of the demo made by Dom from GPGPU.org?

##### Share on other sites
The question the original poster should ask himself is: "Does this delay matter?"
I can't see how a slightly longer initialization will affect the runtime performance of the application, which should be what matters.

##### Share on other sites
Personally I'd be pretty annoyed if a simple little game took 9 seconds to start up.

##### Share on other sites
I'd be very annoyed at a 9 second startup every time I wanted to test my application. Then again I code a few lines and test, finding bugs is easier that way, yes even with 20,000 lines of code or more now.

But what the OP has to ask himself is why he is using glut when it's not really maintained anymore. Look into other libraries like FreeGLUT (still not my thing) or SDL.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
627707
• Total Posts
2978721

• 21
• 14
• 12
• 22
• 35