Random number usage

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?

thanks

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?

OpenGL is purely a graphics API, so you don’t have rand().

thank u so much for your replies,

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

thanks again

Of course you can use rand() with opengl, why not ?
I do not really understand your question.
This has nothing to do with OpenGL.