Mercurial > hg > orthanc-stone
changeset 720:f2ee003ba955
Switch to make_shared in various places
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 20 May 2019 12:37:30 +0200 |
parents | d1feb89ea742 |
children | af0aa0c149fa |
files | Samples/Sdl/BasicScene.cpp |
diffstat | 1 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/Samples/Sdl/BasicScene.cpp Mon May 20 11:03:50 2019 +0200 +++ b/Samples/Sdl/BasicScene.cpp Mon May 20 12:37:30 2019 +0200 @@ -40,6 +40,9 @@ #include <Core/Images/ImageProcessing.h> #include <Core/Images/PngWriter.h> +#include <boost/make_shared.hpp> +#include <boost/ref.hpp> + #include <SDL.h> #include <stdio.h> @@ -216,18 +219,16 @@ switch (event.button.button) { case SDL_BUTTON_MIDDLE: - activeTracker.reset(new PanSceneTracker( - controller, e)); + activeTracker = boost::make_shared<PanSceneTracker>(controller, e); break; case SDL_BUTTON_RIGHT: - activeTracker.reset(new ZoomSceneTracker( - controller, e, compositor.GetCanvasHeight())); + activeTracker = boost::make_shared<ZoomSceneTracker>(controller, + e, compositor.GetCanvasHeight()); break; case SDL_BUTTON_LEFT: - activeTracker.reset(new RotateSceneTracker( - controller, e)); + activeTracker = boost::make_shared<RotateSceneTracker>(controller, e); break; default: @@ -374,8 +375,8 @@ try { MessageBroker broker; - ViewportControllerPtr controller( - new ViewportController(broker)); + ViewportControllerPtr controller = boost::make_shared<ViewportController>( + boost::ref(broker)); PrepareScene(controller); Run(controller); }