We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4298

Summary: SDL_RenderCopy-ied scene is blurred, on macOS 10.14
Product: SDL Reporter: Adam S. <sidatt64>
Component: renderAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.8   
Hardware: x86   
OS: Mac OS X (All)   
Attachments: How the corners look after upgrading to macOS Mojave
How the corners look before upgrading to macOS Mojave
How the pixels look before upgrading to macOS Mojave
How the pixels look after upgrading to macOS Mojave

Description Adam S. 2018-10-05 19:05:28 UTC
Created attachment 3345 [details]
How the corners look after upgrading to macOS Mojave

My project is using SDL_RenderCopy to render a texture to the screen. The texture is updated every frame using an array of Uint32s. 

I compiled my project two days ago, before upgrading to macOS Mojave. When run, you can see that the corners of the window are jagged (something I can live with), and the pixels are larger than the size of a pixel on the screen (which is what I wanted). Also, you could see that the pixels were not being interpolated, they were very crisp edges which is what is required for a pixel art game.

I recompiled my project today, after upgrading to macOS Mojave. The edges are now round and smooth (which is a nice bonus), and the pixels are still the expected size (larger than a real pixel). However, now I see that I do not have any crisp edges anymore, they are blurred and smooth, which I do not want.

When trying to fix this issue, I resized the window programmatically using SDL_SetWindowSize, but this did not fix the issue, but caused another. The render was massive and what should have been a small rectangle centered in the middle of the window was offset to the top right corner and filled half the screen.

I am also experiencing the error which causes the screen to appear black initially, but when I move the window it fixes. I understand that this issue is being patched, but I am just mentioning it so that it is known that it is a issue on many systems.

Finally, I noticed that the jagged borders appear when the window is created (while the screen is black), but once I resize or move it, the smooth borders appear.

I have included 4 images, ones prefixed with old_ are of executables that I compiled two days ago but are executing today, and ones prefixed with new_ are of executables that I compiled today.
Comment 1 Adam S. 2018-10-05 19:05:53 UTC
Created attachment 3346 [details]
How the corners look before upgrading to macOS Mojave
Comment 2 Adam S. 2018-10-05 19:06:27 UTC
Created attachment 3347 [details]
How the pixels look before upgrading to macOS Mojave
Comment 3 Adam S. 2018-10-05 19:06:51 UTC
Created attachment 3348 [details]
How the pixels look after upgrading to macOS Mojave
Comment 4 Adam S. 2018-10-05 19:56:53 UTC
Hmm... I've noticed that setting the SDL_WINDOW_ALLOW_HIGHDPI flag fixes the blur issue, but the black screen still remains.

Sorry if this wasted your time, but I was confused seeing as I did not require the SDL_WINDOW_ALLOW_HIGHDPI flag to produce crisp lines in older versions of macOS.

I will wait for SDL 2.0.9 to be released, along with the bugfix mentioned in https://bugzilla.libsdl.org/show_bug.cgi?id=4272.