Mercurial > hg > orthanc-stone
comparison Framework/Viewport/SdlViewport.cpp @ 1311:3d26447ddd28 broker
warning fixes + doc + indentation + header files in cmake for VC++ sln browsing
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 09 Mar 2020 14:55:22 +0100 |
parents | 8a28a9bf8876 |
children | 1a08b779be64 |
comparison
equal
deleted
inserted
replaced
1310:9bea7e15b519 | 1311:3d26447ddd28 |
---|---|
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 | |
110 void SdlOpenGLViewport::Paint() | 109 void SdlOpenGLViewport::Paint() |
111 { | 110 { |
112 SdlLock lock(*this); | 111 SdlLock lock(*this); |
113 lock.GetCompositor().Refresh(lock.GetController().GetScene()); | 112 lock.GetCompositor().Refresh(lock.GetController().GetScene()); |
114 } | 113 } |
115 | 114 |
116 | 115 void SdlOpenGLViewport::UpdateSize(unsigned int width, |
117 void SdlOpenGLViewport::UpdateSize(unsigned int width, | |
118 unsigned int height) | 116 unsigned int height) |
119 { | 117 { |
120 // nothing to do in OpenGL, the OpenGLCompositor::UpdateSize will be called automatically | 118 // nothing to do in OpenGL, the OpenGLCompositor::UpdateSize will be called automatically |
121 SdlLock lock(*this); | 119 SdlLock lock(*this); |
122 lock.Invalidate(); | 120 lock.Invalidate(); |
123 } | 121 } |
124 | 122 |
125 | |
126 void SdlOpenGLViewport::ToggleMaximize() | 123 void SdlOpenGLViewport::ToggleMaximize() |
127 { | 124 { |
128 // No need to call "Invalidate()" here, as "UpdateSize()" will | 125 // No need to call "Invalidate()" here, as "UpdateSize()" will |
129 // be invoked after event "SDL_WINDOWEVENT_SIZE_CHANGED" | 126 // be invoked after event "SDL_WINDOWEVENT_SIZE_CHANGED" |
130 SdlLock lock(*this); | 127 SdlLock lock(*this); |
131 context_.ToggleMaximize(); | 128 context_.ToggleMaximize(); |
132 } | 129 } |
133 | 130 |
134 | |
135 | |
136 SdlCairoViewport::SdlCairoViewport(const char* title, | 131 SdlCairoViewport::SdlCairoViewport(const char* title, |
137 unsigned int width, | 132 unsigned int width, |
138 unsigned int height, | 133 unsigned int height, |
139 bool allowDpiScaling) : | 134 bool allowDpiScaling) : |
140 window_(title, width, height, false /* enable OpenGL */, allowDpiScaling), | 135 window_(title, width, height, false /* enable OpenGL */, allowDpiScaling), |