Esempio n. 1
0
void Program::mainUpdate() {

	SDL_Event sdlEvent;

	while (_state != STATES::QUIT) {

		// Check SDL_Event queue for quit event, else update handlers
		// -	Do not interrupt by using nested loop to check queue
		SDL_PollEvent(&sdlEvent);

		if (sdlEvent.type == SDL_QUIT) {
			_state = STATES::QUIT;
			break;
		}

		//------------------------
		//	Update handlers (Maintain appropriate order)
		//--------------------

		//entityHandler->update(_deltaTime);
		//collisionHandler->update();
		//npcHandler->update();
		renderHandler->update();
		
		// Calculate FPS at the end of each frame
		calculateFramerate();
		printf("FPS: %f\n", _framerate);

	}
	

}
void RenderScene::runScene(){
    
    
    capture.run();
    eyeVector[0] = capture.getNormPositionX();
    eyeVector[1] = capture.getNormPositionY();
    eyeVector[2] = capture.getNormPositionZ();
    
    //eyeVector[0] = mouseX-WINDOW_WIDTH/2;
    
    //eyeVector[0] = 25;
    //eyeVector[1] = -5;
     
    //std::cout << "Eye-x: " << eyeVector[0] << std::endl;
    //std::cout << "Eye-y: " << eyeVector[1] << std::endl;
    //std::cout << "Eye-z: " << eyeVector[2] << std::endl;
    
    hands.update();
    capture.showRGB("InputRGB");
    capture.showDepth("Depth");
    //capture.showMask("Mask");
    
    calculateFramerate();
    //std::cout << "Framerate: " << fps << std::endl;
    
    glutPostRedisplay();
}