[android] detect size

This commit is contained in:
Lucas Baudin 2016-02-26 18:01:51 +01:00
parent 6dc2752c81
commit e9657beaa6

View File

@ -256,6 +256,16 @@ namespace video
genericDriverInit(params.WindowSize, params.Stencilbuffer);
#ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
int backingWidth;
int backingHeight;
eglQuerySurface(EglDisplay, EglSurface, EGL_WIDTH, &backingWidth);
eglQuerySurface(EglDisplay, EglSurface, EGL_HEIGHT, &backingHeight);
core::dimension2d<u32> WindowSize(backingWidth, backingHeight);
CNullDriver::ScreenSize = WindowSize;
#endif
// set vsync
if (params.Vsync)
eglSwapInterval(EglDisplay, 1);
@ -268,7 +278,7 @@ namespace video
ExposedData.OGLESIPhone.AppDelegate = Device;
Device->displayInitialize(&ExposedData.OGLESIPhone.Context, &ExposedData.OGLESIPhone.View);
#endif
GLint backingWidth;
GLint backingHeight;
glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &backingWidth);