{"action":"created","issue":{"url":"https://api.github.com/repos/go-gl/glfw/issues/171","repository_url":"https://api.github.com/repos/go-gl/glfw","labels_url":"https://api.github.com/repos/go-gl/glfw/issues/171/labels{/name}","comments_url":"https://api.github.com/repos/go-gl/glfw/issues/171/comments","events_url":"https://api.github.com/repos/go-gl/glfw/issues/171/events","html_url":"https://github.com/go-gl/glfw/issues/171","id":178853991,"number":171,"title":"Panic while using glow directly","user":{"login":"xlab","id":477998,"avatar_url":"https://avatars.githubusercontent.com/u/477998?v=3","gravatar_id":"","url":"https://api.github.com/users/xlab","html_url":"https://github.com/xlab","followers_url":"https://api.github.com/users/xlab/followers","following_url":"https://api.github.com/users/xlab/following{/other_user}","gists_url":"https://api.github.com/users/xlab/gists{/gist_id}","starred_url":"https://api.github.com/users/xlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xlab/subscriptions","organizations_url":"https://api.github.com/users/xlab/orgs","repos_url":"https://api.github.com/users/xlab/repos","events_url":"https://api.github.com/users/xlab/events{/privacy}","received_events_url":"https://api.github.com/users/xlab/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-23T11:33:13Z","updated_at":"2016-09-23T12:09:35Z","closed_at":null,"body":"Hi, I took the example app from README of this project, initialised the glfw and made the context current. The app works fine (shows a window).\r\n\r\n```\r\n    err := glfw.Init()\r\n    if err != nil {\r\n        panic(err)\r\n    }\r\n    defer glfw.Terminate()\r\n\r\n    window, err := glfw.CreateWindow(640, 480, \"Testing\", nil, nil)\r\n    if err != nil {\r\n        panic(err)\r\n    }\r\n\r\n    window.MakeContextCurrent()\r\n```\r\n\r\nBut then after `window.MakeContextCurrent` I added \r\n\r\n```\r\ngl.Viewport(0, 0, 640, 480)\r\n```\r\n\r\nAnd it panics:\r\n\r\n```\r\nfatal error: unexpected signal during runtime execution\r\n[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x0]\r\n\r\nruntime stack:\r\nruntime.throw(0x40cf016, 0x2a)\r\n\t/usr/local/go/src/runtime/panic.go:566 +0x95\r\nruntime.sigpanic()\r\n\t/usr/local/go/src/runtime/sigpanic_unix.go:12 +0x2cc\r\nruntime.asmcgocall(0xc42004fe30, 0xc420014100)\r\n\t/usr/local/go/src/runtime/asm_amd64.s:594 +0x70\r\nruntime.cgocall(0x7fff5fbff240, 0x4135920, 0x7fff5fbff230)\r\n\t/usr/local/go/src/runtime/cgocall.go:115 +0xed\r\n\r\ngoroutine 1 [syscall, locked to thread]:\r\nruntime.cgocall(0x4098e00, 0xc42004feb0, 0xc400000000)\r\n\t/usr/local/go/src/runtime/cgocall.go:131 +0x110 fp=0xc42004fe60 sp=0xc42004fe20\r\ngithub.com/go-gl/gl/v3.3-core/gl._Cfunc_glowViewport(0x0, 0x0, 0x25800000320)\r\n\tgithub.com/go-gl/gl/v3.3-core/gl/_obj/_cgo_gotypes.go:17161 +0x45 fp=0xc42004feb0 sp=0xc42004fe60\r\ngithub.com/go-gl/gl/v3.3-core/gl.Viewport(0x0, 0x25800000320)\r\n\t/Users/xlab/Documents/dev/go/src/github.com/go-gl/gl/v3.3-core/gl/package.go:10052 +0x4d fp=0xc42004fed8 sp=0xc42004feb0\r\nmain.main()\r\n```\r\n\r\nI have OS X and Go 1.7"},"comment":{"url":"https://api.github.com/repos/go-gl/glfw/issues/comments/249175315","html_url":"https://github.com/go-gl/glfw/issues/171#issuecomment-249175315","issue_url":"https://api.github.com/repos/go-gl/glfw/issues/171","id":249175315,"user":{"login":"tapir","id":223984,"avatar_url":"https://avatars.githubusercontent.com/u/223984?v=3","gravatar_id":"","url":"https://api.github.com/users/tapir","html_url":"https://github.com/tapir","followers_url":"https://api.github.com/users/tapir/followers","following_url":"https://api.github.com/users/tapir/following{/other_user}","gists_url":"https://api.github.com/users/tapir/gists{/gist_id}","starred_url":"https://api.github.com/users/tapir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tapir/subscriptions","organizations_url":"https://api.github.com/users/tapir/orgs","repos_url":"https://api.github.com/users/tapir/repos","events_url":"https://api.github.com/users/tapir/events{/privacy}","received_events_url":"https://api.github.com/users/tapir/received_events","type":"User","site_admin":false},"created_at":"2016-09-23T12:09:35Z","updated_at":"2016-09-23T12:09:35Z","body":"Did you do\r\n\r\n```Go\r\n    // Important! Call gl.Init only under the presence of an active OpenGL context,\r\n    // i.e., after MakeContextCurrent.\r\n    if err := gl.Init(); err != nil {\r\n        panic(err)\r\n    }\r\n```"}}
{"actor":{"display_login":"tapir"}}