Removed Legacy Camera resize

This commit is contained in:
2023-03-01 09:29:25 -08:00
parent 7838e1b92d
commit 1d26228cb5
5 changed files with 4 additions and 8 deletions

View File

@ -81,13 +81,11 @@ void Camera::onStart() {
auto rt = this->getRenderTarget();
this->projectionNeedsUpdating = true;
this->eventRenderTargetResized.invoke(rt->getWidth(), rt->getHeight());
this->event2RenderTargetResized.invoke(rt->getWidth(), rt->getHeight());
// Subscribe to new render target resized.
return evtResized = useEventLegacy([&](RenderTarget *rt, float_t w, float_t h){
this->projectionNeedsUpdating = true;
this->eventRenderTargetResized.invoke(w, h);
this->event2RenderTargetResized.invoke(w, h);
}, rt->eventRenderTargetResized);
}, renderTarget);
@ -105,6 +103,5 @@ void Camera::onStart() {
evtResized = useEventLegacy([&](RenderTarget *rt, float_t w, float_t h){
this->projectionNeedsUpdating = true;
this->eventRenderTargetResized.invoke(w, h);
this->event2RenderTargetResized.invoke(w, h);
}, getRenderTarget()->eventRenderTargetResized);
}

View File

@ -40,8 +40,7 @@ namespace Dawn {
StateProperty<float_t> clipNear;
StateProperty<float_t> clipFar;
Event<float_t, float_t> eventRenderTargetResized;
StateEvent<float_t, float_t> event2RenderTargetResized;
StateEvent<float_t, float_t> eventRenderTargetResized;
/**
* Create a new Camera Component.

View File

@ -57,7 +57,7 @@ void PixelPerfectCamera::onStart() {
useEvent([&](float_t w, float_t h){
this->updateDimensions();
}, this->camera->event2RenderTargetResized);
}, this->camera->eventRenderTargetResized);
useEffect([&]{
this->updateDimensions();

View File

@ -50,7 +50,7 @@ void SubSceneCameraAlign::onStart() {
return evtCameraResized = useEvent([&](float_t w, float_t h){
this->realign();
}, this->camera->event2RenderTargetResized);
}, this->camera->eventRenderTargetResized);
}, this->camera);
auto renderEffect = useEffectWithTeardown([&]{

View File

@ -55,7 +55,7 @@ void UICanvas::onStart() {
(*it)->updatePositions();
++it;
}
}, camera->event2RenderTargetResized);
}, camera->eventRenderTargetResized);
}, camera);
useEffectWithTeardown([&]{