{"action":"created","comment":{"url":"https://api.github.com/repos/EngoEngine/engo/pulls/comments/67415768","id":67415768,"diff_hunk":"@@ -33,13 +33,43 @@ var (\n \tcanvasWidth, canvasHeight float32\n )\n \n+// WindowResizeMessage is a message that's being dispatched whenever the game window is being resized by the gamer\n+type WindowResizeMessage struct {\n+\tOldWidth, OldHeight int\n+\tNewWidth, NewHeight int\n+}\n+\n+// IterationUpdateMessage will be used with mailbox\n+type IterationUpdateMessage struct {\n+\tDelta float32\n+}\n+\n+// PreparationMessage will be used with mailbox\n+type PreparationMessage struct{}\n+\n+// Type of message that will be sent\n+func (WindowResizeMessage) Type() string {\n+\treturn \"engo.WindowResizeMessage\"\n+}\n+\n+// Type of message that will be sent\n+func (IterationUpdateMessage) Type() string {\n+\treturn \"engo.IterationUpdateMessage\"\n+}\n+\n+// Type of message that will be sent\n+func (PreparationMessage) Type() string {","path":"engo_glfw.go","position":29,"original_position":29,"commit_id":"53a7e27bb79bd4f5afb4ccddbb35fe670831ea00","original_commit_id":"53a7e27bb79bd4f5afb4ccddbb35fe670831ea00","user":{"login":"otraore","id":12886556,"avatar_url":"https://avatars.githubusercontent.com/u/12886556?v=3","gravatar_id":"","url":"https://api.github.com/users/otraore","html_url":"https://github.com/otraore","followers_url":"https://api.github.com/users/otraore/followers","following_url":"https://api.github.com/users/otraore/following{/other_user}","gists_url":"https://api.github.com/users/otraore/gists{/gist_id}","starred_url":"https://api.github.com/users/otraore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otraore/subscriptions","organizations_url":"https://api.github.com/users/otraore/orgs","repos_url":"https://api.github.com/users/otraore/repos","events_url":"https://api.github.com/users/otraore/events{/privacy}","received_events_url":"https://api.github.com/users/otraore/received_events","type":"User","site_admin":false},"body":"Same as above","created_at":"2016-06-16T20:13:42Z","updated_at":"2016-06-16T20:13:42Z","html_url":"https://github.com/EngoEngine/engo/pull/365#discussion_r67415768","pull_request_url":"https://api.github.com/repos/EngoEngine/engo/pulls/365","_links":{"self":{"href":"https://api.github.com/repos/EngoEngine/engo/pulls/comments/67415768"},"html":{"href":"https://github.com/EngoEngine/engo/pull/365#discussion_r67415768"},"pull_request":{"href":"https://api.github.com/repos/EngoEngine/engo/pulls/365"}}},"pull_request":{"url":"https://api.github.com/repos/EngoEngine/engo/pulls/365","id":74133053,"html_url":"https://github.com/EngoEngine/engo/pull/365","diff_url":"https://github.com/EngoEngine/engo/pull/365.diff","patch_url":"https://github.com/EngoEngine/engo/pull/365.patch","issue_url":"https://api.github.com/repos/EngoEngine/engo/issues/365","number":365,"state":"open","locked":false,"title":"A set of propositions","user":{"login":"Sendoushi","id":3297394,"avatar_url":"https://avatars.githubusercontent.com/u/3297394?v=3","gravatar_id":"","url":"https://api.github.com/users/Sendoushi","html_url":"https://github.com/Sendoushi","followers_url":"https://api.github.com/users/Sendoushi/followers","following_url":"https://api.github.com/users/Sendoushi/following{/other_user}","gists_url":"https://api.github.com/users/Sendoushi/gists{/gist_id}","starred_url":"https://api.github.com/users/Sendoushi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sendoushi/subscriptions","organizations_url":"https://api.github.com/users/Sendoushi/orgs","repos_url":"https://api.github.com/users/Sendoushi/repos","events_url":"https://api.github.com/users/Sendoushi/events{/privacy}","received_events_url":"https://api.github.com/users/Sendoushi/received_events","type":"User","site_admin":false},"body":"After checking some things on the main code I found some things that I would change and this pull request tries to address some of those. Please don't accept it because I need to update the `demos` if this is to go through.\r\n\r\nChanges:\r\n* Remove function in Mailbox (untested)\r\n* Common Mailbox for all (I think that having a global Mailbox will be easier to use and it helps with background stuff for example)\r\n* `SceneSettings` instead of interface functions\r\n* Removed mailbox from scene. Instead, it may use the global one.\r\n* `InitGl` instead of using the global `func init()`\r\n* Separate `Init` from `Run`\r\n* Dispatch preparation and iteration messages (Render shouldn't know about scenes, worlds... It will help unpatternize the engine)\r\n* Move `WindowResizeMessage` to the place where it is used\r\n* Namespace dispatch messages so it doesn't collide with anything\r\n\r\nHere is an example on how this would work:\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"engo.io/ecs\"\r\n\t\"engo.io/engo\"\r\n\t\"fmt\"\r\n\t\"image/color\"\r\n)\r\n\r\n// ---------------------------------\r\n// Vars\r\n\r\ntype MainScene struct{}\r\n\r\n// ---------------------------------\r\n// Struct functions\r\n\r\n// Setup the scene\r\nfunc (*MainScene) Setup(world *ecs.World) {}\r\n\r\n// ---------------------------------\r\n// Private functions\r\n\r\n// Prepares project...\r\nfunc prepare(msg engo.Message) {\r\n\tfmt.Println(\"Hey!\")\r\n\r\n\t// Set the initial scene...\r\n\t_ = engo.SetScene(&MainScene{}, engo.SceneSettings{\r\n\t \tType:         \"Main\",\r\n\t \tAssets:       []string{\"foo.png\"},\r\n\t \tBackground:   color.White,\r\n\t}, true)\r\n}\r\n\r\n// Loops project...\r\nfunc loop(msg engo.Message) {\r\n\tfmt.Printf(\"\\nLoop! %v\", msg)\r\n}\r\n\r\n// ---------------------------------\r\n// Runtime functions\r\n\r\n// Init project function\r\nfunc init() {\r\n\t// Set the initial options\r\n\topts := engo.RunOptions{\r\n\t\tTitle:  \"Foo\",\r\n\t\tWidth:  1024,\r\n\t\tHeight: 640,\r\n\t\tNoRun:  false,\r\n\t}\r\n\r\n\tengo.Init(opts)\r\n\r\n\t// Listen for events\r\n\tengo.Mailbox.Listen(\"engo.PreparationMessage\", prepare)\r\n\tengo.Mailbox.Listen(\"engo.IterationUpdateMessage\", loop)\r\n}\r\n\r\n// Main project function\r\nfunc main() {\r\n\tengo.Run()\r\n}\r\n```","created_at":"2016-06-16T18:54:41Z","updated_at":"2016-06-16T20:13:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f2f1e17582b6b67fae58903d3a338a2f3164b94","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/EngoEngine/engo/pulls/365/commits","review_comments_url":"https://api.github.com/repos/EngoEngine/engo/pulls/365/comments","review_comment_url":"https://api.github.com/repos/EngoEngine/engo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/EngoEngine/engo/issues/365/comments","statuses_url":"https://api.github.com/repos/EngoEngine/engo/statuses/53a7e27bb79bd4f5afb4ccddbb35fe670831ea00","head":{"label":"Sendoushi:set_propositions","ref":"set_propositions","sha":"53a7e27bb79bd4f5afb4ccddbb35fe670831ea00","user":{"login":"Sendoushi","id":3297394,"avatar_url":"https://avatars.githubusercontent.com/u/3297394?v=3","gravatar_id":"","url":"https://api.github.com/users/Sendoushi","html_url":"https://github.com/Sendoushi","followers_url":"https://api.github.com/users/Sendoushi/followers","following_url":"https://api.github.com/users/Sendoushi/following{/other_user}","gists_url":"https://api.github.com/users/Sendoushi/gists{/gist_id}","starred_url":"https://api.github.com/users/Sendoushi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sendoushi/subscriptions","organizations_url":"https://api.github.com/users/Sendoushi/orgs","repos_url":"https://api.github.com/users/Sendoushi/repos","events_url":"https://api.github.com/users/Sendoushi/events{/privacy}","received_events_url":"https://api.github.com/users/Sendoushi/received_events","type":"User","site_admin":false},"repo":{"id":61316410,"name":"engo","full_name":"Sendoushi/engo","owner":{"login":"Sendoushi","id":3297394,"avatar_url":"https://avatars.githubusercontent.com/u/3297394?v=3","gravatar_id":"","url":"https://api.github.com/users/Sendoushi","html_url":"https://github.com/Sendoushi","followers_url":"https://api.github.com/users/Sendoushi/followers","following_url":"https://api.github.com/users/Sendoushi/following{/other_user}","gists_url":"https://api.github.com/users/Sendoushi/gists{/gist_id}","starred_url":"https://api.github.com/users/Sendoushi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sendoushi/subscriptions","organizations_url":"https://api.github.com/users/Sendoushi/orgs","repos_url":"https://api.github.com/users/Sendoushi/repos","events_url":"https://api.github.com/users/Sendoushi/events{/privacy}","received_events_url":"https://api.github.com/users/Sendoushi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Sendoushi/engo","description":"Engo is an open-source 2D game engine written in Go.","fork":true,"url":"https://api.github.com/repos/Sendoushi/engo","forks_url":"https://api.github.com/repos/Sendoushi/engo/forks","keys_url":"https://api.github.com/repos/Sendoushi/engo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sendoushi/engo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sendoushi/engo/teams","hooks_url":"https://api.github.com/repos/Sendoushi/engo/hooks","issue_events_url":"https://api.github.com/repos/Sendoushi/engo/issues/events{/number}","events_url":"https://api.github.com/repos/Sendoushi/engo/events","assignees_url":"https://api.github.com/repos/Sendoushi/engo/assignees{/user}","branches_url":"https://api.github.com/repos/Sendoushi/engo/branches{/branch}","tags_url":"https://api.github.com/repos/Sendoushi/engo/tags","blobs_url":"https://api.github.com/repos/Sendoushi/engo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sendoushi/engo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sendoushi/engo/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sendoushi/engo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sendoushi/engo/statuses/{sha}","languages_url":"https://api.github.com/repos/Sendoushi/engo/languages","stargazers_url":"https://api.github.com/repos/Sendoushi/engo/stargazers","contributors_url":"https://api.github.com/repos/Sendoushi/engo/contributors","subscribers_url":"https://api.github.com/repos/Sendoushi/engo/subscribers","subscription_url":"https://api.github.com/repos/Sendoushi/engo/subscription","commits_url":"https://api.github.com/repos/Sendoushi/engo/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sendoushi/engo/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sendoushi/engo/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sendoushi/engo/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sendoushi/engo/contents/{+path}","compare_url":"https://api.github.com/repos/Sendoushi/engo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sendoushi/engo/merges","archive_url":"https://api.github.com/repos/Sendoushi/engo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sendoushi/engo/downloads","issues_url":"https://api.github.com/repos/Sendoushi/engo/issues{/number}","pulls_url":"https://api.github.com/repos/Sendoushi/engo/pulls{/number}","milestones_url":"https://api.github.com/repos/Sendoushi/engo/milestones{/number}","notifications_url":"https://api.github.com/repos/Sendoushi/engo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sendoushi/engo/labels{/name}","releases_url":"https://api.github.com/repos/Sendoushi/engo/releases{/id}","deployments_url":"https://api.github.com/repos/Sendoushi/engo/deployments","created_at":"2016-06-16T18:25:25Z","updated_at":"2016-06-16T18:25:26Z","pushed_at":"2016-06-16T18:52:18Z","git_url":"git://github.com/Sendoushi/engo.git","ssh_url":"git@github.com:Sendoushi/engo.git","clone_url":"https://github.com/Sendoushi/engo.git","svn_url":"https://github.com/Sendoushi/engo","homepage":"https://engo.io","size":6224,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"EngoEngine:master","ref":"master","sha":"f617f90c8bc63579d6097370e74c4a4205494fbc","user":{"login":"EngoEngine","id":18199841,"avatar_url":"https://avatars.githubusercontent.com/u/18199841?v=3","gravatar_id":"","url":"https://api.github.com/users/EngoEngine","html_url":"https://github.com/EngoEngine","followers_url":"https://api.github.com/users/EngoEngine/followers","following_url":"https://api.github.com/users/EngoEngine/following{/other_user}","gists_url":"https://api.github.com/users/EngoEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/EngoEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EngoEngine/subscriptions","organizations_url":"https://api.github.com/users/EngoEngine/orgs","repos_url":"https://api.github.com/users/EngoEngine/repos","events_url":"https://api.github.com/users/EngoEngine/events{/privacy}","received_events_url":"https://api.github.com/users/EngoEngine/received_events","type":"Organization","site_admin":false},"repo":{"id":26521386,"name":"engo","full_name":"EngoEngine/engo","owner":{"login":"EngoEngine","id":18199841,"avatar_url":"https://avatars.githubusercontent.com/u/18199841?v=3","gravatar_id":"","url":"https://api.github.com/users/EngoEngine","html_url":"https://github.com/EngoEngine","followers_url":"https://api.github.com/users/EngoEngine/followers","following_url":"https://api.github.com/users/EngoEngine/following{/other_user}","gists_url":"https://api.github.com/users/EngoEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/EngoEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EngoEngine/subscriptions","organizations_url":"https://api.github.com/users/EngoEngine/orgs","repos_url":"https://api.github.com/users/EngoEngine/repos","events_url":"https://api.github.com/users/EngoEngine/events{/privacy}","received_events_url":"https://api.github.com/users/EngoEngine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EngoEngine/engo","description":"Engo is an open-source 2D game engine written in Go.","fork":false,"url":"https://api.github.com/repos/EngoEngine/engo","forks_url":"https://api.github.com/repos/EngoEngine/engo/forks","keys_url":"https://api.github.com/repos/EngoEngine/engo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EngoEngine/engo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EngoEngine/engo/teams","hooks_url":"https://api.github.com/repos/EngoEngine/engo/hooks","issue_events_url":"https://api.github.com/repos/EngoEngine/engo/issues/events{/number}","events_url":"https://api.github.com/repos/EngoEngine/engo/events","assignees_url":"https://api.github.com/repos/EngoEngine/engo/assignees{/user}","branches_url":"https://api.github.com/repos/EngoEngine/engo/branches{/branch}","tags_url":"https://api.github.com/repos/EngoEngine/engo/tags","blobs_url":"https://api.github.com/repos/EngoEngine/engo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EngoEngine/engo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EngoEngine/engo/git/refs{/sha}","trees_url":"https://api.github.com/repos/EngoEngine/engo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EngoEngine/engo/statuses/{sha}","languages_url":"https://api.github.com/repos/EngoEngine/engo/languages","stargazers_url":"https://api.github.com/repos/EngoEngine/engo/stargazers","contributors_url":"https://api.github.com/repos/EngoEngine/engo/contributors","subscribers_url":"https://api.github.com/repos/EngoEngine/engo/subscribers","subscription_url":"https://api.github.com/repos/EngoEngine/engo/subscription","commits_url":"https://api.github.com/repos/EngoEngine/engo/commits{/sha}","git_commits_url":"https://api.github.com/repos/EngoEngine/engo/git/commits{/sha}","comments_url":"https://api.github.com/repos/EngoEngine/engo/comments{/number}","issue_comment_url":"https://api.github.com/repos/EngoEngine/engo/issues/comments{/number}","contents_url":"https://api.github.com/repos/EngoEngine/engo/contents/{+path}","compare_url":"https://api.github.com/repos/EngoEngine/engo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EngoEngine/engo/merges","archive_url":"https://api.github.com/repos/EngoEngine/engo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EngoEngine/engo/downloads","issues_url":"https://api.github.com/repos/EngoEngine/engo/issues{/number}","pulls_url":"https://api.github.com/repos/EngoEngine/engo/pulls{/number}","milestones_url":"https://api.github.com/repos/EngoEngine/engo/milestones{/number}","notifications_url":"https://api.github.com/repos/EngoEngine/engo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EngoEngine/engo/labels{/name}","releases_url":"https://api.github.com/repos/EngoEngine/engo/releases{/id}","deployments_url":"https://api.github.com/repos/EngoEngine/engo/deployments","created_at":"2014-11-12T05:50:03Z","updated_at":"2016-06-16T19:00:02Z","pushed_at":"2016-06-16T18:54:41Z","git_url":"git://github.com/EngoEngine/engo.git","ssh_url":"git@github.com:EngoEngine/engo.git","clone_url":"https://github.com/EngoEngine/engo.git","svn_url":"https://github.com/EngoEngine/engo","homepage":"https://engo.io","size":6922,"stargazers_count":214,"watchers_count":214,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":48,"forks":32,"open_issues":48,"watchers":214,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/EngoEngine/engo/pulls/365"},"html":{"href":"https://github.com/EngoEngine/engo/pull/365"},"issue":{"href":"https://api.github.com/repos/EngoEngine/engo/issues/365"},"comments":{"href":"https://api.github.com/repos/EngoEngine/engo/issues/365/comments"},"review_comments":{"href":"https://api.github.com/repos/EngoEngine/engo/pulls/365/comments"},"review_comment":{"href":"https://api.github.com/repos/EngoEngine/engo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/EngoEngine/engo/pulls/365/commits"},"statuses":{"href":"https://api.github.com/repos/EngoEngine/engo/statuses/53a7e27bb79bd4f5afb4ccddbb35fe670831ea00"}}}}
{"actor":{"display_login":"otraore"}}