Skip to content

Commit

Permalink
Update rcore_ios.c
Browse files Browse the repository at this point in the history
  • Loading branch information
blueloveTH committed Mar 27, 2024
1 parent ee2a307 commit e6afac8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/platforms/rcore_ios.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ Vector2 GetWindowPosition(void)
// Get window scale DPI factor for current monitor
Vector2 GetWindowScaleDPI(void)
{
return (Vector2){ 1.0f, 1.0f };
CGFloat scale = [[UIScreen mainScreen] scale];
return (Vector2){ scale, scale };
// return (Vector2){ 1.0f, 1.0f };
}

// Set clipboard text content
Expand Down Expand Up @@ -595,6 +597,13 @@ int InitPlatform(void)
//----------------------------------------------------------------------------
// ...
//----------------------------------------------------------------------------
// Initialize OpenGL context (states and resources)
// NOTE: CORE.Window.currentFbo.width and CORE.Window.currentFbo.height not used, just stored as globals in rlgl
rlglInit(CORE.Window.currentFbo.width, CORE.Window.currentFbo.height);

// Setup default viewport
// NOTE: It updated CORE.Window.render.width and CORE.Window.render.height
SetupViewport(CORE.Window.currentFbo.width, CORE.Window.currentFbo.height);

// TODO: Initialize timing system
//----------------------------------------------------------------------------
Expand Down Expand Up @@ -647,6 +656,7 @@ void ClosePlatform(void)
// self.modalPresentationCapturesStatusBarAppearance = true;
platform.viewController = self;
self.view.multipleTouchEnabled = true;
self.view.contentScaleFactor = [[UIScreen mainScreen] scale];
}

- (bool)prefersStatusBarHidden
Expand Down

0 comments on commit e6afac8

Please sign in to comment.