Guest User

Untitled

a guest
Jun 23rd, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.45 KB | None | 0 0
  1. // FINDING EMO - AquaticRace.cpp
  2. //
  3. // Aquatic Racing mini game code
  4. //
  5. // Coded By Richard Scollon
  6.  
  7. #include <gl\glut.h>
  8. #include <gl\gl.h>
  9. #include <gl\glu.h>
  10. #include <stdlib.h>
  11. #include <conio.h>
  12. #include <stdio.h>
  13.  
  14. void DrawMainMenu(void) {
  15.  
  16.     glClear(GL_COLOR_BUFFER_BIT);
  17.     glColor3f(0.0, 0.0, 0.0);
  18.     glMatrixMode(GL_MODELVIEW);
  19.     glLoadIdentity();
  20.     glEnable (GL_TEXTURE_2D);
  21.    
  22.  
  23.  
  24. //draw menu splash and attach texture
  25.         glRecti(0,0,800,600);
  26.         glColor3f(1.0f, 1.0f, 1.0f);
  27.  
  28.         output(400,375,"Press Enter to start a new game");
  29.         output(350,375,"Press L to load game");
  30.         output(300,375,"Press K to view game controls");
  31.         output(250,375,"Press C to view game credits");
  32.         output(200,375,"Press Esc to Exit game");
  33.    
  34.    
  35. }
  36.  
  37.  
  38.  
  39. void processNormalKeys(unsigned char key, int x, int y) {
  40.  
  41. //Exit when user presses Esc
  42.     if (key == 27)
  43.         exit(0);
  44.  
  45. //Load newgame menu
  46.     if (key == 13)
  47.         load NewGame.cpp
  48.  
  49.  
  50. //load load game menu
  51.     if (key == "l")
  52.  
  53. //open the credits menu
  54.     if (key == "c")
  55.         load Credits.cpp
  56.  
  57. //open the controls menu
  58.     if (key == "k")
  59.         load Controls.cpp
  60.  
  61.  
  62. int main(int argc, char **argv)
  63. {
  64.     glutInit(&argc, argv);
  65.     glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
  66.     glutInitWindowPosition(0,0);
  67.     glutInitWindowSize(600,800);
  68.     glutCreateWindow("Finding Emo");
  69.     glutIgnoreKeyRepeat(1);
  70.     glutKeyboardFunc(processNormalKeys);
  71.     glutDisplayFunc(DrawMainMenu);
  72.     glutMainLoop();
  73.     return(0);
  74. }
Add Comment
Please, Sign In to add comment