aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2022-10-15 16:54:42 +0200
committerAndre Weissflog <floooh@gmail.com>2022-10-15 16:54:42 +0200
commitcf61d7d1237950d75ebf3111ba5d394ba776c704 (patch)
treebfc76f752d849dbbdc23d027cdab47a45bea9169
parentab4418163a21149664cc774f13371ab1eae11721 (diff)
sokol_app.h iOS: undo a18031313cdf7dab461baa296c38b07337ab4d47 (see #645 and #726)
-rw-r--r--sokol_app.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/sokol_app.h b/sokol_app.h
index cf17c1df..5d70a246 100644
--- a/sokol_app.h
+++ b/sokol_app.h
@@ -4180,11 +4180,6 @@ _SOKOL_PRIVATE void _sapp_ios_update_dimensions(void) {
(_sapp.framebuffer_height != cur_fb_height);
if (dim_changed) {
#if defined(SOKOL_METAL)
- // NOTE: explicitely resize the drawable here again, despite MTKView using
- // autoResizeDrawable, this seems to be the only way so that the MTKView's
- // contentScaleFactor is honored, but also the correct screen size being
- // reported when device rotations happen
- // (see: https://github.com/floooh/sokol-samples/issues/101)
const CGSize drawable_size = { (CGFloat) _sapp.framebuffer_width, (CGFloat) _sapp.framebuffer_height };
_sapp.ios.view.drawableSize = drawable_size;
#else
@@ -4258,6 +4253,11 @@ _SOKOL_PRIVATE void _sapp_ios_show_keyboard(bool shown) {
_sapp.ios.view.colorPixelFormat = MTLPixelFormatBGRA8Unorm;
_sapp.ios.view.depthStencilPixelFormat = MTLPixelFormatDepth32Float_Stencil8;
_sapp.ios.view.sampleCount = (NSUInteger)_sapp.sample_count;
+ /* NOTE: iOS MTKView seems to ignore thew view's contentScaleFactor
+ and automatically renders at Retina resolution. We'll disable
+ autoResize and instead do the resizing in _sapp_ios_update_dimensions()
+ */
+ _sapp.ios.view.autoResizeDrawable = false;
_sapp.ios.view.userInteractionEnabled = YES;
_sapp.ios.view.multipleTouchEnabled = YES;
_sapp.ios.view_ctrl = [[UIViewController alloc] init];