Forum > macOS / Mac OS X

OpenGL and NSScreen.mainScreen.backingScaleFactor

(1/1)

Key-Real:
I init openGL

now i wanna set

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---glPixelZoom(pixelSizeX, -pixelSizeY); to dispaly a image with width and height to the entire window

for this I do:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---    rect:= window.frame;    WindowBackingRect :=  window.convertRectToBacking(rect);   pixelSizeX :=  WindowBackingRect.size.width / width / NSScreen.mainScreen.backingScaleFactor;  pixelSizeY :=  WindowBackingRect.size.height / height / NSScreen.mainScreen.backingScaleFactor; 
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?

Navigation

[0] Message Index

Go to full version