Пример #1
0
void onMouseButton(SDL_MouseButtonEvent *mouse)
{
    /* zoom kamery */
    if( mouse->button == SDL_BUTTON_WHEELUP )
    {
        renSceneMoveZ(renderer, -1);
    }
    else if( mouse->button == SDL_BUTTON_WHEELDOWN )
    {
        renSceneMoveZ(renderer, 1);
    }
}
Пример #2
0
void onMouseMotion(SDL_MouseMotionEvent *mouse)
{
    if( mouse->state & SDL_BUTTON_LMASK )
    {
        /* rotace cele sceny */
        renSceneRotXY(renderer, mouse->yrel, mouse->xrel);
    }
    else if( mouse->state & SDL_BUTTON_RMASK )
    {
        /* posuv kamery */
        renSceneMoveZ(renderer, mouse->yrel);
    }
}