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

Method DrawFrame

teapots/image-decoder/src/main/cpp/TeapotNativeActivity.cpp:167–184  ·  view source on GitHub ↗

* Just the current frame in the display. */

Source from the content-addressed store, hash-verified

165 * Just the current frame in the display.
166 */
167void Engine::DrawFrame() {
168 float fps;
169 if (monitor_.Update(fps)) {
170 UpdateFPS(fps);
171 }
172 renderer_.Update(monitor_.GetCurrentTime());
173
174 // Just fill the screen with a color.
175 glClearColor(0.5f, 0.5f, 0.5f, 1.f);
176 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
177 renderer_.Render();
178
179 // Swap
180 if (EGL_SUCCESS != gl_context_->Swap()) {
181 UnloadResources();
182 LoadResources();
183 }
184}
185
186/**
187 * Tear down the EGL context currently associated with the display.

Callers 2

HandleCmdMethod · 0.45
android_mainFunction · 0.45

Calls 4

UpdateMethod · 0.45
GetCurrentTimeMethod · 0.45
RenderMethod · 0.45
SwapMethod · 0.45

Tested by

no test coverage detected