Mercurial > hg > orthanc-stone
annotate Applications/Sdl/SdlOpenGLWindow.h @ 625:2eeb5857eb43
DicomInstanceParameters
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 07 May 2019 18:11:52 +0200 |
parents | b4de8272e8fb |
children | 002d9562c8f5 |
rev | line source |
---|---|
595
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Stone of Orthanc |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Affero General Public License |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * the License, or (at your option) any later version. |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, but |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * WITHOUT ANY WARRANTY; without even the implied warranty of |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * Affero General Public License for more details. |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Affero General Public License |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 **/ |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 #pragma once |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 #if ORTHANC_ENABLE_SDL == 1 |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 #include "../../Framework/OpenGL/IOpenGLContext.h" |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 #include "SdlWindow.h" |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 namespace OrthancStone |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 { |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 class SdlOpenGLWindow : public OpenGL::IOpenGLContext |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 { |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 private: |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 SdlWindow window_; |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 SDL_GLContext context_; |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 public: |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 SdlOpenGLWindow(const char* title, |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 unsigned int width, |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 unsigned int height); |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 ~SdlOpenGLWindow(); |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 SdlWindow& GetWindow() |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 { |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 return window_; |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 } |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 virtual void MakeCurrent(); |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 virtual void SwapBuffer(); |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 |
615 | 53 virtual unsigned int GetCanvasWidth() const; |
595
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 |
615 | 55 virtual unsigned int GetCanvasHeight() const; |
595
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 }; |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 } |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 |
6e471e6cf09b
CairoPolylineRenderer, SdlOpenGLWindow
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 #endif |