MCPcopy Create free account
hub / github.com/android/ndk-samples / Update

Method Update

native-activity/app/src/main/cpp/main.cpp:176–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174 }
175
176 void Update() {
177 auto now = std::chrono::steady_clock::now();
178 if (now - last_update_ > 1s) {
179 switch (color_) {
180 case Color::kRed:
181 color_ = Color::kGreen;
182 break;
183 case Color::kGreen:
184 color_ = Color::kBlue;
185 break;
186 case Color::kBlue:
187 color_ = Color::kRed;
188 break;
189 default:
190 fatal("unexpected color %08x", static_cast<uint32_t>(color_));
191 }
192 last_update_ = now;
193 }
194 }
195
196 void DrawFrame() const {
197 if (app_->window == nullptr) {

Callers

nothing calls this directly

Calls 1

fatalFunction · 0.85

Tested by

no test coverage detected