Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scaling Issue on High DPI displays #7

Open
michidk opened this issue Aug 31, 2016 · 5 comments
Open

Scaling Issue on High DPI displays #7

michidk opened this issue Aug 31, 2016 · 5 comments

Comments

@michidk
Copy link

michidk commented Aug 31, 2016

Hey,
I found this project a few weeks ago, and it worked fine so far on my workstation at home.
But currently I'm using my laptop (Surface Pro 4) which has a 2K display.

While the same build works fine on my desktop at home, on my laptop it looks like this:
http://img03.imgland.net/MxhhFBy.png

The font size is too big and the elements are unclickable (it seems like the mouse position is transformed wrongly).

I tried changing the canvas.Size to 0.5f, but it seems to change the position of the UI, so that the UI elements are invisible.

@michidk michidk changed the title Scaling Issue un High DPI displays Scaling Issue on High DPI displays Aug 31, 2016
@michidk
Copy link
Author

michidk commented Aug 31, 2016

Just noticed, that my project is using the VBO implementatiom by HappyEmu.. gonna report that issue there, first.

@michidk michidk closed this as completed Aug 31, 2016
@opcon
Copy link
Owner

opcon commented Aug 31, 2016

No worries. It sounds like whole application is being scaled on the high DPI display, have you disabled high DPI scaling for the project?

The canvas.Size property will change the actual size of the canvas in pixels, not scale the whole interface.

@michidk
Copy link
Author

michidk commented Sep 2, 2016

have you disabled high DPI scaling for the project?

How do I changed the high DPI scaling of my OpenGL application?

The canvas.Size property will change the actual size of the canvas in pixels, not scale the whole interface.

So is there another way to scale the UI manually?

Another thing I tried: Changing the zoom factor in the displays settings just makes the window smaller, but the UI is still "zoomed" and non-intractable. (http://img04.imgland.net/-kVEVoS.png)

@michidk michidk reopened this Sep 2, 2016
@opcon
Copy link
Owner

opcon commented Sep 3, 2016

To make your C#/Visual Basic application DPI aware, you need to add a custom application manifest.

  • Right-click on your project file in the Solution Explorer and click Add New Item
  • Choose Application Manifest File from the options that appear
  • Open that file and uncomment the DPI block:
  <application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
    </windowsSettings>
  </application
  • Use the custom manifest in your project by going to the project properties, the under the Application tab change the Manifest drop-down in the resources section to your newly created manifest file.

I can't think of a way to scale the UI manually, perhaps that's something I can add in a later release

@michidk
Copy link
Author

michidk commented Sep 3, 2016

I followed your steps, but sadly it did not fix the Issue.
The only thing this changed was that my console window is now on a different location. (I used to change its default position, so that I was able to see the console log and the game window at the same time.)

Edit:
It seems like that only my "Program" is DPI aware but not OpenTK / OpenGL.
Because my OpenTK window is initialized with a size of (1280, 720) and is nearly fullscreen.
If I now initialize the console window with the same size, its much smaller (nearly half the size).
My screen has a resolution of 2736x1842.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants