Пример #1
0
void SDLWindow::handlePollEvent() {
    while (SDL_PollEvent(&m_sdlEvent)) {
        switch (m_sdlEvent.type) {
            case SDL_WINDOWEVENT: {
                handleWindowEvent();
            } break;
            case SDL_KEYUP: {
                handleKeyUpEvent();
            } break;
            case SDL_KEYDOWN: {
                handleKeyDownEvent();
            } break;
            case SDL_QUIT: {
                onClose();
            } break;
        }
    }
}
Пример #2
0
void Tetris::handleEvent( TetrisEvent& event ){
	
	switch ( event.type() ) {
		
		case SDL_QUIT:
			m_Quit = true;
			break;
			
		case SDL_KEYDOWN:
			handleKeyDownEvent( event.keyCode() );
			break;
		
		case SDL_KEYUP:
			handleKeyUpEvent( event.keyCode() );
			break;
			
		default:
			break;
	}
	
}