View Full Version : Random number usage

05-20-2009, 08:45 AM
Hello everybody,

does anybody have any idea about rand() command in opengl? do you know that if we can use it? and if we can use it, do we need to add any other libraries other than ctime and cstdlib?


05-20-2009, 09:30 AM
I'm not 100% sure about what I'm about to say, but I don't think opengl has some rand() function...

Anyway, with cstdlib included you should be able to make it work...

Can you post your includes?

Ilian Dinev
05-20-2009, 09:39 AM
OpenGL is purely a graphics API, so you don't have rand().

05-20-2009, 10:39 AM
thank u so much for your replies,

:) and i created my own random number generator, so there is no need to use rand() any more.

thanks again

05-20-2009, 10:39 AM
Of course you can use rand() with opengl, why not ?
I do not really understand your question.
This has nothing to do with OpenGL.