- while( gameLoopActive ){
- currentSDLTicks = SDL_GetTicks();
- /***********************************
- * BENUTZERINTERAKTIONSPART (SDL)
- ***********************************/
- while( SDL_PollEvent( &sdlEvent ) == 1 ){
- if( sdlEvent.type == SDL_QUIT ) stopGameLoop();
- }
- /***********************************
- * RENDERPART (OpenGL)
- ***********************************/
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
- glLoadIdentity();
- mainCamera->setPosition( 5.0f, 1.0f, 5.0f );
- mainCamera->lookAt( 0.01f, 0.01f, 0.01f );
- mainCamera->useCamera();
- std::cout << "Grad: " << mainCamera->getRotate() << std::endl;
- if( currentMap != NULL ) currentMap->render( *textureManager, *modelManager );
- SDL_GL_SwapBuffers();
- //Updaten der FPS
- if( currentSDLTicks - lastFPSUpdate >= 1000 ){
- framecounter++;
- currentFPS = framecounter;
- framecounter = 0;
- lastFPSUpdate = currentSDLTicks;
- } else framecounter++;
- //Eine Verzögerung einbauen um die FPS zu veringern
- SDL_Delay( 1000 );
- }