comparison Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp @ 1392:ffdb82850e98

Sdl run loop in /Common (might revert if need to customize) Segregation ongoing between sdl wasm Both samples ok SDL msvc v141 x64
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 28 Apr 2020 13:52:21 +0200
parents 4ebf246f3919
children 62dc0d737e7b
comparison
equal deleted inserted replaced
1391:32272ecfc6c2 1392:ffdb82850e98
115 115
116 application->LoadOrthancFrame(source, instanceId, frameIndex); 116 application->LoadOrthancFrame(source, instanceId, frameIndex);
117 117
118 OrthancStone::DefaultViewportInteractor interactor; 118 OrthancStone::DefaultViewportInteractor interactor;
119 119
120 #if 1
121 OrthancStoneHelpers::SdlRunLoop(viewport, interactor);
122
123 #else
124
120 { 125 {
121 int scancodeCount = 0; 126 int scancodeCount = 0;
122 const uint8_t* keyboardState = SDL_GetKeyboardState(&scancodeCount); 127 const uint8_t* keyboardState = SDL_GetKeyboardState(&scancodeCount);
123 128
124 bool stop = false; 129 bool stop = false;
216 221
217 // Small delay to avoid using 100% of CPU 222 // Small delay to avoid using 100% of CPU
218 SDL_Delay(1); 223 SDL_Delay(1);
219 } 224 }
220 } 225 }
221 226 #endif
222 context.StopOracle(); 227 context.StopOracle();
223 } 228 }
224 } 229 }
225 230
226 OrthancStone::StoneFinalize(); 231 OrthancStone::StoneFinalize();