Skip to content

Commit e6afac8

Browse files
committed
Update rcore_ios.c
1 parent ee2a307 commit e6afac8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/platforms/rcore_ios.c

+11-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,9 @@ Vector2 GetWindowPosition(void)
293293
// Get window scale DPI factor for current monitor
294294
Vector2 GetWindowScaleDPI(void)
295295
{
296-
return (Vector2){ 1.0f, 1.0f };
296+
CGFloat scale = [[UIScreen mainScreen] scale];
297+
return (Vector2){ scale, scale };
298+
// return (Vector2){ 1.0f, 1.0f };
297299
}
298300

299301
// Set clipboard text content
@@ -595,6 +597,13 @@ int InitPlatform(void)
595597
//----------------------------------------------------------------------------
596598
// ...
597599
//----------------------------------------------------------------------------
600+
// Initialize OpenGL context (states and resources)
601+
// NOTE: CORE.Window.currentFbo.width and CORE.Window.currentFbo.height not used, just stored as globals in rlgl
602+
rlglInit(CORE.Window.currentFbo.width, CORE.Window.currentFbo.height);
603+
604+
// Setup default viewport
605+
// NOTE: It updated CORE.Window.render.width and CORE.Window.render.height
606+
SetupViewport(CORE.Window.currentFbo.width, CORE.Window.currentFbo.height);
598607

599608
// TODO: Initialize timing system
600609
//----------------------------------------------------------------------------
@@ -647,6 +656,7 @@ void ClosePlatform(void)
647656
// self.modalPresentationCapturesStatusBarAppearance = true;
648657
platform.viewController = self;
649658
self.view.multipleTouchEnabled = true;
659+
self.view.contentScaleFactor = [[UIScreen mainScreen] scale];
650660
}
651661

652662
- (bool)prefersStatusBarHidden

0 commit comments

Comments
 (0)