Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Platforms/Sdl/SdlWindow.h @ 1899:917500c46fe0
moved the Platform folder from the Applications folder to the Stone library itself
author | Alain Mazy <am@osimis.io> |
---|---|
date | Sat, 29 Jan 2022 12:47:32 +0100 |
parents | |
children | 07964689cb0b |
comparison
equal
deleted
inserted
replaced
1898:a5e54bd87b25 | 1899:917500c46fe0 |
---|---|
1 /** | |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium | |
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium | |
7 * | |
8 * This program is free software: you can redistribute it and/or | |
9 * modify it under the terms of the GNU Lesser 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. | |
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 | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 * Lesser General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU Lesser General Public | |
19 * License along with this program. If not, see | |
20 * <http://www.gnu.org/licenses/>. | |
21 **/ | |
22 | |
23 | |
24 #pragma once | |
25 | |
26 #if ORTHANC_ENABLE_SDL == 1 | |
27 | |
28 #include <boost/noncopyable.hpp> | |
29 #include <string> | |
30 | |
31 // Forward declaration of SDL type to avoid clashes with DCMTK headers | |
32 // on "typedef Sint8", in "StoneInitialization.cpp" | |
33 struct SDL_Window; | |
34 struct SDL_Renderer; | |
35 struct SDL_Surface; | |
36 | |
37 namespace OrthancStone | |
38 { | |
39 class SdlWindow : public boost::noncopyable | |
40 { | |
41 private: | |
42 struct SDL_Window *window_; | |
43 struct SDL_Renderer *renderer_; | |
44 bool maximized_; | |
45 | |
46 public: | |
47 SdlWindow(const std::string& title, | |
48 unsigned int width, | |
49 unsigned int height, | |
50 bool enableOpenGl, | |
51 bool allowDpiScaling = true); | |
52 | |
53 ~SdlWindow(); | |
54 | |
55 SDL_Window *GetObject() const | |
56 { | |
57 return window_; | |
58 } | |
59 | |
60 unsigned int GetWidth() const; | |
61 | |
62 unsigned int GetHeight() const; | |
63 | |
64 /** | |
65 * WARNING: "Refresh()" cannot only be called from the main SDL | |
66 * thread, in which the window was created. Otherwise, the | |
67 * renderer displays nothing! | |
68 **/ | |
69 void Render(struct SDL_Surface* surface); | |
70 | |
71 void ToggleMaximize(); | |
72 | |
73 static void GlobalInitialize(); | |
74 | |
75 static void GlobalFinalize(); | |
76 }; | |
77 } | |
78 | |
79 #endif |