Fix default windows size and height in iOS
This commit is contained in:
parent
e722d4a0e5
commit
dbb14a2861
@ -368,6 +368,20 @@ namespace irr
|
|||||||
|
|
||||||
FileSystem->changeWorkingDirectoryTo([[[NSBundle mainBundle] resourcePath] UTF8String]);
|
FileSystem->changeWorkingDirectoryTo([[[NSBundle mainBundle] resourcePath] UTF8String]);
|
||||||
|
|
||||||
|
if (VideoModeList.getVideoModeCount() == 0)
|
||||||
|
{
|
||||||
|
// Add current screen size
|
||||||
|
CGRect screen_bounds = [[UIScreen mainScreen] nativeBounds];
|
||||||
|
// nativeBounds is the size in a portrait-up orientation, so reverse width and height
|
||||||
|
core::dimension2du screen_size =
|
||||||
|
{
|
||||||
|
(u32)screen_bounds.size.height,
|
||||||
|
(u32)screen_bounds.size.width
|
||||||
|
};
|
||||||
|
VideoModeList.addMode(screen_size, 32);
|
||||||
|
VideoModeList.setDesktop(32, screen_size);
|
||||||
|
|
||||||
|
}
|
||||||
createWindow();
|
createWindow();
|
||||||
createViewAndDriver();
|
createViewAndDriver();
|
||||||
|
|
||||||
|
@ -337,10 +337,13 @@ void IrrDriver::createListOfVideoModes()
|
|||||||
{
|
{
|
||||||
const int w = modes->getVideoModeResolution(i).Width;
|
const int w = modes->getVideoModeResolution(i).Width;
|
||||||
const int h = modes->getVideoModeResolution(i).Height;
|
const int h = modes->getVideoModeResolution(i).Height;
|
||||||
|
#ifndef IOS_STK
|
||||||
|
// IOS returns the nativebounds in non uniform size
|
||||||
if ((h < MIN_SUPPORTED_HEIGHT || w < MIN_SUPPORTED_WIDTH) &&
|
if ((h < MIN_SUPPORTED_HEIGHT || w < MIN_SUPPORTED_WIDTH) &&
|
||||||
(!(h==600 && w==800 && UserConfigParams::m_artist_debug_mode) &&
|
(!(h==600 && w==800 && UserConfigParams::m_artist_debug_mode) &&
|
||||||
(!(h==720 && w==1280 && ALLOW_1280_X_720 == true))))
|
(!(h==720 && w==1280 && ALLOW_1280_X_720 == true))))
|
||||||
continue;
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
VideoMode mode(w, h);
|
VideoMode mode(w, h);
|
||||||
m_modes.push_back( mode );
|
m_modes.push_back( mode );
|
||||||
|
Loading…
Reference in New Issue
Block a user