[android] Use CIrrDeviceAndroid before the console device…

This commit is contained in:
Lucas Baudin
2016-02-25 20:38:50 +01:00
parent e39efc128c
commit f91426d748
2 changed files with 10 additions and 8 deletions

View File

@@ -104,17 +104,19 @@ namespace irr
dev = new CIrrDeviceFB(params);
#endif
#ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
__android_log_print(ANDROID_LOG_VERBOSE, "native-activity", "%s %d", __FILE__, __LINE__);
if (params.DeviceType == EIDT_ANDROID || (!dev && params.DeviceType == EIDT_BEST)) {
__android_log_print(ANDROID_LOG_VERBOSE, "native-activity", "%s %d", __FILE__, __LINE__);
dev = new CIrrDeviceAndroid(params);
}
#endif
#ifdef _IRR_COMPILE_WITH_CONSOLE_DEVICE_
if (params.DeviceType == EIDT_CONSOLE || (!dev && params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceConsole(params);
#endif
#ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
if (params.DeviceType == EIDT_ANDROID || (!dev && params.DeviceType == EIDT_BEST)) {
dev = new CIrrDeviceAndroid(params);
}
#endif
if (dev && !dev->getVideoDriver() && params.DriverType != video::EDT_NULL)
{
dev->closeDevice(); // destroy window

View File

@@ -440,7 +440,7 @@ void IrrDriver::initDevice()
Log::verbose("irr_driver", "Trying to create device with "
"%i bits\n", bits);
#ifdef ANDROID_DEVICE
#ifndef ANDROID_DEVICE
params.DriverType = video::EDT_OPENGL;
#else
params.DriverType = video::EDT_OGLES2;
@@ -491,7 +491,7 @@ void IrrDriver::initDevice()
UserConfigParams::m_width = MIN_SUPPORTED_WIDTH;
UserConfigParams::m_height = MIN_SUPPORTED_HEIGHT;
#ifdef ANDROID_DEVICE
#ifndef ANDROID_DEVICE
m_device = createDevice(video::EDT_OPENGL,
#else
m_device = createDevice(video::EDT_OGLES2,