Skip to content

Commit

Permalink
Update iOSWindow.mm
Browse files Browse the repository at this point in the history
Creating two global variables that represent the resolution of the iOS device
  • Loading branch information
3dDeters committed Jul 2, 2016
1 parent 4fd6365 commit 51f13bc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion engine/source/platformiOS/iOSWindow.mm
Expand Up @@ -121,6 +121,13 @@
//------------------------------------------------------------------------------
void Platform::init()
{
// Create two variables that I use later to make the canvas the right size
CGRect screenBounds = [[UIScreen mainScreen] bounds];
CGFloat screenScale = [[UIScreen mainScreen] scale];

Con::setFloatVariable("$iOSwidth", screenBounds.size.width * screenScale);
Con::setFloatVariable("$iOSheight", screenBounds.size.height * screenScale);

Con::setVariable("$platform", "iOS");

if ([[UIScreen mainScreen] scale] == 2)
Expand Down Expand Up @@ -444,4 +451,4 @@ bool setScreenOrientation(bool portrait, bool upsidedown)

ConsoleFunction(setStatusBarType, void, 2, 2, " Set the status bar type. 0 hidden, 1 Black Opaque, 2 Black Translucent \n"){
return setStatusBarType(dAtoi(argv[1]));
}
}

0 comments on commit 51f13bc

Please sign in to comment.