{"action":"created","comment":{"url":"https://api.github.com/repos/fholger/thedarkmod/pulls/comments/197498088","pull_request_review_id":131257250,"id":197498088,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzQ5ODA4OA==","diff_hunk":"@@ -464,3 +464,221 @@ void FB_TogglePrimary( bool on ) {\n \telse\n \t\tLeavePrimary();\n }\n+\n+frameBuffers_t frameBuffers;\n+\n+void FB_InitFrameBuffers() {\n+\tFB_ShutdownFrameBuffers();\n+\n+\tFrameBuffer *backBuffer = FrameBuffer::BackBuffer();\n+\tframeBuffers.finalOutput = backBuffer;\n+\n+\tif( r_useFbo.GetBool() ) {\n+\t\t\n+\t} else {\n+\t\tframeBuffers.primary = backBuffer;\n+\t\tframeBuffers.resolve = backBuffer;\n+\t\tframeBuffers.lightgem = backBuffer;\n+\t}\n+}\n+\n+void FB_ShutdownFrameBuffers() {\n+\tfor( auto it : frameBuffers.allFrameBuffers ) {\n+\t\tdelete it;\n+\t}\n+\tframeBuffers.allFrameBuffers.clear();\n+\n+\tframeBuffers.primary = nullptr;\n+\tframeBuffers.resolve = nullptr;\n+\tframeBuffers.lightgem = nullptr;\n+\tframeBuffers.backBuffer = nullptr;\n+\tframeBuffers.finalOutput = nullptr;\n+\tframeBuffers.currentDraw = nullptr;\n+\tframeBuffers.currentRead = nullptr;\n+}\n+\n+FrameBuffer::FrameBuffer( GLuint fbo, GLuint width, GLuint height, int msaa )\n+\t: fbo( fbo ), colorBuffer( 0 ), depthStencilBuffer( 0 ), width( width ), height( height ), msaa( msaa ) {\n+}\n+\n+\n+FrameBuffer::~FrameBuffer() {\n+\tif( fbo != 0 ) {\n+\t\tqglDeleteFramebuffers( 1, &fbo );\n+\t}\n+\tif( colorBuffer != 0 ) {\n+\t\tqglDeleteRenderbuffers( 1, &colorBuffer );\n+\t}\n+\tif( depthStencilBuffer != 0 ) {\n+\t\tqglDeleteRenderbuffers( 1, &depthStencilBuffer );\n+\t}\n+}\n+\n+FrameBuffer * FrameBuffer::Create( GLuint width, GLuint height, int msaa ) {\n+\tGLuint fbo = 0;\n+\tqglGenFramebuffers( 1, &fbo );\n+\tif( fbo == 0 ) {\n+\t\tcommon->FatalError( \"Failed to allocate framebuffer object\" );\n+\t}\n+\n+\tFrameBuffer *frameBuffer = new FrameBuffer( fbo, width, height, msaa );\n+\tframeBuffers.allFrameBuffers.push_back( frameBuffer );\n+\tcommon->Printf( \"FBO created: %dx%d, AA = %d\\n\", width, height, msaa );\n+\treturn frameBuffer;\n+}\n+\n+FrameBuffer * FrameBuffer::BackBuffer() {\n+\tif( frameBuffers.backBuffer == 0 ) {\n+\t\tframeBuffers.backBuffer = new FrameBuffer( 0, glConfig.vidWidth, glConfig.vidHeight, 0 );\n+\t\tframeBuffers.allFrameBuffers.push_back( frameBuffers.backBuffer );\n+\t\tcommon->Printf( \"Backbuffer dimensions: %dx%d\\n\", frameBuffers.backBuffer->width, frameBuffers.backBuffer->height );\n+\t}\n+\treturn frameBuffers.backBuffer;\n+}\n+\n+void FrameBuffer::CreateColorBuffer() {\n+\tif( colorBuffer == 0 ) {\n+\t\tqglGenRenderbuffers( 1, &colorBuffer );\n+\t\tif( colorBuffer == 0 ) {\n+\t\t\tcommon->FatalError( \"Failed to allocate color render buffer\" );\n+\t\t}\n+\t}\n+\tqglBindRenderbuffer( GL_RENDERBUFFER, colorBuffer );\n+\tif( msaa > 1 ) {\n+\t\tqglRenderbufferStorageMultisample( GL_RENDERBUFFER, msaa, GL_RGBA, width, height );","path":"renderer/FrameBuffer.cpp","position":85,"original_position":85,"commit_id":"a9db53b1cbb06b75e90d068e4f893fe155f28d27","original_commit_id":"a9db53b1cbb06b75e90d068e4f893fe155f28d27","user":{"login":"stgatilov","id":13484213,"node_id":"MDQ6VXNlcjEzNDg0MjEz","avatar_url":"https://avatars2.githubusercontent.com/u/13484213?v=4","gravatar_id":"","url":"https://api.github.com/users/stgatilov","html_url":"https://github.com/stgatilov","followers_url":"https://api.github.com/users/stgatilov/followers","following_url":"https://api.github.com/users/stgatilov/following{/other_user}","gists_url":"https://api.github.com/users/stgatilov/gists{/gist_id}","starred_url":"https://api.github.com/users/stgatilov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stgatilov/subscriptions","organizations_url":"https://api.github.com/users/stgatilov/orgs","repos_url":"https://api.github.com/users/stgatilov/repos","events_url":"https://api.github.com/users/stgatilov/events{/privacy}","received_events_url":"https://api.github.com/users/stgatilov/received_events","type":"User","site_admin":false},"body":"Since we are eager to support EXT_framebuffer extensions for 2.07, it is probably worth checking if this function pointer is not NULL, with fallback to creating non-multisampled renderbuffer if function is missing.\r\nThis is one tiny fix to line 547 =)\r\n\r\nEDIT: or maybe it would be better to do this check in `FrameBuffer::Create` and change msaa right there.","created_at":"2018-06-22T16:22:18Z","updated_at":"2018-06-22T16:40:53Z","html_url":"https://github.com/fholger/thedarkmod/pull/6#discussion_r197498088","pull_request_url":"https://api.github.com/repos/fholger/thedarkmod/pulls/6","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/fholger/thedarkmod/pulls/comments/197498088"},"html":{"href":"https://github.com/fholger/thedarkmod/pull/6#discussion_r197498088"},"pull_request":{"href":"https://api.github.com/repos/fholger/thedarkmod/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/fholger/thedarkmod/pulls/6","id":196259193,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2MjU5MTkz","html_url":"https://github.com/fholger/thedarkmod/pull/6","diff_url":"https://github.com/fholger/thedarkmod/pull/6.diff","patch_url":"https://github.com/fholger/thedarkmod/pull/6.patch","issue_url":"https://api.github.com/repos/fholger/thedarkmod/issues/6","number":6,"state":"open","locked":false,"title":"FrameBuffer refactor","user":{"login":"fholger","id":8431552,"node_id":"MDQ6VXNlcjg0MzE1NTI=","avatar_url":"https://avatars3.githubusercontent.com/u/8431552?v=4","gravatar_id":"","url":"https://api.github.com/users/fholger","html_url":"https://github.com/fholger","followers_url":"https://api.github.com/users/fholger/followers","following_url":"https://api.github.com/users/fholger/following{/other_user}","gists_url":"https://api.github.com/users/fholger/gists{/gist_id}","starred_url":"https://api.github.com/users/fholger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fholger/subscriptions","organizations_url":"https://api.github.com/users/fholger/orgs","repos_url":"https://api.github.com/users/fholger/repos","events_url":"https://api.github.com/users/fholger/events{/privacy}","received_events_url":"https://api.github.com/users/fholger/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-20T20:14:24Z","updated_at":"2018-06-22T16:40:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"89bfebc7c58eb888cc4dcb5c076de9e931509dbe","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/fholger/thedarkmod/pulls/6/commits","review_comments_url":"https://api.github.com/repos/fholger/thedarkmod/pulls/6/comments","review_comment_url":"https://api.github.com/repos/fholger/thedarkmod/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fholger/thedarkmod/issues/6/comments","statuses_url":"https://api.github.com/repos/fholger/thedarkmod/statuses/a9db53b1cbb06b75e90d068e4f893fe155f28d27","head":{"label":"fholger:framebuffers","ref":"framebuffers","sha":"a9db53b1cbb06b75e90d068e4f893fe155f28d27","user":{"login":"fholger","id":8431552,"node_id":"MDQ6VXNlcjg0MzE1NTI=","avatar_url":"https://avatars3.githubusercontent.com/u/8431552?v=4","gravatar_id":"","url":"https://api.github.com/users/fholger","html_url":"https://github.com/fholger","followers_url":"https://api.github.com/users/fholger/followers","following_url":"https://api.github.com/users/fholger/following{/other_user}","gists_url":"https://api.github.com/users/fholger/gists{/gist_id}","starred_url":"https://api.github.com/users/fholger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fholger/subscriptions","organizations_url":"https://api.github.com/users/fholger/orgs","repos_url":"https://api.github.com/users/fholger/repos","events_url":"https://api.github.com/users/fholger/events{/privacy}","received_events_url":"https://api.github.com/users/fholger/received_events","type":"User","site_admin":false},"repo":{"id":102270345,"node_id":"MDEwOlJlcG9zaXRvcnkxMDIyNzAzNDU=","name":"thedarkmod","full_name":"fholger/thedarkmod","owner":{"login":"fholger","id":8431552,"node_id":"MDQ6VXNlcjg0MzE1NTI=","avatar_url":"https://avatars3.githubusercontent.com/u/8431552?v=4","gravatar_id":"","url":"https://api.github.com/users/fholger","html_url":"https://github.com/fholger","followers_url":"https://api.github.com/users/fholger/followers","following_url":"https://api.github.com/users/fholger/following{/other_user}","gists_url":"https://api.github.com/users/fholger/gists{/gist_id}","starred_url":"https://api.github.com/users/fholger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fholger/subscriptions","organizations_url":"https://api.github.com/users/fholger/orgs","repos_url":"https://api.github.com/users/fholger/repos","events_url":"https://api.github.com/users/fholger/events{/privacy}","received_events_url":"https://api.github.com/users/fholger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fholger/thedarkmod","description":"Experimental porting of Doom3 BFG features to The Dark Mod","fork":false,"url":"https://api.github.com/repos/fholger/thedarkmod","forks_url":"https://api.github.com/repos/fholger/thedarkmod/forks","keys_url":"https://api.github.com/repos/fholger/thedarkmod/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fholger/thedarkmod/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fholger/thedarkmod/teams","hooks_url":"https://api.github.com/repos/fholger/thedarkmod/hooks","issue_events_url":"https://api.github.com/repos/fholger/thedarkmod/issues/events{/number}","events_url":"https://api.github.com/repos/fholger/thedarkmod/events","assignees_url":"https://api.github.com/repos/fholger/thedarkmod/assignees{/user}","branches_url":"https://api.github.com/repos/fholger/thedarkmod/branches{/branch}","tags_url":"https://api.github.com/repos/fholger/thedarkmod/tags","blobs_url":"https://api.github.com/repos/fholger/thedarkmod/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fholger/thedarkmod/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fholger/thedarkmod/git/refs{/sha}","trees_url":"https://api.github.com/repos/fholger/thedarkmod/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fholger/thedarkmod/statuses/{sha}","languages_url":"https://api.github.com/repos/fholger/thedarkmod/languages","stargazers_url":"https://api.github.com/repos/fholger/thedarkmod/stargazers","contributors_url":"https://api.github.com/repos/fholger/thedarkmod/contributors","subscribers_url":"https://api.github.com/repos/fholger/thedarkmod/subscribers","subscription_url":"https://api.github.com/repos/fholger/thedarkmod/subscription","commits_url":"https://api.github.com/repos/fholger/thedarkmod/commits{/sha}","git_commits_url":"https://api.github.com/repos/fholger/thedarkmod/git/commits{/sha}","comments_url":"https://api.github.com/repos/fholger/thedarkmod/comments{/number}","issue_comment_url":"https://api.github.com/repos/fholger/thedarkmod/issues/comments{/number}","contents_url":"https://api.github.com/repos/fholger/thedarkmod/contents/{+path}","compare_url":"https://api.github.com/repos/fholger/thedarkmod/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fholger/thedarkmod/merges","archive_url":"https://api.github.com/repos/fholger/thedarkmod/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fholger/thedarkmod/downloads","issues_url":"https://api.github.com/repos/fholger/thedarkmod/issues{/number}","pulls_url":"https://api.github.com/repos/fholger/thedarkmod/pulls{/number}","milestones_url":"https://api.github.com/repos/fholger/thedarkmod/milestones{/number}","notifications_url":"https://api.github.com/repos/fholger/thedarkmod/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fholger/thedarkmod/labels{/name}","releases_url":"https://api.github.com/repos/fholger/thedarkmod/releases{/id}","deployments_url":"https://api.github.com/repos/fholger/thedarkmod/deployments","created_at":"2017-09-03T14:29:01Z","updated_at":"2018-06-22T15:06:08Z","pushed_at":"2018-06-22T15:06:06Z","git_url":"git://github.com/fholger/thedarkmod.git","ssh_url":"git@github.com:fholger/thedarkmod.git","clone_url":"https://github.com/fholger/thedarkmod.git","svn_url":"https://github.com/fholger/thedarkmod","homepage":null,"size":251738,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1,"open_issues":2,"watchers":3,"default_branch":"master"}},"base":{"label":"fholger:master","ref":"master","sha":"86046c57425f71a4332b59783e5f23f763577c45","user":{"login":"fholger","id":8431552,"node_id":"MDQ6VXNlcjg0MzE1NTI=","avatar_url":"https://avatars3.githubusercontent.com/u/8431552?v=4","gravatar_id":"","url":"https://api.github.com/users/fholger","html_url":"https://github.com/fholger","followers_url":"https://api.github.com/users/fholger/followers","following_url":"https://api.github.com/users/fholger/following{/other_user}","gists_url":"https://api.github.com/users/fholger/gists{/gist_id}","starred_url":"https://api.github.com/users/fholger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fholger/subscriptions","organizations_url":"https://api.github.com/users/fholger/orgs","repos_url":"https://api.github.com/users/fholger/repos","events_url":"https://api.github.com/users/fholger/events{/privacy}","received_events_url":"https://api.github.com/users/fholger/received_events","type":"User","site_admin":false},"repo":{"id":102270345,"node_id":"MDEwOlJlcG9zaXRvcnkxMDIyNzAzNDU=","name":"thedarkmod","full_name":"fholger/thedarkmod","owner":{"login":"fholger","id":8431552,"node_id":"MDQ6VXNlcjg0MzE1NTI=","avatar_url":"https://avatars3.githubusercontent.com/u/8431552?v=4","gravatar_id":"","url":"https://api.github.com/users/fholger","html_url":"https://github.com/fholger","followers_url":"https://api.github.com/users/fholger/followers","following_url":"https://api.github.com/users/fholger/following{/other_user}","gists_url":"https://api.github.com/users/fholger/gists{/gist_id}","starred_url":"https://api.github.com/users/fholger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fholger/subscriptions","organizations_url":"https://api.github.com/users/fholger/orgs","repos_url":"https://api.github.com/users/fholger/repos","events_url":"https://api.github.com/users/fholger/events{/privacy}","received_events_url":"https://api.github.com/users/fholger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fholger/thedarkmod","description":"Experimental porting of Doom3 BFG features to The Dark Mod","fork":false,"url":"https://api.github.com/repos/fholger/thedarkmod","forks_url":"https://api.github.com/repos/fholger/thedarkmod/forks","keys_url":"https://api.github.com/repos/fholger/thedarkmod/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fholger/thedarkmod/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fholger/thedarkmod/teams","hooks_url":"https://api.github.com/repos/fholger/thedarkmod/hooks","issue_events_url":"https://api.github.com/repos/fholger/thedarkmod/issues/events{/number}","events_url":"https://api.github.com/repos/fholger/thedarkmod/events","assignees_url":"https://api.github.com/repos/fholger/thedarkmod/assignees{/user}","branches_url":"https://api.github.com/repos/fholger/thedarkmod/branches{/branch}","tags_url":"https://api.github.com/repos/fholger/thedarkmod/tags","blobs_url":"https://api.github.com/repos/fholger/thedarkmod/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fholger/thedarkmod/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fholger/thedarkmod/git/refs{/sha}","trees_url":"https://api.github.com/repos/fholger/thedarkmod/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fholger/thedarkmod/statuses/{sha}","languages_url":"https://api.github.com/repos/fholger/thedarkmod/languages","stargazers_url":"https://api.github.com/repos/fholger/thedarkmod/stargazers","contributors_url":"https://api.github.com/repos/fholger/thedarkmod/contributors","subscribers_url":"https://api.github.com/repos/fholger/thedarkmod/subscribers","subscription_url":"https://api.github.com/repos/fholger/thedarkmod/subscription","commits_url":"https://api.github.com/repos/fholger/thedarkmod/commits{/sha}","git_commits_url":"https://api.github.com/repos/fholger/thedarkmod/git/commits{/sha}","comments_url":"https://api.github.com/repos/fholger/thedarkmod/comments{/number}","issue_comment_url":"https://api.github.com/repos/fholger/thedarkmod/issues/comments{/number}","contents_url":"https://api.github.com/repos/fholger/thedarkmod/contents/{+path}","compare_url":"https://api.github.com/repos/fholger/thedarkmod/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fholger/thedarkmod/merges","archive_url":"https://api.github.com/repos/fholger/thedarkmod/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fholger/thedarkmod/downloads","issues_url":"https://api.github.com/repos/fholger/thedarkmod/issues{/number}","pulls_url":"https://api.github.com/repos/fholger/thedarkmod/pulls{/number}","milestones_url":"https://api.github.com/repos/fholger/thedarkmod/milestones{/number}","notifications_url":"https://api.github.com/repos/fholger/thedarkmod/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fholger/thedarkmod/labels{/name}","releases_url":"https://api.github.com/repos/fholger/thedarkmod/releases{/id}","deployments_url":"https://api.github.com/repos/fholger/thedarkmod/deployments","created_at":"2017-09-03T14:29:01Z","updated_at":"2018-06-22T15:06:08Z","pushed_at":"2018-06-22T15:06:06Z","git_url":"git://github.com/fholger/thedarkmod.git","ssh_url":"git@github.com:fholger/thedarkmod.git","clone_url":"https://github.com/fholger/thedarkmod.git","svn_url":"https://github.com/fholger/thedarkmod","homepage":null,"size":251738,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fholger/thedarkmod/pulls/6"},"html":{"href":"https://github.com/fholger/thedarkmod/pull/6"},"issue":{"href":"https://api.github.com/repos/fholger/thedarkmod/issues/6"},"comments":{"href":"https://api.github.com/repos/fholger/thedarkmod/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/fholger/thedarkmod/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/fholger/thedarkmod/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fholger/thedarkmod/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/fholger/thedarkmod/statuses/a9db53b1cbb06b75e90d068e4f893fe155f28d27"}},"author_association":"OWNER"}}
{"actor":{"display_login":"stgatilov"}}