Mercurial > hg > orthanc-stone
comparison Framework/Scene2D/OpenGLCompositor.cpp @ 1308:adf234ecaa00 broker
Merge
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 04 Mar 2020 10:21:54 +0100 |
parents | 257f2c9a02ac |
children | 4f8db2d202c8 |
comparison
equal
deleted
inserted
replaced
1307:8a28a9bf8876 | 1308:adf234ecaa00 |
---|---|
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 { |
183 { | 183 { |
184 if (!context_.IsContextLost()) | 184 if (!context_.IsContextLost()) |
185 { | 185 { |
186 context_.MakeCurrent(); // this can throw if context lost | 186 context_.MakeCurrent(); // this can throw if context lost |
187 | 187 |
188 std::auto_ptr<Font> font(new Font(context_, dict)); | 188 std::unique_ptr<Font> font(new Font(context_, dict)); |
189 | 189 |
190 Fonts::iterator found = fonts_.find(index); | 190 Fonts::iterator found = fonts_.find(index); |
191 | 191 |
192 if (found == fonts_.end()) | 192 if (found == fonts_.end()) |
193 { | 193 { |