{"action":"created","comment":{"url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/comments/50970225","id":50970225,"diff_hunk":"@@ -28,6 +28,38 @@ OpenGLCanvas: class extends OpenGLSurface {\n \t_target: OpenGLPacked\n \t_renderTarget: GLFramebufferObject\n \tcontext ::= this _context as OpenGLContext\n+\tdraw: override func ~DrawState (drawState: DrawState) {\n+\t\t// Set shader\n+\t\tgpuMap: GpuMap = (drawState map == null) ? this context defaultMap : drawState map as GpuMap\n+\t\t// Set viewport\n+\t\tviewport := (drawState viewport hasZeroArea) ? IntBox2D new(this size) : drawState viewport\n+\t\tthis context backend setViewport(viewport)\n+\t\t// Set transform\n+\t\tgpuMap view = _toLocal * drawState getTransformNormalized() normalizedToReference(this size) * _toLocal\n+\t\t// Set model and projection matrices\n+\t\tif (this _focalLength > 0.0f) {\n+\t\t\ta := 2.0f * this _focalLength / this size x\n+\t\t\tf := -(this _coordinateTransform e as Float) * 2.0f * this _focalLength / this size y\n+\t\t\tk := (this _farPlane + this _nearPlane) / (this _farPlane - this _nearPlane)\n+\t\t\to := 2.0f * this _farPlane * this _nearPlane / (this _farPlane - this _nearPlane)","path":"source/draw/gpu/opengl/OpenGLCanvas.ooc","position":17,"original_position":17,"commit_id":"35239c03acb73a61236976a46f80c6a7ecc2a5f5","original_commit_id":"8df9d7693ab4a52cc57496256eae281329c3b8a9","user":{"login":"davidpiuva","id":10193545,"avatar_url":"https://avatars.githubusercontent.com/u/10193545?v=3","gravatar_id":"","url":"https://api.github.com/users/davidpiuva","html_url":"https://github.com/davidpiuva","followers_url":"https://api.github.com/users/davidpiuva/followers","following_url":"https://api.github.com/users/davidpiuva/following{/other_user}","gists_url":"https://api.github.com/users/davidpiuva/gists{/gist_id}","starred_url":"https://api.github.com/users/davidpiuva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidpiuva/subscriptions","organizations_url":"https://api.github.com/users/davidpiuva/orgs","repos_url":"https://api.github.com/users/davidpiuva/repos","events_url":"https://api.github.com/users/davidpiuva/events{/privacy}","received_events_url":"https://api.github.com/users/davidpiuva/received_events","type":"User","site_admin":false},"body":"Double character names (x1, y1, z1, w1, x2, y2, ...) in transforms would make more sense when switching between 3x3 and 4x4 transforms.","created_at":"2016-01-27T11:13:53Z","updated_at":"2016-01-27T11:13:53Z","html_url":"https://github.com/magic-lang/ooc-kean/pull/1226#discussion_r50970225","pull_request_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1226","_links":{"self":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/comments/50970225"},"html":{"href":"https://github.com/magic-lang/ooc-kean/pull/1226#discussion_r50970225"},"pull_request":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1226"}}},"pull_request":{"url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1226","id":56583911,"html_url":"https://github.com/magic-lang/ooc-kean/pull/1226","diff_url":"https://github.com/magic-lang/ooc-kean/pull/1226.diff","patch_url":"https://github.com/magic-lang/ooc-kean/pull/1226.patch","issue_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues/1226","number":1226,"state":"open","locked":false,"title":"Draw API","user":{"login":"davidpiuva","id":10193545,"avatar_url":"https://avatars.githubusercontent.com/u/10193545?v=3","gravatar_id":"","url":"https://api.github.com/users/davidpiuva","html_url":"https://github.com/davidpiuva","followers_url":"https://api.github.com/users/davidpiuva/followers","following_url":"https://api.github.com/users/davidpiuva/following{/other_user}","gists_url":"https://api.github.com/users/davidpiuva/gists{/gist_id}","starred_url":"https://api.github.com/users/davidpiuva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidpiuva/subscriptions","organizations_url":"https://api.github.com/users/davidpiuva/orgs","repos_url":"https://api.github.com/users/davidpiuva/repos","events_url":"https://api.github.com/users/davidpiuva/events{/privacy}","received_events_url":"https://api.github.com/users/davidpiuva/received_events","type":"User","site_admin":false},"body":"An alternative draw API that can be used next to the old API for backward compability.\r\n\r\nRemaining steps for other pull requests:\r\n* Implement drawing of points, lines and meshes using the Pen cover, source viewport and other new settings.\r\n* Support drawing without GPU.\r\n* Make lots of test cases.\r\n* Slowly get everyone to use the new API while testing everything properly.\r\n* Clean up `pen`, `transform`, `opacity`, `blend`, `viewport`,... from canvas where they do not belong.\r\n* Give matrices in normalized coordinates directly to the vertex shader to reduce the double, tripple, quadruple,... conversions between reference and normalized coordinates.","created_at":"2016-01-20T09:40:56Z","updated_at":"2016-01-27T11:13:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"adbf630766a30627cb545a5ac23951913d16a2fa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1226/commits","review_comments_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1226/comments","review_comment_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/comments{/number}","comments_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues/1226/comments","statuses_url":"https://api.github.com/repos/magic-lang/ooc-kean/statuses/35239c03acb73a61236976a46f80c6a7ecc2a5f5","head":{"label":"davidpiuva:drawRefactor","ref":"drawRefactor","sha":"35239c03acb73a61236976a46f80c6a7ecc2a5f5","user":{"login":"davidpiuva","id":10193545,"avatar_url":"https://avatars.githubusercontent.com/u/10193545?v=3","gravatar_id":"","url":"https://api.github.com/users/davidpiuva","html_url":"https://github.com/davidpiuva","followers_url":"https://api.github.com/users/davidpiuva/followers","following_url":"https://api.github.com/users/davidpiuva/following{/other_user}","gists_url":"https://api.github.com/users/davidpiuva/gists{/gist_id}","starred_url":"https://api.github.com/users/davidpiuva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidpiuva/subscriptions","organizations_url":"https://api.github.com/users/davidpiuva/orgs","repos_url":"https://api.github.com/users/davidpiuva/repos","events_url":"https://api.github.com/users/davidpiuva/events{/privacy}","received_events_url":"https://api.github.com/users/davidpiuva/received_events","type":"User","site_admin":false},"repo":{"id":28035938,"name":"ooc-kean","full_name":"davidpiuva/ooc-kean","owner":{"login":"davidpiuva","id":10193545,"avatar_url":"https://avatars.githubusercontent.com/u/10193545?v=3","gravatar_id":"","url":"https://api.github.com/users/davidpiuva","html_url":"https://github.com/davidpiuva","followers_url":"https://api.github.com/users/davidpiuva/followers","following_url":"https://api.github.com/users/davidpiuva/following{/other_user}","gists_url":"https://api.github.com/users/davidpiuva/gists{/gist_id}","starred_url":"https://api.github.com/users/davidpiuva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidpiuva/subscriptions","organizations_url":"https://api.github.com/users/davidpiuva/orgs","repos_url":"https://api.github.com/users/davidpiuva/repos","events_url":"https://api.github.com/users/davidpiuva/events{/privacy}","received_events_url":"https://api.github.com/users/davidpiuva/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davidpiuva/ooc-kean","description":"OOC port of parts of Kean.","fork":true,"url":"https://api.github.com/repos/davidpiuva/ooc-kean","forks_url":"https://api.github.com/repos/davidpiuva/ooc-kean/forks","keys_url":"https://api.github.com/repos/davidpiuva/ooc-kean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davidpiuva/ooc-kean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davidpiuva/ooc-kean/teams","hooks_url":"https://api.github.com/repos/davidpiuva/ooc-kean/hooks","issue_events_url":"https://api.github.com/repos/davidpiuva/ooc-kean/issues/events{/number}","events_url":"https://api.github.com/repos/davidpiuva/ooc-kean/events","assignees_url":"https://api.github.com/repos/davidpiuva/ooc-kean/assignees{/user}","branches_url":"https://api.github.com/repos/davidpiuva/ooc-kean/branches{/branch}","tags_url":"https://api.github.com/repos/davidpiuva/ooc-kean/tags","blobs_url":"https://api.github.com/repos/davidpiuva/ooc-kean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davidpiuva/ooc-kean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davidpiuva/ooc-kean/git/refs{/sha}","trees_url":"https://api.github.com/repos/davidpiuva/ooc-kean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davidpiuva/ooc-kean/statuses/{sha}","languages_url":"https://api.github.com/repos/davidpiuva/ooc-kean/languages","stargazers_url":"https://api.github.com/repos/davidpiuva/ooc-kean/stargazers","contributors_url":"https://api.github.com/repos/davidpiuva/ooc-kean/contributors","subscribers_url":"https://api.github.com/repos/davidpiuva/ooc-kean/subscribers","subscription_url":"https://api.github.com/repos/davidpiuva/ooc-kean/subscription","commits_url":"https://api.github.com/repos/davidpiuva/ooc-kean/commits{/sha}","git_commits_url":"https://api.github.com/repos/davidpiuva/ooc-kean/git/commits{/sha}","comments_url":"https://api.github.com/repos/davidpiuva/ooc-kean/comments{/number}","issue_comment_url":"https://api.github.com/repos/davidpiuva/ooc-kean/issues/comments{/number}","contents_url":"https://api.github.com/repos/davidpiuva/ooc-kean/contents/{+path}","compare_url":"https://api.github.com/repos/davidpiuva/ooc-kean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davidpiuva/ooc-kean/merges","archive_url":"https://api.github.com/repos/davidpiuva/ooc-kean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davidpiuva/ooc-kean/downloads","issues_url":"https://api.github.com/repos/davidpiuva/ooc-kean/issues{/number}","pulls_url":"https://api.github.com/repos/davidpiuva/ooc-kean/pulls{/number}","milestones_url":"https://api.github.com/repos/davidpiuva/ooc-kean/milestones{/number}","notifications_url":"https://api.github.com/repos/davidpiuva/ooc-kean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davidpiuva/ooc-kean/labels{/name}","releases_url":"https://api.github.com/repos/davidpiuva/ooc-kean/releases{/id}","deployments_url":"https://api.github.com/repos/davidpiuva/ooc-kean/deployments","created_at":"2014-12-15T12:34:56Z","updated_at":"2016-01-21T11:50:29Z","pushed_at":"2016-01-27T10:56:24Z","git_url":"git://github.com/davidpiuva/ooc-kean.git","ssh_url":"git@github.com:davidpiuva/ooc-kean.git","clone_url":"https://github.com/davidpiuva/ooc-kean.git","svn_url":"https://github.com/davidpiuva/ooc-kean","homepage":null,"size":30020,"stargazers_count":0,"watchers_count":0,"language":"ooc","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"magic-lang:master","ref":"master","sha":"a27aedf91631b29f3a52390763dd9c101584f2bc","user":{"login":"magic-lang","id":16756691,"avatar_url":"https://avatars.githubusercontent.com/u/16756691?v=3","gravatar_id":"","url":"https://api.github.com/users/magic-lang","html_url":"https://github.com/magic-lang","followers_url":"https://api.github.com/users/magic-lang/followers","following_url":"https://api.github.com/users/magic-lang/following{/other_user}","gists_url":"https://api.github.com/users/magic-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/magic-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magic-lang/subscriptions","organizations_url":"https://api.github.com/users/magic-lang/orgs","repos_url":"https://api.github.com/users/magic-lang/repos","events_url":"https://api.github.com/users/magic-lang/events{/privacy}","received_events_url":"https://api.github.com/users/magic-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":25256330,"name":"ooc-kean","full_name":"magic-lang/ooc-kean","owner":{"login":"magic-lang","id":16756691,"avatar_url":"https://avatars.githubusercontent.com/u/16756691?v=3","gravatar_id":"","url":"https://api.github.com/users/magic-lang","html_url":"https://github.com/magic-lang","followers_url":"https://api.github.com/users/magic-lang/followers","following_url":"https://api.github.com/users/magic-lang/following{/other_user}","gists_url":"https://api.github.com/users/magic-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/magic-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magic-lang/subscriptions","organizations_url":"https://api.github.com/users/magic-lang/orgs","repos_url":"https://api.github.com/users/magic-lang/repos","events_url":"https://api.github.com/users/magic-lang/events{/privacy}","received_events_url":"https://api.github.com/users/magic-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/magic-lang/ooc-kean","description":"ooc port of parts of Kean.","fork":false,"url":"https://api.github.com/repos/magic-lang/ooc-kean","forks_url":"https://api.github.com/repos/magic-lang/ooc-kean/forks","keys_url":"https://api.github.com/repos/magic-lang/ooc-kean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magic-lang/ooc-kean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magic-lang/ooc-kean/teams","hooks_url":"https://api.github.com/repos/magic-lang/ooc-kean/hooks","issue_events_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues/events{/number}","events_url":"https://api.github.com/repos/magic-lang/ooc-kean/events","assignees_url":"https://api.github.com/repos/magic-lang/ooc-kean/assignees{/user}","branches_url":"https://api.github.com/repos/magic-lang/ooc-kean/branches{/branch}","tags_url":"https://api.github.com/repos/magic-lang/ooc-kean/tags","blobs_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/refs{/sha}","trees_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magic-lang/ooc-kean/statuses/{sha}","languages_url":"https://api.github.com/repos/magic-lang/ooc-kean/languages","stargazers_url":"https://api.github.com/repos/magic-lang/ooc-kean/stargazers","contributors_url":"https://api.github.com/repos/magic-lang/ooc-kean/contributors","subscribers_url":"https://api.github.com/repos/magic-lang/ooc-kean/subscribers","subscription_url":"https://api.github.com/repos/magic-lang/ooc-kean/subscription","commits_url":"https://api.github.com/repos/magic-lang/ooc-kean/commits{/sha}","git_commits_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/commits{/sha}","comments_url":"https://api.github.com/repos/magic-lang/ooc-kean/comments{/number}","issue_comment_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues/comments{/number}","contents_url":"https://api.github.com/repos/magic-lang/ooc-kean/contents/{+path}","compare_url":"https://api.github.com/repos/magic-lang/ooc-kean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magic-lang/ooc-kean/merges","archive_url":"https://api.github.com/repos/magic-lang/ooc-kean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magic-lang/ooc-kean/downloads","issues_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues{/number}","pulls_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls{/number}","milestones_url":"https://api.github.com/repos/magic-lang/ooc-kean/milestones{/number}","notifications_url":"https://api.github.com/repos/magic-lang/ooc-kean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magic-lang/ooc-kean/labels{/name}","releases_url":"https://api.github.com/repos/magic-lang/ooc-kean/releases{/id}","deployments_url":"https://api.github.com/repos/magic-lang/ooc-kean/deployments","created_at":"2014-10-15T13:42:17Z","updated_at":"2016-01-21T11:50:29Z","pushed_at":"2016-01-27T11:10:01Z","git_url":"git://github.com/magic-lang/ooc-kean.git","ssh_url":"git@github.com:magic-lang/ooc-kean.git","clone_url":"https://github.com/magic-lang/ooc-kean.git","svn_url":"https://github.com/magic-lang/ooc-kean","homepage":"","size":30539,"stargazers_count":3,"watchers_count":3,"language":"ooc","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":58,"forks":19,"open_issues":58,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1226"},"html":{"href":"https://github.com/magic-lang/ooc-kean/pull/1226"},"issue":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/issues/1226"},"comments":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/issues/1226/comments"},"review_comments":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1226/comments"},"review_comment":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1226/commits"},"statuses":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/statuses/35239c03acb73a61236976a46f80c6a7ecc2a5f5"}}}}