{"action":"created","issue":{"url":"https://api.github.com/repos/factor/factor/issues/1859","repository_url":"https://api.github.com/repos/factor/factor","labels_url":"https://api.github.com/repos/factor/factor/issues/1859/labels{/name}","comments_url":"https://api.github.com/repos/factor/factor/issues/1859/comments","events_url":"https://api.github.com/repos/factor/factor/issues/1859/events","html_url":"https://github.com/factor/factor/issues/1859","id":256464903,"number":1859,"title":"OpenGL multisampling","user":{"login":"nicolas-p","id":11431580,"avatar_url":"https://avatars0.githubusercontent.com/u/11431580?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolas-p","html_url":"https://github.com/nicolas-p","followers_url":"https://api.github.com/users/nicolas-p/followers","following_url":"https://api.github.com/users/nicolas-p/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-p/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-p/subscriptions","organizations_url":"https://api.github.com/users/nicolas-p/orgs","repos_url":"https://api.github.com/users/nicolas-p/repos","events_url":"https://api.github.com/users/nicolas-p/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-p/received_events","type":"User","site_admin":false},"labels":[{"id":244274807,"url":"https://api.github.com/repos/factor/factor/labels/opengl","name":"opengl","color":"eb6420","default":false},{"id":159309,"url":"https://api.github.com/repos/factor/factor/labels/ui","name":"ui","color":"DDDDDD","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-09-09T20:45:51Z","updated_at":"2017-10-08T15:18:31Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I am trying to use multisampling to draw an antialised triangle. I'm not very familiar with OpenGL so I used [this tutorial](http://lazyfoo.net/tutorials/OpenGL/28_antialiasing_and_multisampling/index.php).\r\n\r\nI tried many things but the triangle is still aliased:\r\n\r\n<img width=\"230\" alt=\"capture d ecran 2017-09-09 a 22 34 59\" src=\"https://user-images.githubusercontent.com/11431580/30243658-3482adea-95af-11e7-8d76-beeb10b9ceb2.png\">\r\n\r\n```factor\r\nUSING: accessors kernel opengl.gl ui ui.gadgets\r\nui.gadgets.canvas ui.gadgets.worlds ui.pixel-formats ui.render ;\r\nIN: triangle\r\n\r\nTUPLE: test < canvas ;\r\nTUPLE: triangle < gadget ;\r\n\r\nM: triangle draw-gadget*\r\n    drop\r\n    GL_BLEND glEnable\r\n    GL_DEPTH_TEST glDisable\r\n    GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA glBlendFunc\r\n    \r\n    GL_MULTISAMPLE glEnable\r\n    \r\n    GL_TRIANGLES glBegin\r\n    1.0 0.0 0.0 glColor3f\r\n    30.0 40.0 glVertex2f\r\n    1.0 1.0 0.0 glColor3f\r\n    50.0 200.0 glVertex2f\r\n    1.0 0.0 1.0 glColor3f\r\n    200.0 30.0 glVertex2f\r\n    glEnd\r\n    \r\n    GL_MULTISAMPLE glDisable\r\n    GL_BLEND glDisable ;\r\n    \r\nM: test pref-dim*\r\n    drop { 250 250 } ;\r\n\r\n: test-window ( -- )\r\n    [ test new-canvas triangle new add-gadget\r\n      <world-attributes> \r\n      { windowed double-buffered multisampled } >>pixel-format-attributes\r\n      \"Test\" >>title open-window ] with-ui ;\r\n      \r\ntest-window\r\n```\r\n\r\nCould you tell me what I am doing wrong?\r\n\r\n(My machine is a 2012 Retina MacBook Pro with NVIDIA GeForce GT 650M and Intel HD Graphics 4000)"},"comment":{"url":"https://api.github.com/repos/factor/factor/issues/comments/335013579","html_url":"https://github.com/factor/factor/issues/1859#issuecomment-335013579","issue_url":"https://api.github.com/repos/factor/factor/issues/1859","id":335013579,"user":{"login":"nicolas-p","id":11431580,"avatar_url":"https://avatars0.githubusercontent.com/u/11431580?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolas-p","html_url":"https://github.com/nicolas-p","followers_url":"https://api.github.com/users/nicolas-p/followers","following_url":"https://api.github.com/users/nicolas-p/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-p/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-p/subscriptions","organizations_url":"https://api.github.com/users/nicolas-p/orgs","repos_url":"https://api.github.com/users/nicolas-p/repos","events_url":"https://api.github.com/users/nicolas-p/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-p/received_events","type":"User","site_admin":false},"created_at":"2017-10-08T15:18:31Z","updated_at":"2017-10-08T15:18:31Z","author_association":"CONTRIBUTOR","body":"Good find!\r\n\r\nI dug up an old nightly build that I still had on my computer (2016-07-16) and I can confirm that adding `T{ samples f 4 } T{ sample-buffers f 1 }` makes the above triangle completely smooth."}}
{"actor":{"display_login":"nicolas-p"}}