{"action":"created","issue":{"url":"https://api.github.com/repos/ntoronto/pict3d/issues/9","labels_url":"https://api.github.com/repos/ntoronto/pict3d/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/ntoronto/pict3d/issues/9/comments","events_url":"https://api.github.com/repos/ntoronto/pict3d/issues/9/events","html_url":"https://github.com/ntoronto/pict3d/issues/9","id":56509654,"number":9,"title":"win7 glGetString issue","user":{"login":"pafalium","id":5246303,"avatar_url":"https://avatars.githubusercontent.com/u/5246303?v=3","gravatar_id":"","url":"https://api.github.com/users/pafalium","html_url":"https://github.com/pafalium","followers_url":"https://api.github.com/users/pafalium/followers","following_url":"https://api.github.com/users/pafalium/following{/other_user}","gists_url":"https://api.github.com/users/pafalium/gists{/gist_id}","starred_url":"https://api.github.com/users/pafalium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pafalium/subscriptions","organizations_url":"https://api.github.com/users/pafalium/orgs","repos_url":"https://api.github.com/users/pafalium/repos","events_url":"https://api.github.com/users/pafalium/events{/privacy}","received_events_url":"https://api.github.com/users/pafalium/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2015-02-04T10:34:01Z","updated_at":"2015-02-12T20:23:12Z","closed_at":null,"body":"I'm trying to run pict3d's tests on windows 7 but I'm getting either \"could not obtain at least an OpenGL 30 context (pict3d-legacy-contexts? #f)\" or \"OpenGL procedure not available: glGetString\" errors.\r\nI've tried running spaceship.rkt, depth-range-rkt, triangle-surface.rkt.\r\n\r\nLog messages: \r\n>pict3d: pict3d: <engine> exception querying canvas OpenGL context version (pict3d-legacy-contexts? #f): (exn:fail \"OpenGL procedure not available: glGetString\" #<continuation-mark-set>)\r\n\r\nI'm using pict3d's version from \"31/01/2015, 20:26:49\".\r\n\r\nTried this code in pict3d/private/gl/untyped-context.rkt just to check that I could reproduce it:\r\n```racket\r\n;; from (get-master-gl-context/frame legacy?)\r\n(define config (new gl-config%))\r\n(send config set-legacy? #f)\r\n(define frame (new frame%\r\n\t\t\t\t [label \"Master GL context frame\"]\r\n\t\t\t\t [width   master-context-max-width]\r\n\t\t\t\t [height  master-context-max-height]\r\n\t\t\t\t [min-width   master-context-max-width]\r\n\t\t\t\t [min-height  master-context-max-height]\r\n\t\t\t\t [stretchable-width #f]\r\n\t\t\t\t [stretchable-height #f]))\r\n(define canvas (new canvas% [parent frame] [style '(gl no-autoclear)] [gl-config config]))\r\n(send frame show #t)\r\n(send frame show #f)\r\n\r\n(send canvas with-gl-context (thunk (gl-version)))\r\n; Got an \"OpenGL procedure not available: glGetString\" error here\r\n```\r\n\r\n\r\nI tried using RacketGL recently so I thought about trying to run a similar code snipet using it. Everything goes fine. Here's the code:\r\n```racket\r\n(define config (new gl-config%))\r\n(define frame (new frame% \r\n                   [label \"racketGL minimal example\"]\r\n                   [width 4096] \r\n\t\t\t\t   [height 4096]\r\n\t\t\t\t   [min-width 4096]\r\n\t\t\t\t   [min-height 4096]\r\n\t\t\t\t   [stretchable-width #f]\r\n\t\t\t\t   [stretchable-height #f]))\r\n(define canvas (new canvas% [parent frame] [style '(gl no-autoclear)] [gl-config config]))\r\n(send frame show #t)\r\n(send frame show #f)\r\n\r\n(send canvas with-gl-context (thunk (gl-version)))\r\n;; The returned value was '(4 4 12874)\r\n```"},"comment":{"url":"https://api.github.com/repos/ntoronto/pict3d/issues/comments/74145339","html_url":"https://github.com/ntoronto/pict3d/issues/9#issuecomment-74145339","issue_url":"https://api.github.com/repos/ntoronto/pict3d/issues/9","id":74145339,"user":{"login":"ntoronto","id":489358,"avatar_url":"https://avatars.githubusercontent.com/u/489358?v=3","gravatar_id":"","url":"https://api.github.com/users/ntoronto","html_url":"https://github.com/ntoronto","followers_url":"https://api.github.com/users/ntoronto/followers","following_url":"https://api.github.com/users/ntoronto/following{/other_user}","gists_url":"https://api.github.com/users/ntoronto/gists{/gist_id}","starred_url":"https://api.github.com/users/ntoronto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ntoronto/subscriptions","organizations_url":"https://api.github.com/users/ntoronto/orgs","repos_url":"https://api.github.com/users/ntoronto/repos","events_url":"https://api.github.com/users/ntoronto/events{/privacy}","received_events_url":"https://api.github.com/users/ntoronto/received_events","type":"User","site_admin":false},"created_at":"2015-02-12T20:23:12Z","updated_at":"2015-02-12T20:23:12Z","body":"I've just pushed a change that might speed things up significantly on Windows.\r\n\r\nI simulated the Windows loading protocol on my Linux machine and found that each call to `glPrimitiveRestartIndex` took 0.01ms. A delay like that allows at most 1667 API calls per frame at 60 FPS. Caching function pointer lookups by context brought the time down to 0.00065ms, or 25600 calls per frame at 60 FPS. My Linux machine's slimmer loading protocol allows 66 thousand calls per frame, but if I need more than 25 thousand API calls, I'm using OpenGL wrongly anyway.\r\n\r\nThe latest changes also require all OpenGL API calls to be made while an OpenGL context is active, just like on Windows, regardless of OS, to help keep my code portable in the future. It hasn't caused any problems yet."}}