Opened 12 years ago

Closed 10 years ago

#1593 closed defect (fixed)

Issue with fullscreen OS X retina display

Reported by: Mitchell K Owned by:
Priority: Should Have Milestone: Alpha 17
Component: Core engine Keywords: sdl cursor osx
Cc: mk12360@… Patch:

Description (last modified by historic_bruno)

On my retina MacBook Pro running OS X 10.8, 0 A.D. windowed works fine. Fullscreen, however, has black bars on the top and bottom, clipping off parts of the interface, and the cursor input is offset. That is, the location where the cursor appears to be is actually about an inch *below* where it should be.

All this can be seen in the attached screenshot.

System Info: MacBookPro10,1 (Retina, Mid 2012) 2.3 GHz Intel Core i7 Intel HD Graphics 4000 (Integrated) NVIDIA GeForce GT 650M (Discrete) OS X 10.8 (12A269)

screen

Attachments (4)

screen2.jpg (497.2 KB ) - added by Mitchell K 12 years ago.
screen
2880x1800.jpg (321.6 KB ) - added by Mitchell K 12 years ago.
Used SetResX ro run at 2880x1800
screenshotF2.jpg (199.6 KB ) - added by Mitchell K 12 years ago.
fullscreen screenshot with F2
os-screenshot.jpg (402.0 KB ) - added by Mitchell K 12 years ago.
os x screenshot with command-shift-3

Download all attachments as: .zip

Change History (30)

by Mitchell K, 12 years ago

Attachment: screen2.jpg added

screen

comment:1 by historic_bruno, 12 years ago

Keywords: fullscreen removed
Summary: Black bars, cursor offset on fullscreen OS X Mountain LionIssue with fullscreen OS X retina display

It looks like the right side is also cut off.

Can you try opening "Get Info" for the pyrogenesis binary, and if there's a HiDPI option shown, uncheck it?

It may be an SDL issue or a problem with how we detect display resolution. At first glance I don't see that any part of the API we use has changed. Apple has some good technical documentation on high resolution displays here, including recent API changes.

comment:2 by historic_bruno, 12 years ago

Description: modified (diff)

comment:3 by Mitchell K, 12 years ago

Cc: mk12360@… added

You're right, the image extends all the way to the left and right of my display, but the right side is definitely cut off.

There is no such option "HiDPI" or "Open in Low Resolution" (which is what I see on other apps) in the get info window. I suspect this is because it is an executable and not a .app package.

in reply to:  3 comment:4 by historic_bruno, 12 years ago

Replying to mk12:

There is no such option "HiDPI" or "Open in Low Resolution" (which is what I see on other apps) in the get info window. I suspect this is because it is an executable and not a .app package.

Interesting, maybe you can test again once the Alpha 11 bundle is out :) I still don't know if that option will be shown, or if it makes any difference, there is apparently a key which needs to be placed in the bundle's Info.plist to trigger high resolution display mode in the app.

It's annoying that I don't have a retina display to help debug this :/

Can you try adding the following line to source/ps/VideoMode.cpp after line 170?

	debug_printf(L"InitSDL: width=%d, height=%d, bpp=%d, freq=%d\n", m_PreferredW, m_PreferredH, m_PreferredBPP, m_PreferredFreq);

Then build and test, checking the terminal output for that info. That should at least tell us what kind of display settings the game is detecting.

comment:5 by Mitchell K, 12 years ago

Sure, I'll try that soon.

comment:6 by Mitchell K, 12 years ago

It's the same thing that gets logged for windowed and fullscreen:

InitSDL: width=1440, height=900, bpp=32, freq=0

My retina display is 2880x1800, or [1440x900]@2x, so that looks correct. The system is giving SDL the full resolution in points, and although on my display 1 linear pt = 2 px, everything just gets scaled up since 0 A.D. isn't requesting any special high resolution backing.

Does this not happen to anyone else with Mountain Lion? To me it seems strange that the retina display would be the cause of this since it's supposed to be completely transparent to old apps that they are getting scaled. And like I said, SDL has the correct resolution.

comment:7 by historic_bruno, 12 years ago

It depends on the native APIs that SDL uses, some of them have changed even as recently as Mountain Lion, the above link mentions that, and SDL 1.2 certainly hasn't been updated since ML was released. BTW that display info doesn't come from SDL, but we use CGDisplayPixelsWide and CGDisplayPixelsHigh, so it's quite strange if Apple's own functions are called "Pixels" but return points...

comment:8 by fabio, 12 years ago

Maybe related to #1549?

comment:9 by Mitchell K, 12 years ago

It doesn't look like it to me anyway... They don't say anything about the cursor being offset. And while I am constrained to a rectangle slightly vertically skinnier then my screen as well, it's actually black in those regions, which that ticket doesn't mention. My view is cropped at the top and bottom because there are black bars covering those areas, but it is also cropped off at the right (there isn't a black bar, it goes all the way to the edge), which you can see in the photo.

Last edited 12 years ago by Mitchell K (previous) (diff)

comment:10 by Mitchell K, 12 years ago

Hmmm. This is interesting. I used SetResX to run my display at the full 2880x1800 (the UI is so tiny!), and then I launched 0 A.D.

The display settings log was as expected:

InitSDL: width=2880, height=1800, bpp=32, freq=0

However, this photo is what it looked like (it only seems to be rendering the bottom-left quarter):

by Mitchell K, 12 years ago

Attachment: 2880x1800.jpg added

Used SetResX ro run at 2880x1800

comment:11 by Mitchell K, 12 years ago

*to run

by Mitchell K, 12 years ago

Attachment: screenshotF2.jpg added

fullscreen screenshot with F2

comment:12 by Mitchell K, 12 years ago

I've just added a screenshot of the main menu taken in fullscreen with F2. It looks exactly as it should -- nothing is cropped or cut off.

comment:13 by historic_bruno, 12 years ago

Wait, it looks correct when you take a screenshot but not on the actual display?

comment:14 by Mitchell K, 12 years ago

Yes, exactly. I'm not sure how screenshot mechanism works in 0 A.D., I assume it just renders to a frame buffer which it writes to the file.

Last edited 12 years ago by Mitchell K (previous) (diff)

by Mitchell K, 12 years ago

Attachment: os-screenshot.jpg added

os x screenshot with command-shift-3

comment:15 by Mitchell K, 12 years ago

I just took a screenshot with command-shift-3, the OS X shortcut to save a fullscreen screenshot to the desktop, and that's what I got. It looks the same as what I see on screen, while the 0 A.D. F2 screenshot looks correct.

in reply to:  14 comment:16 by historic_bruno, 12 years ago

Replying to mk12:

Yes, exactly. I'm not sure how screenshot mechanism works in 0 A.D., I assume it just renders to a frame buffer which it writes to the file.

Oh right, the F2 just blew right by me :)

comment:17 by stwf, 11 years ago

Milestone: BacklogAlpha 14
Owner: set to stwf

comment:18 by stwf, 11 years ago

I don't see this on my 13" retina macbook pro. I suppose you have the 15" What is the resolution on that?

steve

comment:19 by Mitchell K, 11 years ago

My resolution is 2880x1800. The last time I tried this wasn't that long ago and the problem was still present.

EDIT: Just tried Alpha 12 Loucetios and the problem is unchanged.

Last edited 11 years ago by Mitchell K (previous) (diff)

comment:20 by historic_bruno, 11 years ago

I may have just stumbled across this issue by accident. If I run the game windowed and then change the display resolution while it's running, the cursor is offset from the correct position. It seems like SDL is not updating the input coordinates. This is on Lion 10.7.5.

Can you test if you get the same behavior and as important, does it seem like the problem you reported? Maybe OS X is changing the fullscreen resolution due to some weirdness with the Retina display.

Last edited 11 years ago by historic_bruno (previous) (diff)

comment:21 by historic_bruno, 11 years ago

The latest SDL 2.0 snapshot fixes the resolution bug I noticed, maybe it will fix any Retina-related issues as well. Once it's officially released and if further testing confirms this, I'll update the build scripts.

comment:22 by Kieran P, 11 years ago

Milestone: Alpha 14Alpha 15

comment:23 by historic_bruno, 10 years ago

Milestone: Alpha 15Backlog

This is not purely a Retina or Mountain Lion issue, as some people have reported the bundle runs fine in fullscreen on Mountain Lion with Retina displays. Moving to backlog until we can get more useful info to debug this.

comment:24 by siefkencp, 10 years ago

I had this issue with OSX Mountain Lion - 10.9.1 - Mac Book Pro 15' Retina display.

I was able to get by it by forcibly changing the default.cfg file resolution -

/Applications/0ad.app/Contents/Resources/data/config/default.cfg

; Force a particular resolution. (If these are 0, the default is
; to keep the current desktop resolution in fullscreen mode or to
; use 1024x768 in windowed mode.)

xres = 1280
yres = 1024

I thought it might show up windowed but whatever happened the display sorted itself out and came up full screen properly.

Hope this helps!

Last edited 10 years ago by siefkencp (previous) (diff)

comment:25 by historic_bruno, 10 years ago

Owner: stwf removed

comment:26 by historic_bruno, 10 years ago

Milestone: BacklogAlpha 17
Resolution: fixed
Status: newclosed

It's quite difficult to get anyone to test the game with a Retina display, so I'm closing this ticket and assuming the SDL2 upgrade will at least change the problem, if not fix them completely. SDL2 will be the default on OS X for A17.

Note: See TracTickets for help on using tickets.