Fix bug in native activity demo.

Can't get surface size until after it is made current.

Change-Id: I34847775bde680d05767b6b4cfa8e547eb56aa6d
This commit is contained in:
Dianne Hackborn
2010-10-19 18:36:53 -07:00
parent 92df1283f7
commit 834eb602eb

View File

@@ -74,14 +74,15 @@ static int engine_init_display(struct engine* engine) {
selectConfigForNativeWindow(display, attribs, engine->app->window, &config);
surface = eglCreateWindowSurface(display, config, engine->app->window, NULL);
context = eglCreateContext(display, config, NULL, NULL);
eglQuerySurface(display, surface, EGL_WIDTH, &w);
eglQuerySurface(display, surface, EGL_HEIGHT, &h);
if (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE) {
LOGW("Unable to eglMakeCurrent");
return -1;
}
eglQuerySurface(display, surface, EGL_WIDTH, &w);
eglQuerySurface(display, surface, EGL_HEIGHT, &h);
engine->display = display;
engine->context = context;
engine->surface = surface;