Example #1
0
void Monitor::handleEvent() {
    while (SDL_PollEvent(&event)) {
        switch (event.type) {
            case SDL_QUIT:
                setShouldExit();
                break;
            case SDL_KEYDOWN:
                switch (event.key.keysym.scancode) {
                    case SDL_SCANCODE_ESCAPE:
                        setShouldExit();
                        break;
                    default:
                        break;
                }
            default:
                controller->handleEvent(&event);
                break;
        }
    }
}
Example #2
0
ResultCode Threading::Thread::setShouldExitAndWait (const double interval) throw()
{
    ResultCode result = PlankResult_OK;
    
    result = setShouldExit();
    plonk_assert (result == PlankResult_OK);
    
    while (isRunning())
        Threading::sleep (interval);
    
    return result;
}
Example #3
0
void RGBDGrabber :: stop()
{
    setShouldExit();
    newEvent();
    wait();
}