{"action":"created","issue":{"url":"https://api.github.com/repos/mosra/magnum/issues/263","repository_url":"https://api.github.com/repos/mosra/magnum","labels_url":"https://api.github.com/repos/mosra/magnum/issues/263/labels{/name}","comments_url":"https://api.github.com/repos/mosra/magnum/issues/263/comments","events_url":"https://api.github.com/repos/mosra/magnum/issues/263/events","html_url":"https://github.com/mosra/magnum/issues/263","id":343282693,"node_id":"MDU6SXNzdWUzNDMyODI2OTM=","number":263,"title":"(Possibly SDL2 issue) idle loop pegs CPU","user":{"login":"kghose","id":664644,"node_id":"MDQ6VXNlcjY2NDY0NA==","avatar_url":"https://avatars0.githubusercontent.com/u/664644?v=4","gravatar_id":"","url":"https://api.github.com/users/kghose","html_url":"https://github.com/kghose","followers_url":"https://api.github.com/users/kghose/followers","following_url":"https://api.github.com/users/kghose/following{/other_user}","gists_url":"https://api.github.com/users/kghose/gists{/gist_id}","starred_url":"https://api.github.com/users/kghose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kghose/subscriptions","organizations_url":"https://api.github.com/users/kghose/orgs","repos_url":"https://api.github.com/users/kghose/repos","events_url":"https://api.github.com/users/kghose/events{/privacy}","received_events_url":"https://api.github.com/users/kghose/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-07-21T00:47:44Z","updated_at":"2018-08-28T01:33:07Z","closed_at":null,"author_association":"NONE","body":"I'm using the SDL2 application. I'm forced to use `setMinimalLoopPeriod` to stop the application from pegging the CPU when nothing is being drawn. I would have expected SDL's idle loop would really idle. The vsync is set. I'm on macOS and on a mac book pro laptop. \r\n\r\nI've also implemented a `tickEvent()` that I don't need to run frequently. If I omit this will the idle loop problem go away? I just need something that goes off on a timer. \r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/mosra/magnum/issues/comments/416421544","html_url":"https://github.com/mosra/magnum/issues/263#issuecomment-416421544","issue_url":"https://api.github.com/repos/mosra/magnum/issues/263","id":416421544,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjQyMTU0NA==","user":{"login":"kghose","id":664644,"node_id":"MDQ6VXNlcjY2NDY0NA==","avatar_url":"https://avatars0.githubusercontent.com/u/664644?v=4","gravatar_id":"","url":"https://api.github.com/users/kghose","html_url":"https://github.com/kghose","followers_url":"https://api.github.com/users/kghose/followers","following_url":"https://api.github.com/users/kghose/following{/other_user}","gists_url":"https://api.github.com/users/kghose/gists{/gist_id}","starred_url":"https://api.github.com/users/kghose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kghose/subscriptions","organizations_url":"https://api.github.com/users/kghose/orgs","repos_url":"https://api.github.com/users/kghose/repos","events_url":"https://api.github.com/users/kghose/events{/privacy}","received_events_url":"https://api.github.com/users/kghose/received_events","type":"User","site_admin":false},"created_at":"2018-08-28T01:33:07Z","updated_at":"2018-08-28T01:33:07Z","author_association":"NONE","body":"Hi @mosra I can confirm that the following code with no `tickEvent()` will sit at 2.5% CPU while with a blank `tickEvent()` will sit at 99.9% CPU on my mac.\r\n\r\n```\r\n#include <Magnum/GL/DefaultFramebuffer.h>\r\n#include <Magnum/Platform/Sdl2Application.h>\r\n\r\nusing namespace Magnum;\r\n\r\nclass MyApplication: public Platform::Application {\r\n    public:\r\n        explicit MyApplication(const Arguments& arguments);\r\n\r\n    private:\r\n        void drawEvent() override;\r\n        //void tickEvent() override { ; }\r\n\r\n};\r\n\r\nMyApplication::MyApplication(const Arguments& arguments): Platform::Application{arguments} {\r\n    /* TODO: Add your initialization code here */\r\n}\r\n\r\nvoid MyApplication::drawEvent() {\r\n    GL::defaultFramebuffer.clear(GL::FramebufferClear::Color);\r\n\r\n    /* TODO: Add your drawing code here */\r\n\r\n    swapBuffers();\r\n}\r\n\r\nMAGNUM_APPLICATION_MAIN(MyApplication)\r\n```\r\n\r\nIs this expected behavior?\r\n\r\n"}}
{"actor":{"display_login":"kghose"}}