{"action":"created","issue":{"url":"https://api.github.com/repos/cxd4/OpenGL-js/issues/5","labels_url":"https://api.github.com/repos/cxd4/OpenGL-js/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/cxd4/OpenGL-js/issues/5/comments","events_url":"https://api.github.com/repos/cxd4/OpenGL-js/issues/5/events","html_url":"https://github.com/cxd4/OpenGL-js/issues/5","id":105114830,"number":5,"title":"glColor4f only updates 1 of the 3 possible vertex size state combinations.","user":{"login":"cxd4","id":1396303,"avatar_url":"https://avatars.githubusercontent.com/u/1396303?v=3","gravatar_id":"","url":"https://api.github.com/users/cxd4","html_url":"https://github.com/cxd4","followers_url":"https://api.github.com/users/cxd4/followers","following_url":"https://api.github.com/users/cxd4/following{/other_user}","gists_url":"https://api.github.com/users/cxd4/gists{/gist_id}","starred_url":"https://api.github.com/users/cxd4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cxd4/subscriptions","organizations_url":"https://api.github.com/users/cxd4/orgs","repos_url":"https://api.github.com/users/cxd4/repos","events_url":"https://api.github.com/users/cxd4/events{/privacy}","received_events_url":"https://api.github.com/users/cxd4/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-06T20:07:54Z","updated_at":"2015-09-06T20:23:47Z","closed_at":"2015-09-06T20:23:47Z","body":"I noticed this bug by changing `coordinates_per_vertex = 4;` to 2 or 3.\r\n\r\nOnce a call to `glVertexPointer` in my wrapper changes the size, the effects of my emulation of `glColor4f` no longer apply to that program in the linked vertex programs array once `glUseProgram` has switched the currently active program.\r\n\r\nYou would therefore have to say something less efficient like:\r\n```c\r\nglColor4f(0.333, 0, 0.667, 0.80);\r\nglVertexPointer(4, GL_FLOAT, 0, &vertex_cache[0]);\r\nglColor4f(0.333, 0, 0.667, 0.80);\r\nglVertexPointer(3, GL_FLOAT, 0, &sphere[0]);\r\nglColor4f(0.333, 0, 0.667, 0.80);\r\nglVertexPointer(2, GL_FLOAT, 0, &circle[0]);\r\nglColor4f(0.333, 0, 0.667, 0.80);\r\n/* I don't think size=1 was ever made a legal input, was it? */\r\n```"},"comment":{"url":"https://api.github.com/repos/cxd4/OpenGL-js/issues/comments/138123373","html_url":"https://github.com/cxd4/OpenGL-js/issues/5#issuecomment-138123373","issue_url":"https://api.github.com/repos/cxd4/OpenGL-js/issues/5","id":138123373,"user":{"login":"cxd4","id":1396303,"avatar_url":"https://avatars.githubusercontent.com/u/1396303?v=3","gravatar_id":"","url":"https://api.github.com/users/cxd4","html_url":"https://github.com/cxd4","followers_url":"https://api.github.com/users/cxd4/followers","following_url":"https://api.github.com/users/cxd4/following{/other_user}","gists_url":"https://api.github.com/users/cxd4/gists{/gist_id}","starred_url":"https://api.github.com/users/cxd4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cxd4/subscriptions","organizations_url":"https://api.github.com/users/cxd4/orgs","repos_url":"https://api.github.com/users/cxd4/repos","events_url":"https://api.github.com/users/cxd4/events{/privacy}","received_events_url":"https://api.github.com/users/cxd4/received_events","type":"User","site_admin":false},"created_at":"2015-09-06T20:23:47Z","updated_at":"2015-09-06T20:23:47Z","body":"The issue is now fixed as a result of https://github.com/cxd4/OpenGL-js/commit/774d77be2ac8ec861281189d050e3cf6e499b7a4.\r\n\r\n`glColor4f` now temporarily calls `glUseProgram` for each of the 3 possible and reachable vertex programs using static, uniform color (without dynamic vertex color shading or color arrays, in which case `(q != 0) & (qx != 0)`).  In the process, I am allowed to upload the constant color to all 3 vertex programs, then safely return to the original vertex program state as of before entering the wrapper call to this function."}}