UltravioletFramework / ultraviolet

The Ultraviolet Framework is a .NET game development framework written in C#.
https://github.com/UltravioletFramework/ultraviolet/wiki
MIT License
542 stars 46 forks source link

Retina display on Macbook game window display issues #112

Closed hotdiggitydoddo closed 5 years ago

hotdiggitydoddo commented 5 years ago

On my macbook w/Retina display, when I try to load up a Texture2D and display it at Vector2.Zero, when I launch the game, nothing appears unless I maximize the window. Also, when I resize it back down to it's original size, the texture shows up. But when I try to resize, the image goes off-screen.

When I launch the same game on my secondary monitor, the texture is immediately visible and stays in the top left corner when i resize.

tlgkccampbell commented 5 years ago

Thanks for the report. I'll see if I can diagnose this over the weekend.

tlgkccampbell commented 5 years ago

Unfortunately, I can't seem to reproduce this locally. I'm using a Hackintosh hooked up to my 1440p Dell monitors, though, so even with a HiDPI resolution set I'm not really running it on a Retina display.

I'm visting a friend next weekend who I think has a MacBook that he uses for work, so I can probably try to reproduce it on that machine. Otherwise, I don't have ready access to a true Retina display.

In the meantime, though, I have some questions:

hotdiggitydoddo commented 5 years ago

Thanks for the quick follow-up! :)

tlgkccampbell commented 5 years ago

Hi again, sorry for not following up sooner. I still haven't been able to replicate this; my code works as expected on all of the high DPI displays I've attached my Mac to so far. I think there must be some other confounding factor at work that's causing your viewport to be updated incorrectly.

Can you tell me what version of macOS you're running on your laptop? I'm running High Sierra and I'm wondering if there's some kind of version-specific bug somewhere in the graphics stack.

Also -- if you have your program output the value of Ultraviolet.GetPlatform().Windows.GetPrimary().DrawableSize, what does it say before/during/after resizing? And does it match the actual size of the window?

hotdiggitydoddo commented 5 years ago

Everything seems to be working now for some reason! Thank you for following up. =)