Пример #1
0
void RaytracerApplication::handle_event( const SDL_Event& event )
{
    int width, height;

    if ( !raytracing ) {
        camera_control.handle_event( this, event );
    }

    switch ( event.type )
    {
    case SDL_KEYDOWN:
        switch ( event.key.keysym.sym )
        {
        case KEY_RAYTRACE:
            get_dimension( &width, &height );
            toggle_raytracing( width, height );
            break;
        case KEY_SCREENSHOT:
            output_image();
            break;
        default:
            break;
        }
    default:
        break;
    }
}
Пример #2
0
void RaytracerApplication::handle_event( const SDL_Event& event )
{
    int width, height;

    if ( !raytracing ) {
        camera_control.handle_event( this, event );
    }

    switch ( event.type )
    {
    case SDL_KEYDOWN:
        switch ( event.key.keysym.sym )
        {
        case KEY_RAYTRACE:
            get_dimension( &width, &height );
            toggle_raytracing( width, height );
            break;
        case KEY_SEND_PHOTONS:
            raytracer.initialize(&scene, options.num_samples, 0, 0);
            queue_render_photon=true;
            
        case KEY_SCREENSHOT:
            output_image();
            break;
        default:
            break;
        }
    default:
        break;
    }
}
Пример #3
0
void OpenglApplication::handle_event( const SDL_Event& event )
{
    camera_control.handle_event( this, event );

    // open to add more event handlers
    switch ( event.type )
    {
    case SDL_KEYDOWN:
        switch ( event.key.keysym.sym )
        {
        case KEY_SCREENSHOT:
            take_screenshot();
            break;
		case KEY_PAUSE:
			isUpdateAll = !isUpdateAll;
			project.modifyWaterStatus(isUpdateAll);
			break;
		case KEY_MESH:
			isMeshOnly = !isMeshOnly;
			project.modifyMesh(isMeshOnly);
			break;
		case KEY_TRANSPARENT:
			isTransparent = !isTransparent;
			project.modifyTransparency(isTransparent);
        default:
            break;
        }
    default:
        break;
    }
}
Пример #4
0
void PhysicsApplication::handle_event( const SDL_Event& event )
{
    camera_control.handle_event( this, event );

    switch ( event.type )
    {
    case SDL_KEYDOWN:
        switch ( event.key.keysym.sym )
        {
        case KEY_SCREENSHOT:
            take_screenshot();
            break;
        case SDLK_UP:
            speed *= 2;
            break;
        case SDLK_DOWN:
            speed /= 2;
            break;
        case SDLK_SPACE:
            pause = !pause;
            break;
        default:
            break;
        }
    default:
        break;
    }
}
Пример #5
0
void GlslApplication::handle_event( const SDL_Event& event )
{
    camera_control.handle_event( this, event );

    switch ( event.type )
    {
    case SDL_KEYDOWN:
        switch ( event.key.keysym.sym )
        {
        case KEY_SCREENSHOT:
            take_screenshot();
            break;
        default:
            break;
        }
    default:
        break;
    }
}