1

Following is not working.

    GLKView *view = (GLKView *)self.view;
    view.contentScaleFactor=1.0;

logging the view and [UIScreen mainScreen] objects:

<GLKView: 0x15638f60; frame = (0 0; 320 568); autoresize = RM+BM; layer = <CAEAGLLayer: 0x15638960>>
<UIScreen: 0x15629a60; bounds = {{0, 0}, {320, 568}}; mode = <UIScreenMode: 0x15629c40; size = 640.000000 x 1136.000000>>

and [[UIScreen mainScreen] scale]; is still 2.0 not 1.0

Do i need to set scale factor on some other object?

Martin
  • 1,752
  • 2
  • 13
  • 21

1 Answers1

1

[UIScreen mainScreen].scale is the actual scale of the physical device the user is using.

(It is always "2.0" unless you have incredibly old machines. "3.0" machines are coming soon from Apple, 2014 apparently.)

Here's a typical example...

    float isf = 1.0 / [UIScreen mainScreen].scale;

    CGPatternRef strokePattern = CGPatternCreate(
                    NULL,
                    CGRectMake(0,0,wholeWidth,wholeHeight),

                    CGAffineTransformScale(
                        CGAffineTransformIdentity,
                        isf,-isf),

                    wholeWidth,wholeHeight,
                    kCGPatternTilingNoDistortion,
                    true,
                    &kPatternCallbacks);

hope it helps in some way!

Fattie
  • 27,874
  • 70
  • 431
  • 719
  • My problem was poor understanding of the scaling. I thought 2.0 means 1/4 point/pixel when its actually 1/1 and 1.0 is 1/4. – Martin May 18 '14 at 13:34
  • Ill accept your answer since it is the only one :D i usually just delete questions with no replies which is why i have so few :D – Martin May 18 '14 at 13:42