Example #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);
    }
}
Example #2
0
File: main.c Project: pavelfryz/fit
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);
    }
}