PDA

View Full Version : GLuint



link19
03-12-2001, 08:31 AM
Hi all,
Had a for loop with the second parameter i >= 0. In this case the i was of type GLuint. This line caused me quite the difficulty. On execution it paused and you could hear the disk spooling, and then id get an error message that i was out of virtual memory. If i change the type to int...no worries. As well if i kept the type as GLuint but changed the condition to i>0...also no problem. Anyone know the reasons behind these behaviours?

chennes
03-12-2001, 10:09 AM
I believe that GLuint stands for GL unsigned integer, yes? As in, GLuint >=0 is always true... Sounds like you hit an infinite loop to me.

Chris

[This message has been edited by chennes (edited 03-12-2001).]

link19
03-12-2001, 10:11 AM
Yah, youre right. Dont know why i didnt see it myself. Long day i think... http://www.opengl.org/discussion_boards/ubb/smile.gif

A027298
03-12-2001, 10:13 AM
Hi Link19,


I think it is very easy.
If you use a GLuint in your loop, and check your loopcondition with i >= 0, then you will have a loop forever, because a GLuint is UNSIGNED, that mean it can never be < 0.

Bye


A027298