Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions samples-android/Common/ndk_helper/GLContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,6 @@ bool GLContext::InitEGLSurface() {
eglQuerySurface(display_, surface_, EGL_WIDTH, &screen_width_);
eglQuerySurface(display_, surface_, EGL_HEIGHT, &screen_height_);

/* EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is
* guaranteed to be accepted by ANativeWindow_setBuffersGeometry().
* As soon as we picked a EGLConfig, we can safely reconfigure the
* ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID. */
EGLint format;
eglGetConfigAttrib(display_, config_, EGL_NATIVE_VISUAL_ID, &format);
ANativeWindow_setBuffersGeometry(window_, 0, 0, format);

return true;
}

Expand Down
10 changes: 1 addition & 9 deletions samples-android/Minimalist/src/main/jni/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static int engine_init_display(struct engine* engine) {
const EGLint attribs[] = {EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_BLUE_SIZE,
8, EGL_GREEN_SIZE, 8,
EGL_RED_SIZE, 8, EGL_NONE};
EGLint w, h, dummy, format;
EGLint w, h, dummy;
EGLint numConfigs;
EGLConfig config;
EGLSurface surface;
Expand All @@ -109,14 +109,6 @@ static int engine_init_display(struct engine* engine) {
* the first EGLConfig that matches our criteria */
eglChooseConfig(display, attribs, &config, 1, &numConfigs);

/* EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is
* guaranteed to be accepted by ANativeWindow_setBuffersGeometry().
* As soon as we picked a EGLConfig, we can safely reconfigure the
* ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID. */
eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &format);

ANativeWindow_setBuffersGeometry(engine->app->window, 0, 0, format);

surface = eglCreateWindowSurface(display, config, engine->app->window, NULL);
context = eglCreateContext(display, config, NULL, NULL);

Expand Down