Mercurial > hg > orthanc-stone
comparison Framework/Viewport/SdlViewport.cpp @ 1315:1a08b779be64 broker
warning 4996 (deprecation in jsoncpp) + indentation changes
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 16 Mar 2020 11:21:13 +0100 |
parents | 3d26447ddd28 |
children | ab81ee8fce1f |
comparison
equal
deleted
inserted
replaced
1314:9b126de2cde2 | 1315:1a08b779be64 |
---|---|
103 { | 103 { |
104 // Make sure that the "OpenGLCompositor" is destroyed BEFORE the | 104 // Make sure that the "OpenGLCompositor" is destroyed BEFORE the |
105 // "OpenGLContext" it references (*) | 105 // "OpenGLContext" it references (*) |
106 ClearCompositor(); | 106 ClearCompositor(); |
107 } | 107 } |
108 | 108 |
109 | |
109 void SdlOpenGLViewport::Paint() | 110 void SdlOpenGLViewport::Paint() |
110 { | 111 { |
111 SdlLock lock(*this); | 112 SdlLock lock(*this); |
112 lock.GetCompositor().Refresh(lock.GetController().GetScene()); | 113 lock.GetCompositor().Refresh(lock.GetController().GetScene()); |
113 } | 114 } |
114 | 115 |
115 void SdlOpenGLViewport::UpdateSize(unsigned int width, | 116 |
116 unsigned int height) | 117 void SdlOpenGLViewport::UpdateSize(unsigned int width, unsigned int height) |
117 { | 118 { |
118 // nothing to do in OpenGL, the OpenGLCompositor::UpdateSize will be called automatically | 119 // nothing to do in OpenGL, the OpenGLCompositor::UpdateSize will be called automatically |
119 SdlLock lock(*this); | 120 SdlLock lock(*this); |
120 lock.Invalidate(); | 121 lock.Invalidate(); |
121 } | 122 } |
122 | 123 |
124 | |
123 void SdlOpenGLViewport::ToggleMaximize() | 125 void SdlOpenGLViewport::ToggleMaximize() |
124 { | 126 { |
125 // No need to call "Invalidate()" here, as "UpdateSize()" will | 127 // No need to call "Invalidate()" here, as "UpdateSize()" will |
126 // be invoked after event "SDL_WINDOWEVENT_SIZE_CHANGED" | 128 // be invoked after event "SDL_WINDOWEVENT_SIZE_CHANGED" |
127 SdlLock lock(*this); | 129 SdlLock lock(*this); |
128 context_.ToggleMaximize(); | 130 context_.ToggleMaximize(); |
129 } | 131 } |
130 | 132 |
133 | |
134 | |
131 SdlCairoViewport::SdlCairoViewport(const char* title, | 135 SdlCairoViewport::SdlCairoViewport(const char* title, |
132 unsigned int width, | 136 unsigned int width, |
133 unsigned int height, | 137 unsigned int height, |
134 bool allowDpiScaling) : | 138 bool allowDpiScaling) : |
135 window_(title, width, height, false /* enable OpenGL */, allowDpiScaling), | 139 window_(title, width, height, false /* enable OpenGL */, allowDpiScaling), |