comparison Applications/Sdl/SdlEngine.cpp @ 61:ca644004d2ee wasm

MAJOR - removal of Start/Stop and observers in IWidget
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 May 2017 17:55:13 +0200
parents 9e3c2e75b870
children a4497c6449df
comparison
equal deleted inserted replaced
60:288c948199e5 61:ca644004d2ee
103 window_(window), 103 window_(window),
104 context_(context), 104 context_(context),
105 surface_(window), 105 surface_(window),
106 viewportChanged_(true) 106 viewportChanged_(true)
107 { 107 {
108 }
109
110
111 SdlEngine::~SdlEngine()
112 {
113 }
114
115
116 void SdlEngine::Run()
117 {
118 int scancodeCount = 0;
119 const uint8_t* keyboardState = SDL_GetKeyboardState(&scancodeCount);
120
108 { 121 {
109 BasicApplicationContext::ViewportLocker locker(context_); 122 BasicApplicationContext::ViewportLocker locker(context_);
110 SetSize(locker, window_.GetWidth(), window_.GetHeight()); 123 SetSize(locker, window_.GetWidth(), window_.GetHeight());
111 locker.GetViewport().Register(*this); 124 locker.GetViewport().SetDefaultView();
112 } 125 }
113 } 126
114
115
116 SdlEngine::~SdlEngine()
117 {
118 {
119 BasicApplicationContext::ViewportLocker locker(context_);
120 locker.GetViewport().Unregister(*this);
121 }
122 }
123
124
125 void SdlEngine::Run()
126 {
127 int scancodeCount = 0;
128 const uint8_t* keyboardState = SDL_GetKeyboardState(&scancodeCount);
129
130 bool stop = false; 127 bool stop = false;
131 while (!stop) 128 while (!stop)
132 { 129 {
133 RenderFrame(); 130 RenderFrame();
134 131
248 break; 245 break;
249 } 246 }
250 } 247 }
251 } 248 }
252 } 249 }
250
251 printf("BYE\n"); fflush(stdout);
253 } 252 }
254 253
255 254
256 void SdlEngine::GlobalInitialize() 255 void SdlEngine::GlobalInitialize()
257 { 256 {