{"action":"created","issue":{"url":"https://api.github.com/repos/adventuregamestudio/ags/issues/510","repository_url":"https://api.github.com/repos/adventuregamestudio/ags","labels_url":"https://api.github.com/repos/adventuregamestudio/ags/issues/510/labels{/name}","comments_url":"https://api.github.com/repos/adventuregamestudio/ags/issues/510/comments","events_url":"https://api.github.com/repos/adventuregamestudio/ags/issues/510/events","html_url":"https://github.com/adventuregamestudio/ags/issues/510","id":362119453,"node_id":"MDU6SXNzdWUzNjIxMTk0NTM=","number":510,"title":"Allow the OpenGL display driver to be used on Linux.","user":{"login":"toojays","id":378690,"node_id":"MDQ6VXNlcjM3ODY5MA==","avatar_url":"https://avatars2.githubusercontent.com/u/378690?v=4","gravatar_id":"","url":"https://api.github.com/users/toojays","html_url":"https://github.com/toojays","followers_url":"https://api.github.com/users/toojays/followers","following_url":"https://api.github.com/users/toojays/following{/other_user}","gists_url":"https://api.github.com/users/toojays/gists{/gist_id}","starred_url":"https://api.github.com/users/toojays/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toojays/subscriptions","organizations_url":"https://api.github.com/users/toojays/orgs","repos_url":"https://api.github.com/users/toojays/repos","events_url":"https://api.github.com/users/toojays/events{/privacy}","received_events_url":"https://api.github.com/users/toojays/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2018-09-20T10:20:46Z","updated_at":"2018-09-25T11:59:42Z","closed_at":null,"author_association":"NONE","body":"Discussion moved from http://www.adventuregamestudio.co.uk/forums/index.php?topic=46152.msg636595128#msg636595128\r\n\r\nI wrote:\r\n> I'm new to AGS. Just bought Lamplight City which uses it last week. I was disappointed with the performance running fullscreen; it sounds like I've run into what you guys call the \"scaling problem\"?\r\n>\r\n> Anyway, this inspired me to try and get AGS' OpenGL renderer working on Linux. I don't have previous OpenGL experience but was able to crib from enough tutorials to get it working in windowed mode.\r\n> \r\n> Code is at https://github.com/toojays/ags/tree/ags3+linux-opengl , see the commit message at https://github.com/toojays/ags/commit/4ae20e7317241fe3b1435ccd0652956dfca38c88 for more detail.\r\n>\r\n> I've only tested it with one game (Lamplight City) on one system (Ubuntu 18.04, Intel graphics) so far. Fullscreen mode isn't working yet. Somewhere in AGS the system tries to resolve the game's 640x400 against my PC's 1920x1080 and comes up with 1728x1080 (game res * 2.7). I fail to set this as a fullscreen mode and AGS falls back to windowed mode. I guess the driver is supposed to realize the system won't do 1728x1080 and ask the windowing system for 1920x1080? Does anyone know?\r\n\r\nThen Crimson Wizard replied with:\r\n> Hello, toojays. It's really nice to see someone tried doing this. I kept hoping to look into this myself but never found a moment to research the OpenGL working on Linux (also, there was ongoing Nick Sonneveld's SDL port attempt, but it seems to get delayed again).\r\n>\r\n> Can't answer to the fullscreen problem right away, this is something to investigate. I may mention one thing though (and also the main reason that was stopping me). Since OpenGL does not support \"dedicated fullscreen mode\" on Windows I had to emulate fullscreen mode (probably this is how everyone do this) by switching desktop resolution. This is not done in ali3dogl.cpp itself, but in the \"platform driver\" class. You may find calls to \"platform->EnterFullscreenMode\", \"platform->AdjustWindowStyleForFullscreen\" and \"platform->ExitFullscreenMode\" in OpenGL renderer. The implementation for Windows is located in acplwin.cpp. But I honestly do not know if we should follow same procedure for Linux or not (also don't know X11 very well, I wrote literally couple of functions using it before).\r\n>\r\n> Am I right that you are using \"glew\" library, that helps to bind function pointers to dynamically loaded OpenGL object? OpenGL renderer was originally written in such a way that on Windows we manually getting function addresses, and that would be actually a nice thing to get glew used on Windows eventually too (not sure why I never tried, maybe was worried to break something that was already working).\r\n>\r\n> I have a proposal, since this forum thread is too long already and contains all kinds of various discussions, could we continue on github instead, by opening an issue ticket in our repository? I believe that would be more convenient especially since you already have account and some code in progress there."},"comment":{"url":"https://api.github.com/repos/adventuregamestudio/ags/issues/comments/424314401","html_url":"https://github.com/adventuregamestudio/ags/issues/510#issuecomment-424314401","issue_url":"https://api.github.com/repos/adventuregamestudio/ags/issues/510","id":424314401,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDMxNDQwMQ==","user":{"login":"ivan-mogilko","id":1833754,"node_id":"MDQ6VXNlcjE4MzM3NTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1833754?v=4","gravatar_id":"","url":"https://api.github.com/users/ivan-mogilko","html_url":"https://github.com/ivan-mogilko","followers_url":"https://api.github.com/users/ivan-mogilko/followers","following_url":"https://api.github.com/users/ivan-mogilko/following{/other_user}","gists_url":"https://api.github.com/users/ivan-mogilko/gists{/gist_id}","starred_url":"https://api.github.com/users/ivan-mogilko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivan-mogilko/subscriptions","organizations_url":"https://api.github.com/users/ivan-mogilko/orgs","repos_url":"https://api.github.com/users/ivan-mogilko/repos","events_url":"https://api.github.com/users/ivan-mogilko/events{/privacy}","received_events_url":"https://api.github.com/users/ivan-mogilko/received_events","type":"User","site_admin":false},"created_at":"2018-09-25T11:59:42Z","updated_at":"2018-09-25T11:59:42Z","author_association":"MEMBER","body":">  I found that if I don't recreate the GL context the image looks okay on resize:\r\n> That makes me wonder if there's some device dependent bitmaps that rely on the GL context or something. \r\n\r\nYes, there are DDBs, and the engine's logic is currently taking that into account. When the mode is changed at runtime (currently supports only switching from windowed to fullscreen, but we had plans to allow more tuning by script commands) the engine tests if the transition would require full graphic reinitialization. IIRC this is only required if color depth is changed:\r\nhttps://github.com/adventuregamestudio/ags/blob/master/Engine/main/engine_setup.cpp#L407\r\n\r\nThis is also the reason I'd prefer the sequence of actions would remain same on Linux if possible i.e. it would not do something on Linux (like deleting GL context) when it does not do same on Windows and so on.\r\nIt may be bit complicated to follow because OpenGL renderer is messy with every platform having pieces of special code there, something that probably would benefit from refactoring (like separating OpenGL commands and leaving only basic algorithm) but that's another issue.\r\n\r\n"}}
{"actor":{"display_login":"ivan-mogilko"}}