[SDL] esc detector wont run -- 'out of scope'

speartip clangray at fastmail.com
Fri Mar 24 13:57:06 PDT 2017


Thanks every one. In addition to having a window in context I added this small code:


Code:

 const Uint8 *keys = SDL_GetKeyboardState(NULL);
        SDL_Event e;
.
.
.

 while (SDL_PollEvent(&e)){
                    if (e.type == SDL_QUIT){
                        done = SDL_TRUE;
                    }
                    if (keys[SDL_SCANCODE_ESCAPE]){
                        done = SDL_TRUE;}
                    }






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20170324/c3b51803/attachment.htm>


More information about the SDL mailing list