{"action":"created","comment":{"url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/pulls/comments/317395246","pull_request_review_id":279332280,"id":317395246,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxNzM5NTI0Ng==","diff_hunk":"@@ -0,0 +1,210 @@\n+#include \"shader.h\"\n+\n+using namespace lc::viewer::opengl;\n+\n+Shader::Shader()\n+{\n+}\n+\n+Shader::~Shader()\n+{\n+  glDeleteProgram(_shader_id);\n+}\n+\n+void Shader::gen(const std::string& filepath)\n+{\n+  _shader_id=0;\n+  _file_path=filepath;\n+\n+  ShaderProgramSource source=parseShader(_file_path);\n+\n+  unsigned int vertexshaderID=0;\n+  unsigned int geometryshaderID=0;\n+  unsigned int fragmentshaderID=0;\n+    \n+\n+  vertexshaderID=compileShaders(source.vertexSource,GL_VERTEX_SHADER);\n+  \n+  if(_has_geometry)\n+  geometryshaderID=compileShaders(source.geometrySource,GL_GEOMETRY_SHADER);\n+  \n+  fragmentshaderID=compileShaders(source.fragmentSource,GL_FRAGMENT_SHADER);\n+    \n+  _shader_id= linkProgram(vertexshaderID,geometryshaderID,fragmentshaderID);\n+\n+  bind();\n+}\n+\n+unsigned int Shader::getID() const\n+{\n+  return _shader_id;\n+}\n+\n+ShaderProgramSource Shader:: parseShader(const std::string& filepath)\n+{\n+  std::ifstream stream(filepath);\n+\n+  enum ShaderType{\n+    NONE=-1, VERTEX =0,GEOMETRY=1,FRAGMENT=2\n+  };\n+\n+  std::string line;\n+  std::stringstream ss[3];\n+  ShaderType type=ShaderType::NONE;\n+\n+  while(getline(stream,line))\n+  {\n+    if(line.find(\"#shader\")!= std::string::npos)\n+    {\n+      if(line.find(\"vertex\")!=std::string::npos)\n+        type=ShaderType::VERTEX;\n+      else if(line.find(\"geometry\")!=std::string::npos)\n+      {\n+        type=ShaderType::GEOMETRY;\n+        _has_geometry=true;\n+      }\n+      else if(line.find(\"fragment\")!=std::string::npos)\n+        type=ShaderType::FRAGMENT;\n+    }\n+    else\n+    {\n+      ss[(int)type]<< line <<'\\n';\n+    }\n+  }\n+   \n+  return { ss[0].str() ,ss[1].str() ,ss[2].str() };\n+}\n+\n+unsigned int Shader:: compileShaders(std::string shader, GLenum type)\n+{\n+  const char* shaderCode= shader.c_str();\n+  GLuint shaderID= glCreateShader(type);\n+\n+  if(shaderID==0)\n+  {\n+    //std::cout<<type<<\" not created\"<<std::endl;","path":"lcviewernoqt/painters/opengl/sources/shader.cpp","position":85,"original_position":85,"commit_id":"4b43e5fbf3cec704711dae233e8075a2222360a7","original_commit_id":"4b43e5fbf3cec704711dae233e8075a2222360a7","user":{"login":"feragon","id":4079818,"node_id":"MDQ6VXNlcjQwNzk4MTg=","avatar_url":"https://avatars0.githubusercontent.com/u/4079818?v=4","gravatar_id":"","url":"https://api.github.com/users/feragon","html_url":"https://github.com/feragon","followers_url":"https://api.github.com/users/feragon/followers","following_url":"https://api.github.com/users/feragon/following{/other_user}","gists_url":"https://api.github.com/users/feragon/gists{/gist_id}","starred_url":"https://api.github.com/users/feragon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feragon/subscriptions","organizations_url":"https://api.github.com/users/feragon/orgs","repos_url":"https://api.github.com/users/feragon/repos","events_url":"https://api.github.com/users/feragon/events{/privacy}","received_events_url":"https://api.github.com/users/feragon/received_events","type":"User","site_admin":false},"body":"There is commented code here","created_at":"2019-08-25T12:08:07Z","updated_at":"2019-08-25T12:14:53Z","html_url":"https://github.com/LibreCAD/LibreCAD_3/pull/229#discussion_r317395246","pull_request_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/pulls/229","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/LibreCAD/LibreCAD_3/pulls/comments/317395246"},"html":{"href":"https://github.com/LibreCAD/LibreCAD_3/pull/229#discussion_r317395246"},"pull_request":{"href":"https://api.github.com/repos/LibreCAD/LibreCAD_3/pulls/229"}}},"pull_request":{"url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/pulls/229","id":310085514,"node_id":"MDExOlB1bGxSZXF1ZXN0MzEwMDg1NTE0","html_url":"https://github.com/LibreCAD/LibreCAD_3/pull/229","diff_url":"https://github.com/LibreCAD/LibreCAD_3/pull/229.diff","patch_url":"https://github.com/LibreCAD/LibreCAD_3/pull/229.patch","issue_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/issues/229","number":229,"state":"open","locked":false,"title":"OpenGL Rendering Implemented","user":{"login":"sckorpio","id":26852658,"node_id":"MDQ6VXNlcjI2ODUyNjU4","avatar_url":"https://avatars2.githubusercontent.com/u/26852658?v=4","gravatar_id":"","url":"https://api.github.com/users/sckorpio","html_url":"https://github.com/sckorpio","followers_url":"https://api.github.com/users/sckorpio/followers","following_url":"https://api.github.com/users/sckorpio/following{/other_user}","gists_url":"https://api.github.com/users/sckorpio/gists{/gist_id}","starred_url":"https://api.github.com/users/sckorpio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sckorpio/subscriptions","organizations_url":"https://api.github.com/users/sckorpio/orgs","repos_url":"https://api.github.com/users/sckorpio/repos","events_url":"https://api.github.com/users/sckorpio/events{/privacy}","received_events_url":"https://api.github.com/users/sckorpio/received_events","type":"User","site_admin":false},"body":"Finished the OpenGL Rendering module!!!","created_at":"2019-08-22T18:26:25Z","updated_at":"2019-08-25T12:14:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b694b2453d6dcbd8d2960e7aa495aded1af3f36c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/pulls/229/commits","review_comments_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/pulls/229/comments","review_comment_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/issues/229/comments","statuses_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/statuses/4b43e5fbf3cec704711dae233e8075a2222360a7","head":{"label":"sckorpio:master","ref":"master","sha":"4b43e5fbf3cec704711dae233e8075a2222360a7","user":{"login":"sckorpio","id":26852658,"node_id":"MDQ6VXNlcjI2ODUyNjU4","avatar_url":"https://avatars2.githubusercontent.com/u/26852658?v=4","gravatar_id":"","url":"https://api.github.com/users/sckorpio","html_url":"https://github.com/sckorpio","followers_url":"https://api.github.com/users/sckorpio/followers","following_url":"https://api.github.com/users/sckorpio/following{/other_user}","gists_url":"https://api.github.com/users/sckorpio/gists{/gist_id}","starred_url":"https://api.github.com/users/sckorpio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sckorpio/subscriptions","organizations_url":"https://api.github.com/users/sckorpio/orgs","repos_url":"https://api.github.com/users/sckorpio/repos","events_url":"https://api.github.com/users/sckorpio/events{/privacy}","received_events_url":"https://api.github.com/users/sckorpio/received_events","type":"User","site_admin":false},"repo":{"id":178679651,"node_id":"MDEwOlJlcG9zaXRvcnkxNzg2Nzk2NTE=","name":"LibreCAD_3","full_name":"sckorpio/LibreCAD_3","private":false,"owner":{"login":"sckorpio","id":26852658,"node_id":"MDQ6VXNlcjI2ODUyNjU4","avatar_url":"https://avatars2.githubusercontent.com/u/26852658?v=4","gravatar_id":"","url":"https://api.github.com/users/sckorpio","html_url":"https://github.com/sckorpio","followers_url":"https://api.github.com/users/sckorpio/followers","following_url":"https://api.github.com/users/sckorpio/following{/other_user}","gists_url":"https://api.github.com/users/sckorpio/gists{/gist_id}","starred_url":"https://api.github.com/users/sckorpio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sckorpio/subscriptions","organizations_url":"https://api.github.com/users/sckorpio/orgs","repos_url":"https://api.github.com/users/sckorpio/repos","events_url":"https://api.github.com/users/sckorpio/events{/privacy}","received_events_url":"https://api.github.com/users/sckorpio/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sckorpio/LibreCAD_3","description":"LibreCAD 3 is a next generation 2D CAD application written to be modular, with a core independent from GUI toolkits. Scripting is possible with Lua. ","fork":true,"url":"https://api.github.com/repos/sckorpio/LibreCAD_3","forks_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/forks","keys_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/teams","hooks_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/hooks","issue_events_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/issues/events{/number}","events_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/events","assignees_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/assignees{/user}","branches_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/branches{/branch}","tags_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/tags","blobs_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/git/refs{/sha}","trees_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/statuses/{sha}","languages_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/languages","stargazers_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/stargazers","contributors_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/contributors","subscribers_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/subscribers","subscription_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/subscription","commits_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/commits{/sha}","git_commits_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/git/commits{/sha}","comments_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/comments{/number}","issue_comment_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/issues/comments{/number}","contents_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/contents/{+path}","compare_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/merges","archive_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/downloads","issues_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/issues{/number}","pulls_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/pulls{/number}","milestones_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/milestones{/number}","notifications_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/labels{/name}","releases_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/releases{/id}","deployments_url":"https://api.github.com/repos/sckorpio/LibreCAD_3/deployments","created_at":"2019-03-31T11:35:26Z","updated_at":"2019-08-25T06:12:05Z","pushed_at":"2019-08-25T06:12:03Z","git_url":"git://github.com/sckorpio/LibreCAD_3.git","ssh_url":"git@github.com:sckorpio/LibreCAD_3.git","clone_url":"https://github.com/sckorpio/LibreCAD_3.git","svn_url":"https://github.com/sckorpio/LibreCAD_3","homepage":"http://librecad.org","size":8572,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"LibreCAD:master","ref":"master","sha":"0d6828a80522e8853400ee1d0c8e0d809e40560c","user":{"login":"LibreCAD","id":721219,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcyMTIxOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/721219?v=4","gravatar_id":"","url":"https://api.github.com/users/LibreCAD","html_url":"https://github.com/LibreCAD","followers_url":"https://api.github.com/users/LibreCAD/followers","following_url":"https://api.github.com/users/LibreCAD/following{/other_user}","gists_url":"https://api.github.com/users/LibreCAD/gists{/gist_id}","starred_url":"https://api.github.com/users/LibreCAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LibreCAD/subscriptions","organizations_url":"https://api.github.com/users/LibreCAD/orgs","repos_url":"https://api.github.com/users/LibreCAD/repos","events_url":"https://api.github.com/users/LibreCAD/events{/privacy}","received_events_url":"https://api.github.com/users/LibreCAD/received_events","type":"Organization","site_admin":false},"repo":{"id":19827343,"node_id":"MDEwOlJlcG9zaXRvcnkxOTgyNzM0Mw==","name":"LibreCAD_3","full_name":"LibreCAD/LibreCAD_3","private":false,"owner":{"login":"LibreCAD","id":721219,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcyMTIxOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/721219?v=4","gravatar_id":"","url":"https://api.github.com/users/LibreCAD","html_url":"https://github.com/LibreCAD","followers_url":"https://api.github.com/users/LibreCAD/followers","following_url":"https://api.github.com/users/LibreCAD/following{/other_user}","gists_url":"https://api.github.com/users/LibreCAD/gists{/gist_id}","starred_url":"https://api.github.com/users/LibreCAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LibreCAD/subscriptions","organizations_url":"https://api.github.com/users/LibreCAD/orgs","repos_url":"https://api.github.com/users/LibreCAD/repos","events_url":"https://api.github.com/users/LibreCAD/events{/privacy}","received_events_url":"https://api.github.com/users/LibreCAD/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/LibreCAD/LibreCAD_3","description":"LibreCAD 3 is a next generation 2D CAD application written to be modular, with a core independent from GUI toolkits. Scripting is possible with Lua. ","fork":false,"url":"https://api.github.com/repos/LibreCAD/LibreCAD_3","forks_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/forks","keys_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/teams","hooks_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/hooks","issue_events_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/issues/events{/number}","events_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/events","assignees_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/assignees{/user}","branches_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/branches{/branch}","tags_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/tags","blobs_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/git/refs{/sha}","trees_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/statuses/{sha}","languages_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/languages","stargazers_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/stargazers","contributors_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/contributors","subscribers_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/subscribers","subscription_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/subscription","commits_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/commits{/sha}","git_commits_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/git/commits{/sha}","comments_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/comments{/number}","issue_comment_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/issues/comments{/number}","contents_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/contents/{+path}","compare_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/merges","archive_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/downloads","issues_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/issues{/number}","pulls_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/pulls{/number}","milestones_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/milestones{/number}","notifications_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/labels{/name}","releases_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/releases{/id}","deployments_url":"https://api.github.com/repos/LibreCAD/LibreCAD_3/deployments","created_at":"2014-05-15T16:44:30Z","updated_at":"2019-08-23T23:20:46Z","pushed_at":"2019-08-25T06:12:05Z","git_url":"git://github.com/LibreCAD/LibreCAD_3.git","ssh_url":"git@github.com:LibreCAD/LibreCAD_3.git","clone_url":"https://github.com/LibreCAD/LibreCAD_3.git","svn_url":"https://github.com/LibreCAD/LibreCAD_3","homepage":"http://librecad.org","size":8104,"stargazers_count":103,"watchers_count":103,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":64,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":23,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":64,"open_issues":23,"watchers":103,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/LibreCAD/LibreCAD_3/pulls/229"},"html":{"href":"https://github.com/LibreCAD/LibreCAD_3/pull/229"},"issue":{"href":"https://api.github.com/repos/LibreCAD/LibreCAD_3/issues/229"},"comments":{"href":"https://api.github.com/repos/LibreCAD/LibreCAD_3/issues/229/comments"},"review_comments":{"href":"https://api.github.com/repos/LibreCAD/LibreCAD_3/pulls/229/comments"},"review_comment":{"href":"https://api.github.com/repos/LibreCAD/LibreCAD_3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LibreCAD/LibreCAD_3/pulls/229/commits"},"statuses":{"href":"https://api.github.com/repos/LibreCAD/LibreCAD_3/statuses/4b43e5fbf3cec704711dae233e8075a2222360a7"}},"author_association":"NONE"}}
{"actor":{"display_login":"feragon"}}