Mercurial > hg > orthanc-stone
comparison Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp @ 1507:169adf9090a6
replacing deprecated std::auto_ptr by std::unique_ptr
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 06 Jul 2020 16:47:40 +0200 |
parents | 828a9b4ee1b7 |
children |
comparison
equal
deleted
inserted
replaced
1506:f88265c3f8a0 | 1507:169adf9090a6 |
---|---|
27 #include "../../../Framework/StoneException.h" | 27 #include "../../../Framework/StoneException.h" |
28 #include "../../../Framework/StoneEnumerations.h" | 28 #include "../../../Framework/StoneEnumerations.h" |
29 #include "../../../Framework/StoneInitialization.h" | 29 #include "../../../Framework/StoneInitialization.h" |
30 #include "../../../Framework/Viewport/SdlViewport.h" | 30 #include "../../../Framework/Viewport/SdlViewport.h" |
31 | 31 |
32 #include <Compatibility.h> // For std::unique_ptr<> | |
32 #include <OrthancException.h> | 33 #include <OrthancException.h> |
33 | 34 |
34 #include <boost/program_options.hpp> | 35 #include <boost/program_options.hpp> |
35 #include <SDL.h> | 36 #include <SDL.h> |
36 | 37 |
196 } | 197 } |
197 else if (event.type == SDL_MOUSEBUTTONDOWN || | 198 else if (event.type == SDL_MOUSEBUTTONDOWN || |
198 event.type == SDL_MOUSEMOTION || | 199 event.type == SDL_MOUSEMOTION || |
199 event.type == SDL_MOUSEBUTTONUP) | 200 event.type == SDL_MOUSEBUTTONUP) |
200 { | 201 { |
201 std::auto_ptr<OrthancStone::IViewport::ILock> lock(viewport->Lock()); | 202 std::unique_ptr<OrthancStone::IViewport::ILock> lock(viewport->Lock()); |
202 if (lock->HasCompositor()) | 203 if (lock->HasCompositor()) |
203 { | 204 { |
204 OrthancStone::PointerEvent p; | 205 OrthancStone::PointerEvent p; |
205 OrthancStoneHelpers::GetPointerEvent(p, lock->GetCompositor(), | 206 OrthancStoneHelpers::GetPointerEvent(p, lock->GetCompositor(), |
206 event, keyboardState, scancodeCount); | 207 event, keyboardState, scancodeCount); |