Mercurial > hg > orthanc-stone
annotate Applications/Resources/Graveyard/Threading/SdlBuffering.h @ 2012:637d6373127a
width of the vertical slider has doubled to ease user interactions
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 02 Dec 2022 18:49:06 +0100 |
parents | 7053b8a0aaec |
children | 07964689cb0b |
rev | line source |
---|---|
0 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
1871
7053b8a0aaec
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1870
diff
changeset
|
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium |
7053b8a0aaec
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1870
diff
changeset
|
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
0 | 7 * |
8 * This program is free software: you can redistribute it and/or | |
47 | 9 * modify it under the terms of the GNU Affero General Public License |
10 * as published by the Free Software Foundation, either version 3 of | |
11 * the License, or (at your option) any later version. | |
0 | 12 * |
13 * This program is distributed in the hope that it will be useful, but | |
14 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
47 | 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 * Affero General Public License for more details. | |
1596
4fb8fdf03314
removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1586
diff
changeset
|
17 * |
47 | 18 * You should have received a copy of the GNU Affero General Public License |
0 | 19 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 **/ | |
21 | |
22 | |
23 #pragma once | |
24 | |
25 #if ORTHANC_ENABLE_SDL == 1 | |
26 | |
27 #include "SdlWindow.h" | |
51 | 28 #include "../../Framework/Viewport/CairoSurface.h" |
29 #include "../../Framework/Viewport/IViewport.h" | |
0 | 30 |
31 #include <boost/thread/mutex.hpp> | |
32 | |
33 namespace OrthancStone | |
34 { | |
35 class SdlBuffering : public boost::noncopyable | |
36 { | |
37 private: | |
38 boost::mutex mutex_; | |
1298
8a0a62189f46
replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1270
diff
changeset
|
39 std::unique_ptr<CairoSurface> offscreenSurface_; |
8a0a62189f46
replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1270
diff
changeset
|
40 std::unique_ptr<CairoSurface> onscreenSurface_; |
0 | 41 SDL_Surface* sdlSurface_; |
42 bool pendingFrame_; | |
43 | |
44 public: | |
45 SdlBuffering(); | |
46 | |
47 ~SdlBuffering(); | |
48 | |
49 void SetSize(unsigned int width, | |
50 unsigned int height, | |
51 IViewport& viewport); | |
52 | |
53 // Returns "true" if a new refresh of the display should be | |
54 // triggered afterwards | |
55 bool RenderOffscreen(IViewport& viewport); | |
56 | |
57 void SwapToScreen(SdlWindow& window); | |
58 }; | |
59 } | |
60 | |
61 #endif |