/** * Hier findet die komplette Initialisierung des kompletten SPIEeles statt. * Inklusive der Datenhaltung und des SPIEelfeldes. */ void initGame () { initCameraPosition(); initSpheres(); initQuads(); initParticles(); }
void init(void) { // // GLTXimage* image; // // glClearColor (0.0, 0.0, 0.0, 0.0); // glShadeModel(GL_FLAT); // glEnable(GL_DEPTH_TEST); // // //makeCheckImage(); // image = gltxReadRGB("paisley.rgb"); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); // model = glmReadOBJ("cone.obj"); // //glmUnitize(model); //glmFacetNormals(model); // flächennormalen //glmVertexNormals(model, 45.0, false); // eckennormalen // // // #ifdef GL_VERSION_1_1 // glGenTextures(1, &texName); // glBindTexture(GL_TEXTURE_2D, texName); // #endif // // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); // // // //#ifdef GL_VERSION_1_1 // /* wird fuer eine interne Textur benoetigt*/ // // glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, checkImageWidth, checkImageHeight, // // 0, GL_RGBA, GL_UNSIGNED_BYTE, checkImage); // GL-RGBA - 4 Bytes pro Pixel, zweite Angabe fuer Reihenfolge der Farbkodierung // // /* wird fuer eine externe Textur benoetigt*/ // glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, (*image).width, (*image).height, 0, GL_RGB, GL_UNSIGNED_BYTE, (*image).data); //#else // glTexImage2D(GL_TEXTURE_2D, 0, 4, checkImageWidth, checkImageHeight, // 0, GL_RGBA, GL_UNSIGNED_BYTE, checkImage); //#endif // eignes //glutSetCursor(GLUT_CURSOR_NONE); GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 }; GLfloat mat_shininess[] = { 50.0 }; GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 }; GLfloat light_position1[] = { 0.0, 1.0, 1.0, 0.0 }; GLfloat red[] = {1.0,0.0,0.0,1.0}; GLfloat green[] = {0.0,1.0,0.0,1.0}; glClearColor (0.0, 0.0, 0.0, 0.0); glShadeModel (GL_SMOOTH); glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); glLightfv(GL_LIGHT0, GL_POSITION, light_position); glLightfv(GL_LIGHT0, GL_DIFFUSE, red); glLightfv(GL_LIGHT1, GL_POSITION, light_position1); glLightfv(GL_LIGHT1, GL_DIFFUSE, green); //glEnable(GL_LIGHTING); //glEnable(GL_LIGHT0); //glEnable(GL_LIGHT1); //glEnable(GL_LIGHT2); glEnable(GL_DEPTH_TEST); glEnable(GL_NORMALIZE); //bowls[0].move = false; initPlanes(); initSpheres(); //addBowl(0.0, 2,-1.0); }