![Smile :)](./images/smilies/icon_smile.gif)
Nadro, you published games that use irrlicht on Google Play, right? Can you share with us your way to get the screen resolution when creating the device in jni?
Code: Select all
while( IsReady == false )
Code: Select all
// Check if screen dimension is set. If not, use size of Android->window.
DeviceWidth = (DeviceWidth > 0) ? DeviceWidth : ANativeWindow_getWidth(Android->window);
DeviceHeight = (DeviceHeight > 0) ? DeviceHeight : ANativeWindow_getHeight(Android->window);
Code: Select all
SIrrlichtCreationParameters param;
param.DriverType = EDT_OGLES2;
param.WindowSize = dimension2d<u32>(320, 240);
param.PrivateData = app;
param.Bits = 24;
param.ZBufferBits = 16;
param.AntiAlias = 0;
device = createDeviceEx(param);
int w= ANativeWindow_getWidth(app->window);
int h= ANativeWindow_getHeight(app->window);
device->closeDevice();
param.WindowSize = dimension2d<u32>(w, h);
device = createDeviceEx(param);
Code: Select all
DeviceWidth = (DeviceWidth > 0) ? DeviceWidth : ANativeWindow_getWidth(Android->window);
DeviceHeight = (DeviceHeight > 0) ? DeviceHeight : ANativeWindow_getHeight(Android->window);
CreationParams.WindowSize.Width= DeviceWidth;
CreationParams.WindowSize.Height= DeviceHeight;
Code: Select all
android_app* state;
...
static void engine_handle_cmd(struct android_app* app, int32_t cmd)
{
//handle command here
}
...
state->onAppCmd = engine_handle_cmd;
Nice! Keep up the good workNadro wrote:@ent1ty
Both OpenGL 3.3 and ES3.0 should be available before end of this year in shader-pipeline branch.
Nadro wrote: @penguin03
What about context lost on Android? Android 4.0+ is able to hold context, for older Android versions you have to recreate data manually as ent1ty.
Yeah, same on Nexus 7 with android 4.3penguin03 wrote:The OpenGL es context holding depends on Hardware driver. Not all Android 4.0 + device can support it. I use Samsung Galaxy Note II to test the the HelloMobile sample, it can't support it, its Android version is 4.1.2.