{"action":"created","issue":{"url":"https://api.github.com/repos/raysan5/raylib/issues/31","repository_url":"https://api.github.com/repos/raysan5/raylib","labels_url":"https://api.github.com/repos/raysan5/raylib/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/raysan5/raylib/issues/31/comments","events_url":"https://api.github.com/repos/raysan5/raylib/issues/31/events","html_url":"https://github.com/raysan5/raylib/issues/31","id":104938730,"number":31,"title":"[core] Fullscreen mode not working properly in some monitors","user":{"login":"raysan5","id":5766837,"avatar_url":"https://avatars.githubusercontent.com/u/5766837?v=3","gravatar_id":"","url":"https://api.github.com/users/raysan5","html_url":"https://github.com/raysan5","followers_url":"https://api.github.com/users/raysan5/followers","following_url":"https://api.github.com/users/raysan5/following{/other_user}","gists_url":"https://api.github.com/users/raysan5/gists{/gist_id}","starred_url":"https://api.github.com/users/raysan5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raysan5/subscriptions","organizations_url":"https://api.github.com/users/raysan5/orgs","repos_url":"https://api.github.com/users/raysan5/repos","events_url":"https://api.github.com/users/raysan5/events{/privacy}","received_events_url":"https://api.github.com/users/raysan5/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"raysan5","id":5766837,"avatar_url":"https://avatars.githubusercontent.com/u/5766837?v=3","gravatar_id":"","url":"https://api.github.com/users/raysan5","html_url":"https://github.com/raysan5","followers_url":"https://api.github.com/users/raysan5/followers","following_url":"https://api.github.com/users/raysan5/following{/other_user}","gists_url":"https://api.github.com/users/raysan5/gists{/gist_id}","starred_url":"https://api.github.com/users/raysan5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raysan5/subscriptions","organizations_url":"https://api.github.com/users/raysan5/orgs","repos_url":"https://api.github.com/users/raysan5/repos","events_url":"https://api.github.com/users/raysan5/events{/privacy}","received_events_url":"https://api.github.com/users/raysan5/received_events","type":"User","site_admin":false},"assignees":[{"login":"raysan5","id":5766837,"avatar_url":"https://avatars.githubusercontent.com/u/5766837?v=3","gravatar_id":"","url":"https://api.github.com/users/raysan5","html_url":"https://github.com/raysan5","followers_url":"https://api.github.com/users/raysan5/followers","following_url":"https://api.github.com/users/raysan5/following{/other_user}","gists_url":"https://api.github.com/users/raysan5/gists{/gist_id}","starred_url":"https://api.github.com/users/raysan5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raysan5/subscriptions","organizations_url":"https://api.github.com/users/raysan5/orgs","repos_url":"https://api.github.com/users/raysan5/repos","events_url":"https://api.github.com/users/raysan5/events{/privacy}","received_events_url":"https://api.github.com/users/raysan5/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/raysan5/raylib/milestones/3","html_url":"https://github.com/raysan5/raylib/milestones/raylib%20v1.5","labels_url":"https://api.github.com/repos/raysan5/raylib/milestones/3/labels","id":1510646,"number":3,"title":"raylib v1.5","description":"Some desired features for the new milestone:\r\n   - Review drawing order (use separate buffers for 2d and 3d)\r\n   - Add basic GPU stats system (draw calls, vertex processed, textures memory, frame time)\r\n   - Procedural image generation functions\r\n   - Procedural mesh generation functions\r\n   - LUA scripting support\r\n","creator":{"login":"raysan5","id":5766837,"avatar_url":"https://avatars.githubusercontent.com/u/5766837?v=3","gravatar_id":"","url":"https://api.github.com/users/raysan5","html_url":"https://github.com/raysan5","followers_url":"https://api.github.com/users/raysan5/followers","following_url":"https://api.github.com/users/raysan5/following{/other_user}","gists_url":"https://api.github.com/users/raysan5/gists{/gist_id}","starred_url":"https://api.github.com/users/raysan5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raysan5/subscriptions","organizations_url":"https://api.github.com/users/raysan5/orgs","repos_url":"https://api.github.com/users/raysan5/repos","events_url":"https://api.github.com/users/raysan5/events{/privacy}","received_events_url":"https://api.github.com/users/raysan5/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":11,"state":"open","created_at":"2016-01-17T01:24:21Z","updated_at":"2016-06-08T20:25:11Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-09-04T17:59:56Z","updated_at":"2016-06-26T00:00:32Z","closed_at":null,"body":"When compiling a program to be fullscreen, depending on the monitor it runs it is not scaled (just centered on the screen) or not scaled properly. It seems this issue could be related to monitor supported videomodes; GLFW library initializes the correct videomode.\r\n\r\nTo enable fullscreen mode, call `SetConfigFlags(FLAG_FULLSCREEN_MODE)` before `InitWindow()`\r\n\r\nRelated functions [core.c]: \r\n\r\n    static void InitDisplay(int width, int height);\r\n\r\nUseful code snippet:\r\n\r\n    const GLFWvidmode *mode = glfwGetVideoMode(glfwGetPrimaryMonitor());\r\n\r\n    int windowWidth = mode->width; \r\n    int windowHeight = mode->height; \r\n\r\n    int count; \r\n    const GLFWvidmode *modes = glfwGetVideoModes(glfwGetPrimaryMonitor(), &count);\r\n\r\nTested on Windows platform"},"comment":{"url":"https://api.github.com/repos/raysan5/raylib/issues/comments/228576610","html_url":"https://github.com/raysan5/raylib/issues/31#issuecomment-228576610","issue_url":"https://api.github.com/repos/raysan5/raylib/issues/31","id":228576610,"user":{"login":"raysan5","id":5766837,"avatar_url":"https://avatars.githubusercontent.com/u/5766837?v=3","gravatar_id":"","url":"https://api.github.com/users/raysan5","html_url":"https://github.com/raysan5","followers_url":"https://api.github.com/users/raysan5/followers","following_url":"https://api.github.com/users/raysan5/following{/other_user}","gists_url":"https://api.github.com/users/raysan5/gists{/gist_id}","starred_url":"https://api.github.com/users/raysan5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raysan5/subscriptions","organizations_url":"https://api.github.com/users/raysan5/orgs","repos_url":"https://api.github.com/users/raysan5/repos","events_url":"https://api.github.com/users/raysan5/events{/privacy}","received_events_url":"https://api.github.com/users/raysan5/received_events","type":"User","site_admin":false},"created_at":"2016-06-26T00:00:32Z","updated_at":"2016-06-26T00:00:32Z","body":"This issue is quite a nightmare... some code updated with commit https://github.com/raysan5/raylib/commit/6981e2bffaf6626b4ffc3f667dd9cc1de2c196da\r\n\r\nNow, I check for monitor supported videomodes and I choose the closest videomode to the desired screen size. I set that mode to be the display size and I calculate the render size and viewport offsets considering that display size. It works... but I find another issue, what happens if the supported videomode does not match the monitor default aspect ratio?\r\n\r\nExample: \r\n\r\n    Desired screen size:        800x450 (16:9)\r\n    Closest videomode detected: 800x600 (4:3)\r\n\r\n    Display size:     800x600\r\n    Render size:      800x600\r\n    Screen size:      800x450\r\n    Viewport offsets:   0, 75      // (600 - 450)/2\r\n\r\nThe result is: it renders correctly in the 800x600 framebuffer but, as long as the monitor aspect-ratio is 16:9, it gets stretched by the sides once displayed on the monitor.\r\n\r\nWhen using weird screen sizes, the problem is worst (as expected...).\r\n\r\nPossible solutions:\r\n\r\n1. Look for the closest aspet-ratio on the list of supported videomodes and then the closest display size; once aspect-ratio matches desired aspect-ratio and display size is bigger enough to store desired screen size, calculate a scaling matrix to scale all data drawn to screen (keep in mind that the objective is letting the user work with any desired screen size and that everything gets rendered right in any display).\r\n2. Limit the supported screen sizes to match a number of supported videomodes, preferably, the most common ones.\r\n\r\nNote that this issue is limited to PLATFORM_DESKTOP and desktop monitor videomodes, on other platforms (Android, HTML5) fullscreen mode is managed correctly.\r\n\r\nI'll keep this issue open for the future..."}}
{"actor":{"display_login":"raysan5"}}