displaying images randomly

Started by
11 comments, last by entone 16 years, 7 months ago
Ha, nah its not because you are returning.

glutMainLoop is an infinite loop for rendering and updating. what you are going to want to do is:

displayfun1(){}
reshapefun1(){}

displayfun2(){}
reshapefun2(){}


int main(...)
{

glutCreateWindow (...);
glutDisplayFunc (displayfun);
glutReshapeFunc (reshapefun);
glutMainLoop ();

return 0;
}

displayfun
{
int randomFunction = rand() % 2;

if(randomFunction)
DrawImage1();
else
DrawImage2();
}
Advertisement
Thank you very much. You got me man!
Now, what library files should i have to download, to play audio..., (am using Borland C++ & Window XP.)

This topic is closed to new replies.

Advertisement