diff --git a/src/hal/linux.cpp b/src/hal/linux.cpp index 72dbe2e..c5ebd9e 100644 --- a/src/hal/linux.cpp +++ b/src/hal/linux.cpp @@ -18,16 +18,19 @@ void hal_init() { exit(1); } - - /* //Create window - window = SDL_CreateWindow( "SDL Tutorial", 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN|SDL_WINDOW_BORDERLESS ); - if( window == NULL ) { + //Create window + window = SDL_CreateWindow("SDL Tutorial", 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, + SDL_WINDOW_SHOWN); //|SDL_WINDOW_BORDERLESS + if (window == nullptr) { printf( "Window could not be created! SDL_Error: %s\n", SDL_GetError() ); exit(1); } - */ - SDL_CreateWindowAndRenderer(SCREEN_WIDTH, SCREEN_HEIGHT, 0, &window, &renderer); + renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); + if (renderer == nullptr) { + printf("Renderer could not be created! SDL_Error: %s\n", SDL_GetError()); + exit(1); + } } @@ -62,6 +65,10 @@ void hal_render() { case SDLK_DOWN: input[I_DOWN]=true; break; + case 'q': + case 0x1b: //ESC + quit = true; + break; } break; @@ -79,6 +86,8 @@ void hal_render() { case SDLK_DOWN: input[I_DOWN]=false; break; + default: + printf("key %x\n", event.key.keysym.sym); } break;