comparison Framework/Scene2D/OpenGLCompositor.cpp @ 1298:8a0a62189f46

replacing std::auto_ptr by std::unique_ptr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Mar 2020 16:31:30 +0100
parents 2d8ab34c8c91
children 257f2c9a02ac
comparison
equal deleted inserted replaced
1296:86400fa16091 1298:8a0a62189f46
31 namespace OrthancStone 31 namespace OrthancStone
32 { 32 {
33 class OpenGLCompositor::Font : public boost::noncopyable 33 class OpenGLCompositor::Font : public boost::noncopyable
34 { 34 {
35 private: 35 private:
36 std::auto_ptr<GlyphTextureAlphabet> alphabet_; 36 std::unique_ptr<GlyphTextureAlphabet> alphabet_;
37 std::auto_ptr<OpenGL::OpenGLTexture> texture_; 37 std::unique_ptr<OpenGL::OpenGLTexture> texture_;
38 38
39 public: 39 public:
40 Font(OpenGL::IOpenGLContext& context, const GlyphBitmapAlphabet& dict) 40 Font(OpenGL::IOpenGLContext& context, const GlyphBitmapAlphabet& dict)
41 { 41 {
42 alphabet_.reset(new GlyphTextureAlphabet(dict)); 42 alphabet_.reset(new GlyphTextureAlphabet(dict));
43 texture_.reset(new OpenGL::OpenGLTexture(context)); 43 texture_.reset(new OpenGL::OpenGLTexture(context));
44 44
45 std::auto_ptr<Orthanc::ImageAccessor> bitmap(alphabet_->ReleaseTexture()); 45 std::unique_ptr<Orthanc::ImageAccessor> bitmap(alphabet_->ReleaseTexture());
46 texture_->Load(*bitmap, true /* enable linear interpolation */); 46 texture_->Load(*bitmap, true /* enable linear interpolation */);
47 } 47 }
48 48
49 OpenGL::OpenGLTexture& GetTexture() const 49 OpenGL::OpenGLTexture& GetTexture() const
50 { 50 {
179 { 179 {
180 if (!context_.IsContextLost()) 180 if (!context_.IsContextLost())
181 { 181 {
182 context_.MakeCurrent(); // this can throw if context lost 182 context_.MakeCurrent(); // this can throw if context lost
183 183
184 std::auto_ptr<Font> font(new Font(context_, dict)); 184 std::unique_ptr<Font> font(new Font(context_, dict));
185 185
186 Fonts::iterator found = fonts_.find(index); 186 Fonts::iterator found = fonts_.find(index);
187 187
188 if (found == fonts_.end()) 188 if (found == fonts_.end())
189 { 189 {