{"action":"opened","issue":{"url":"https://api.github.com/repos/vurtun/nuklear/issues/214","repository_url":"https://api.github.com/repos/vurtun/nuklear","labels_url":"https://api.github.com/repos/vurtun/nuklear/issues/214/labels{/name}","comments_url":"https://api.github.com/repos/vurtun/nuklear/issues/214/comments","events_url":"https://api.github.com/repos/vurtun/nuklear/issues/214/events","html_url":"https://github.com/vurtun/nuklear/issues/214","id":172279980,"number":214,"title":"Would you explain the clip_rect system?","user":{"login":"ewmailing","id":343240,"avatar_url":"https://avatars.githubusercontent.com/u/343240?v=3","gravatar_id":"","url":"https://api.github.com/users/ewmailing","html_url":"https://github.com/ewmailing","followers_url":"https://api.github.com/users/ewmailing/followers","following_url":"https://api.github.com/users/ewmailing/following{/other_user}","gists_url":"https://api.github.com/users/ewmailing/gists{/gist_id}","starred_url":"https://api.github.com/users/ewmailing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewmailing/subscriptions","organizations_url":"https://api.github.com/users/ewmailing/orgs","repos_url":"https://api.github.com/users/ewmailing/repos","events_url":"https://api.github.com/users/ewmailing/events{/privacy}","received_events_url":"https://api.github.com/users/ewmailing/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-20T16:55:45Z","updated_at":"2016-08-20T16:55:45Z","closed_at":null,"body":"I'm using a logical coordinate system that models SDL's (https://wiki.libsdl.org/SDL_RenderSetLogicalSize), except that I don't have to go through their 2D renderer. This system basically lets you set a pretend/virtual resolution (say 1280x720), and the system automatically scales everything to fit your actual resolution. It also does letterboxing if the aspect ratios don't match. It is really convenient for scaling from mobile to desktop since resolutions and aspect ratios vary so much.\r\n\r\nI've been studying your SDL/OpenGL adaptor, particularly the glScissor part and I'm trying to apply it to the logical renderer system, but I'm getting pretty lost in all the numbers. I don't have a good sense of what your values represent and the coordinate system they are in, and what I am trying to transform them into. (The y-inversion is also giving me a headache.)\r\n\r\nI can usually get things to work right when the virtual and real resolutions match and when the aspect ratio is 1. But it breaks down when I start resizing the window. For example, if I shrink the window from 1280x720 to 1024x720, I start seeing bad clipping on the left and right edges. If I move a widget across the screen, when it is on the far-left-side, the widget clips too early on the right. Conversely, moving to the far-right-side, it clips too early on the left part of the widget. In the center of the screen, the clipping is okay.\r\n\r\n\r\nI really appreciate any insights or advice you can offer.\r\nThanks\r\n\r\nP.S. If I skip the scissor call, things actually look correct. I'm not sure what I would be breaking if I skipped the scissor call entirely.\r\n"}}
{"actor":{"display_login":"ewmailing"}}