{"action":"created","issue":{"url":"https://api.github.com/repos/mono/MonoGame/issues/4454","labels_url":"https://api.github.com/repos/mono/MonoGame/issues/4454/labels{/name}","comments_url":"https://api.github.com/repos/mono/MonoGame/issues/4454/comments","events_url":"https://api.github.com/repos/mono/MonoGame/issues/4454/events","html_url":"https://github.com/mono/MonoGame/issues/4454","id":128329075,"number":4454,"title":"[OpenTK] DPI scaling is ignored by MonoGame","user":{"login":"mrhelmut","id":3427451,"avatar_url":"https://avatars.githubusercontent.com/u/3427451?v=3","gravatar_id":"","url":"https://api.github.com/users/mrhelmut","html_url":"https://github.com/mrhelmut","followers_url":"https://api.github.com/users/mrhelmut/followers","following_url":"https://api.github.com/users/mrhelmut/following{/other_user}","gists_url":"https://api.github.com/users/mrhelmut/gists{/gist_id}","starred_url":"https://api.github.com/users/mrhelmut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrhelmut/subscriptions","organizations_url":"https://api.github.com/users/mrhelmut/orgs","repos_url":"https://api.github.com/users/mrhelmut/repos","events_url":"https://api.github.com/users/mrhelmut/events{/privacy}","received_events_url":"https://api.github.com/users/mrhelmut/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-01-23T13:34:56Z","updated_at":"2016-02-01T17:50:43Z","closed_at":null,"body":"Windows (with 4K displays) and OS X (with Retina displays) are using a high DPI mode which scales everything to fit high resolutions.\r\n\r\nOpenTK has internal mechanisms to handle that automatically, but MonoGame overrides the ```Viewport``` size (because it assumes it to be the same as the backbuffer, which is not correct when it comes to DPI scaling) and this results in cropped or too big viewport.\r\n\r\nI know that OpenTK is being replaced, but I feel like this is still an important issue and I'm leaving this here so we can keep that in mind when SDL2 will be in use (note that SDL2 <= 2.0.2 doesn't have DPI scaling support)."},"comment":{"url":"https://api.github.com/repos/mono/MonoGame/issues/comments/178093412","html_url":"https://github.com/mono/MonoGame/issues/4454#issuecomment-178093412","issue_url":"https://api.github.com/repos/mono/MonoGame/issues/4454","id":178093412,"user":{"login":"mrhelmut","id":3427451,"avatar_url":"https://avatars.githubusercontent.com/u/3427451?v=3","gravatar_id":"","url":"https://api.github.com/users/mrhelmut","html_url":"https://github.com/mrhelmut","followers_url":"https://api.github.com/users/mrhelmut/followers","following_url":"https://api.github.com/users/mrhelmut/following{/other_user}","gists_url":"https://api.github.com/users/mrhelmut/gists{/gist_id}","starred_url":"https://api.github.com/users/mrhelmut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrhelmut/subscriptions","organizations_url":"https://api.github.com/users/mrhelmut/orgs","repos_url":"https://api.github.com/users/mrhelmut/repos","events_url":"https://api.github.com/users/mrhelmut/events{/privacy}","received_events_url":"https://api.github.com/users/mrhelmut/received_events","type":"User","site_admin":false},"created_at":"2016-02-01T17:50:43Z","updated_at":"2016-02-01T17:50:43Z","body":"It looks like everything is correct in both MonoGame and OpenTK. Viewport and backbuffer have the good size.\r\n\r\nWhat seems to be causing so much trouble is effects and transform matrix. When I draw a sprite with a scale matrix passed by ```SpriteBatch.Begin()``` and a custom pixel shader which does nothing but output the sprite as-is, the sprite gets scaled by the passed matrix AND the DPI scale.\r\nIf I don't pass any matrix to ```SpriteBatch.Begin()```, everything renders at the intended scale.\r\n\r\nIs there any sprite batch / effect mechanism that could be affected by DPI? Maybe a difference between DX and GL which could cause this?"}}