Quote: "Any thoughts on the framebuffer thing I posted about earlier, to make games run faster on Ouya?"
I ran some tests and it looks like you can do this in NDK, but I wasn't sure if it would work on all devices so it isn't active in 108. If you want to experiment with it you will need to edit the interpreter_android/jni/main.c file and recompile it.
Firstly find the section of code that looks like this
//eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &format);
//int result = ANativeWindow_setBuffersGeometry(engine->app->window, 640, 480, 0);
//LOGW( "Result: %d", result );
surface = eglCreateWindowSurface(display, config, engine->app->window, NULL);
while ( surface == EGL_NO_SURFACE )
{
LOGW( "Failed to create EGL surface: %d, trying different format", eglGetError() );
formatIndex++;
if ( formatIndex >= numConfigs || formatIndex > 19 )
{
LOGW( "Failed to find compatible format" );
return -1;
}
config = allConfigs[ formatIndex ];
surface = eglCreateWindowSurface(display, config, engine->app->window, NULL);
}
/* 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);
int result = ANativeWindow_setBuffersGeometry(engine->app->window, 0, 0, format);
LOGW( "Result: %d", result );
and edit it so it looks like this
eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &format);
int result = ANativeWindow_setBuffersGeometry(engine->app->window, 640, 480, format);
LOGW( "Result: %d", result );
surface = eglCreateWindowSurface(display, config, engine->app->window, NULL);
while ( surface == EGL_NO_SURFACE )
{
LOGW( "Failed to create EGL surface: %d, trying different format", eglGetError() );
formatIndex++;
if ( formatIndex >= numConfigs || formatIndex > 19 )
{
LOGW( "Failed to find compatible format" );
return -1;
}
config = allConfigs[ formatIndex ];
surface = eglCreateWindowSurface(display, config, engine->app->window, NULL);
}
/* 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);
//int result = ANativeWindow_setBuffersGeometry(engine->app->window, 0, 0, format);
//LOGW( "Result: %d", result );
where 640, 480 is the size of frame buffer that you want. Note that there may be limits on the acceptable frame buffer size, like multiples of 8, I haven't tested enough to know the limits.