Hey all,
I'm trying to create a splash / welcome screen for a game I'm working on. I had a look online and found some good info but I'm still unable to get it to work.
Ideally I'd like my main to run a function that would initially display the splash screen, after input it would then display the main menu and from there each screen as appropriate, high scores, levels of game etc.
I've tried that and then I've tried an uglier approach but I can't get the right results. I'm pretty new to OpenGL & GLUT and not fantastic when it comes to C++.
Any help would be hugely appreciated.
Below is code that I'm using / trying to use. stripped of unnecessary 'stuff'
At the moment there's no response when pressing space. I've tried mouse butting, glut special keys etc but still no joy.
If there's also a more efficient way of doing this then please shout! :D
{
glutInit(&argc, argv);
createGenericWindow();
/////
screenSequence();
glutMainLoop();
}
void screenSequence(){
glutDisplayFunc(displaySplashScreen);
glutIdleFunc(idleSplashScreen);
}
void displaySplashScreen(){
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
splashScreen::drawSplashScreen();
glMatrixMode(GL_MODELVIEW);
glutSwapBuffers();
glFlush();
}
void idleSplashScreen() {
int button = 0;
//if space is pressed...
if ( button == 32) {
std::cout<<"FEFEFEFEF"<<std::endl;
glutDisplayFunc(displayMainGame);
glutIdleFunc(idleMainGame);
}
glutPostRedisplay();
}