comparison Applications/Sdl/SdlEngine.cpp @ 293:017044be141b am-2

renaming
author am@osimis.io
date Thu, 30 Aug 2018 17:15:22 +0200
parents dc1beee33134
children 8716176ff7f0
comparison
equal deleted inserted replaced
292:df5011cf903c 293:017044be141b
39 39
40 void SdlEngine::RenderFrame() 40 void SdlEngine::RenderFrame()
41 { 41 {
42 if (viewportChanged_) 42 if (viewportChanged_)
43 { 43 {
44 BasicNativeApplicationContext::GlobalMutexLocker locker(context_); 44 NativeStoneApplicationContext::GlobalMutexLocker locker(context_);
45 surface_.Render(context_.GetCentralViewport()); 45 surface_.Render(context_.GetCentralViewport());
46 46
47 viewportChanged_ = false; 47 viewportChanged_ = false;
48 } 48 }
49 } 49 }
96 return static_cast<KeyboardModifiers>(result); 96 return static_cast<KeyboardModifiers>(result);
97 } 97 }
98 98
99 99
100 SdlEngine::SdlEngine(SdlWindow& window, 100 SdlEngine::SdlEngine(SdlWindow& window,
101 BasicNativeApplicationContext& context) : 101 NativeStoneApplicationContext& context) :
102 window_(window), 102 window_(window),
103 context_(context), 103 context_(context),
104 surface_(window), 104 surface_(window),
105 viewportChanged_(true) 105 viewportChanged_(true)
106 { 106 {
116 { 116 {
117 int scancodeCount = 0; 117 int scancodeCount = 0;
118 const uint8_t* keyboardState = SDL_GetKeyboardState(&scancodeCount); 118 const uint8_t* keyboardState = SDL_GetKeyboardState(&scancodeCount);
119 119
120 { 120 {
121 BasicNativeApplicationContext::GlobalMutexLocker locker(context_); 121 NativeStoneApplicationContext::GlobalMutexLocker locker(context_);
122 SetSize(window_.GetWidth(), window_.GetHeight()); 122 SetSize(window_.GetWidth(), window_.GetHeight());
123 context_.GetCentralViewport().SetDefaultView(); 123 context_.GetCentralViewport().SetDefaultView();
124 } 124 }
125 125
126 bool stop = false; 126 bool stop = false;
131 SDL_Event event; 131 SDL_Event event;
132 132
133 while (!stop && 133 while (!stop &&
134 SDL_PollEvent(&event)) 134 SDL_PollEvent(&event))
135 { 135 {
136 BasicNativeApplicationContext::GlobalMutexLocker locker(context_); 136 NativeStoneApplicationContext::GlobalMutexLocker locker(context_);
137 137
138 if (event.type == SDL_QUIT) 138 if (event.type == SDL_QUIT)
139 { 139 {
140 stop = true; 140 stop = true;
141 break; 141 break;