Login  •  Register


The time is now: Tue Oct 22, 2019 12:59 am

Emaculation wiki  •  Delete all board cookies



Post new topic  Reply to topic Page 1 of 1 [ 6 posts ]
Print view Previous topic  |  Next topic
Author Message
PostPosted: Wed Feb 20, 2019 11:06 pm 
Offline
Tinkerer

Joined: Sun Nov 19, 2006 6:01 pm
Posts: 84
Location: Belgium
I have noticed that even with the ‘scale_nearest true’ option in the prefs, the SheepShaver window still looks blurry on a retina display. In fact, there is no visible difference between enabling that option or not, neither between forcing the app to low-resolution in the Finder or not. When making screenshots and viewing them at larger size, the blurriness becomes really obvious.

After some googling around, I have found that for SDL to truly render at the higher resolution, the flag ‘SDL_WINDOW_ALLOW_HIGHDPI’ must be passed to SDL_CreateWindow(). Without this, the window is rendered at regular resolution and it seems that the OS (or at least Mac OS X) then uses linear interpolation to obtain the higher resolution.
The result of combining scale_nearest with this flag can be seen below at the right. Anyone preferring the softer look can either disable scale_nearest or force the app to low res in the Finder.
Unless someone knows situations where enabling this can be problematic, I would just always enable it. Otherwise it will need to be toggle-able with a prefs setting.

Image


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Feb 20, 2019 11:20 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2702
Location: Emaculation.com
Wow! Thanks for finding that; it's been bugging me for a while, but not enough for me to take the time to figure it out.

Paging kanjitalk755 for integration :D


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Feb 21, 2019 1:39 pm 
Offline
Tinkerer

Joined: Sun Nov 19, 2006 6:01 pm
Posts: 84
Location: Belgium
Yes, initially I merely thought: “man, my eyesight isn't what it used to be!” Only when actually fixing it it became obvious how fuzzy the graphics were…
I simply added this at line 739 of BasiliskII/src/SDL/video_sdl2.cpp:
Code:
window_flags |= SDL_WINDOW_ALLOW_HIGHDPI;


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Fri Feb 22, 2019 11:19 am 
Offline
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 5593
Location: Amsterdam, Netherlands
DrLex wrote:
I simply added this at line 739 of BasiliskII/src/SDL/video_sdl2.cpp:
Code:
window_flags |= SDL_WINDOW_ALLOW_HIGHDPI;

Did you do that in a recent version of the source from kanjitalk755/macemu?

Has the Info.plist file this as last entry (3 Feb added in kanjitalk755/macemu):
</dict>
<key>NSHighResolutionCapable</key>
<true/>
</dict>

Edit:
It seems that this entry in Info.plist causes problems with at least some Retina screens:
viewtopic.php?p=62270#p62270
viewtopic.php?f=20&t=10073


Last edited by Ronald P. Regensburg on Fri Feb 22, 2019 11:50 am, edited 2 times in total.
 


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Fri Feb 22, 2019 6:09 pm 
Offline
Tinkerer

Joined: Sun Nov 19, 2006 6:01 pm
Posts: 84
Location: Belgium
Ronald P. Regensburg wrote:
Did you do that in a recent version of the source from kanjitalk755/macemu?


Yes, this is in the latest source. Dropping the NSHighResolutionCapable flag is not the way forward. That would only mask the true problem and take away the possibility of sharp rendering on retina displays. And we all know that someday Apple will drop support for low-resolution apps, like they are now doing with 32-bit.

Both the NSHighResolutionCapable flag in the plist and the SDL_WINDOW_ALLOW_HIGHDPI flag in the code are needed to make SDL2 render correctly in high resolution. Without the latter, the only thing you're gaining is a sharper preferences window. I have a suspicion the problem reported by ‘bestusername’ and ‘rganschow’ may be caused by only having the high resolution flag in the plist but not in the source code. There could be a bug in the version of the SDL2 framework that was used to create the build, triggering the exaggerated zoom. I'm building against SDL2-2.0.9 (Oct 31 2018) and cannot reproduce this problem with my builds. (I suspect that the bug wouldn't occur in the older SDL2 either when combining the plist and source code flags.)


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Fri Feb 22, 2019 7:52 pm 
Offline
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 5593
Location: Amsterdam, Netherlands
DrLex wrote:
I have a suspicion the problem reported by ‘bestusername’ and ‘rganschow’ may be caused by only having the high resolution flag in the plist but not in the source code.

That is what I suspected, hence my question. In the current kanjitalk755 source, the NSHighResolutionCapable flag is present in the plist but the the SDL_WINDOW_ALLOW_HIGHDPI flag is not in the code.

Quote:
There could be a bug in the version of the SDL2 framework that was used to create the build, triggering the exaggerated zoom. I'm building against SDL2-2.0.9 (Oct 31 2018) and cannot reproduce this problem with my builds.
Also if the the SDL_WINDOW_ALLOW_HIGHDPI flag is not in the code?

(I cannot test different builds myself because I do not have a Retina screen and neither has kanjitalk755. The issue is only manifest on high-res screens.)

Edit: I used SDL2-2.0.8.


Last edited by Ronald P. Regensburg on Fri Feb 22, 2019 8:00 pm, edited 1 time in total.
 


Top
 Profile  
Reply with quote Post a reply  
Display posts from previous:  Sort by  
Post new topic  Reply to topic Page 1 of 1 [ 6 posts ]


Who is online

Users browsing this forum: Google [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
 

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group