TwinFan / XPMP2

Multiplayer library for X-Plane 11/12 with instancing, TCAS override, and sound
https://twinfan.github.io/XPMP2/
Other
24 stars 16 forks source link

Labels don't draw on secondary monitors #17

Open TwinFan opened 4 years ago

TwinFan commented 4 years ago

Describe the bug the labels only appear for the planes showing on my central monitor (main monitor). Those on the 2 side monitors have no labels, but acquire them as they cross into the middle one.

Also, users consistently report (for ages already) that in VR labels are seen in one eye only. Assuming that the second eye is technically provided as a second screen, this issue is actually the same.

To Reproduce / Source Code Example Need 2 or monitor setup. Enable Labels. Watch labels for planes on secondary monitor.

Expected behavior All planes have labels on all monitors.

Version

Additional context Reported in Discord's beta channel.

TwinFan commented 4 years ago

"no difference in setting up 2 monitors properly (with lateral offsets etc.) or just mirroring the 1st display: both show no labels on the 2nd display."

TwinFan commented 4 years ago

Investigated: The technique used is currently available on the main screen only: There is a 2D drawing callback (for phase xplm_Phase_Window, other phases would only be called for 2D cockpits), which uses OpenGL projection matrices to convert 3D coordinates in 2D screen coordinates and then XPLMDrawString for the actual label. But the actuall call to the callback happens only for the main screen context. From there,

I comment accordingly to the sample code, in the hope that maybe someone replies there.

TwinFan commented 4 years ago

Ben replied (13d ago already) as follows:

hmmm – if you set the drawing callback to the before windows phase (the example shows after) do you get multi-monitor working? The second eye is not a second screen, it’s a second pass. But the ‘after’ phase isn’t in the HMD at all, the before is.

But changing the callback to "before" doesn't change the situation: It is still called once only, for the main screen