Recent

Author Topic: OpenGL and NSScreen.mainScreen.backingScaleFactor  (Read 389 times)

Key-Real

  • Full Member
  • ***
  • Posts: 242
OpenGL and NSScreen.mainScreen.backingScaleFactor
« on: February 06, 2024, 10:29:19 pm »
I init openGL

now i wanna set
Code: Pascal  [Select][+][-]
  1. glPixelZoom(pixelSizeX, -pixelSizeY);
to dispaly a image with width and height to the entire window

for this I do:
Code: Pascal  [Select][+][-]
  1.     rect:= window.frame;
  2.     WindowBackingRect :=  window.convertRectToBacking(rect);
  3.  
  4.   pixelSizeX :=  WindowBackingRect.size.width / width / NSScreen.mainScreen.backingScaleFactor;
  5.   pixelSizeY :=  WindowBackingRect.size.height / height / NSScreen.mainScreen.backingScaleFactor;
  6.  

under High Sierra 10.13.6 on an intel mac from 2011 NSScreen.mainScreen.backingScaleFactor return 1 because there is no retina.
under Sonoma 14.3 an an intel mac from 2020 NSScreen.mainScreen.backingScaleFactor return 2 because of retina.
this works correct.

under Venture 13.6 on an aarch64 mac from 2020 NSScreen.mainScreen.backingScaleFactor returns 2 BUT the image is only half so big as it should be.

(if i let the scale factor away on the new intel mac, the image is twice big as it should be. On the new AArch64 mac it is correct.)

what to do?
« Last Edit: February 07, 2024, 12:21:49 am by Key-Real »

 

TinyPortal © 2005-2018