void CascadedShadowMapApp::PSSMFactorChangedHandler(UISlider const & sender) { pssm_factor_ = sender.GetValue() * 0.01f; std::wostringstream stream; stream << L"PSSM Factor: " << pssm_factor_; dialog_->Control<UIStatic>(id_pssm_factor_static_)->SetText(stream.str()); deferred_rendering_->SetViewportCascades(0, num_cascades_, pssm_factor_); }
void AreaLightingApp::LengthChangedHandler(UISlider const & sender) { float length = sender.GetValue() / 100.0f; checked_pointer_cast<TubeAreaLightSource>(tube_area_light_)->Extend(float3(0.1f, 0.1f, length)); checked_pointer_cast<SceneObjectLightSourceProxy>(tube_area_light_src_)->Scaling(0.1f, 0.1f, length); std::wostringstream stream; stream << L"Length: " << length; dialog_->Control<UIStatic>(id_length_static_)->SetText(stream.str()); }
void AreaLightingApp::RadiusChangedHandler(UISlider const & sender) { float radius = sender.GetValue() / 100.0f; checked_pointer_cast<SphereAreaLightSource>(sphere_area_light_)->Radius(radius); checked_pointer_cast<SceneObjectLightSourceProxy>(sphere_area_light_src_)->Scaling(radius, radius, radius); std::wostringstream stream; stream << L"Radius: " << radius; dialog_->Control<UIStatic>(id_radius_static_)->SetText(stream.str()); }
void SoundApp::VolumeChangedHandler(UISlider const & sender) { volume_ = sender.GetValue() * 0.01f; AudioFactory& af = Context::Instance().AudioFactoryInstance(); AudioEngine& ae = af.AudioEngineInstance(); ae.SoundVolume(volume_); ae.MusicVolume(volume_); std::wostringstream stream; stream << L"Volume: " << volume_; dialog_->Control<UIStatic>(id_volume_static_)->SetText(stream.str()); }