{"action":"created","issue":{"url":"https://api.github.com/repos/libretro/libretro-samples/issues/14","repository_url":"https://api.github.com/repos/libretro/libretro-samples","labels_url":"https://api.github.com/repos/libretro/libretro-samples/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/libretro/libretro-samples/issues/14/comments","events_url":"https://api.github.com/repos/libretro/libretro-samples/issues/14/events","html_url":"https://github.com/libretro/libretro-samples/issues/14","id":284116956,"number":14,"title":"Obtaining OpenGL Symbols (get_proc_address)","user":{"login":"deltabeard","id":3747104,"avatar_url":"https://avatars2.githubusercontent.com/u/3747104?v=4","gravatar_id":"","url":"https://api.github.com/users/deltabeard","html_url":"https://github.com/deltabeard","followers_url":"https://api.github.com/users/deltabeard/followers","following_url":"https://api.github.com/users/deltabeard/following{/other_user}","gists_url":"https://api.github.com/users/deltabeard/gists{/gist_id}","starred_url":"https://api.github.com/users/deltabeard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deltabeard/subscriptions","organizations_url":"https://api.github.com/users/deltabeard/orgs","repos_url":"https://api.github.com/users/deltabeard/repos","events_url":"https://api.github.com/users/deltabeard/events{/privacy}","received_events_url":"https://api.github.com/users/deltabeard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-12-22T09:39:43Z","updated_at":"2017-12-27T09:24:44Z","closed_at":null,"author_association":"NONE","body":"Hi all,\r\n\r\nI am currently trying to write a libretro core for mpv, which can use an OpenGL callback. As shown [here](https://github.com/mpv-player/mpv-examples/blob/master/libmpv/sdl/main.c#L22) we need to obtain OpenGL symbols, which is where I'm having problems.\r\n\r\nI've read the [libretro-gl.pdf](https://github.com/libretro/libretro.github.com/blob/master/documents/libretro-gl.pdf) document and understand that I can use retro_hw_get_proc_address_t to obtain these OpenGL symbols.\r\n\r\nI currently have:\r\n\r\n> static void *get_proc_address_mpv(void *fn_ctx, const char *name)\r\n> {\r\n> \tprintf(\"name: %s\\n\", name); //Debug\r\n> \treturn hw_render.get_proc_address(name);\r\n> }\r\n\r\n> bool retro_load_game(const struct retro_game_info *info)\r\n> {\r\n> \t-snip-\r\n> \tif(mpv_opengl_cb_init_gl(mpv_gl, NULL, get_proc_address_mpv, NULL) < 0)\r\n> \t{\r\n> \t\tlog_cb(RETRO_LOG_ERROR, \"failed to initialize mpv GL context\\n\");\r\n> \t\treturn false;\r\n> \t}\r\n> \t-snip-\r\n> }\r\n\r\nThe full source code is [here](https://github.com/deltabeard/mpv-libretro/blob/master/mpv-libretro.c).\r\n\r\nBut this produces a compile error:\r\n\r\n> mpv-libretro.c:237:9: warning: ISO C forbids return between function pointer and ‘void *’ [-Wpedantic]\r\n>   return hw_render.get_proc_address(name);\r\n>          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\n... and also segfaults when attempting to load the first OpenGL symbol (glGetString).\r\n\r\nI've tried searching for other libretro cores that use get_proc_address but my search is littered with libretro.h which is in every libretro core repository.\r\n\r\nWould you be able to point me in the right direction please?\r\nI apologise if this isn't the best place to ask for assistance.\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/libretro/libretro-samples/issues/comments/354082972","html_url":"https://github.com/libretro/libretro-samples/issues/14#issuecomment-354082972","issue_url":"https://api.github.com/repos/libretro/libretro-samples/issues/14","id":354082972,"user":{"login":"deltabeard","id":3747104,"avatar_url":"https://avatars2.githubusercontent.com/u/3747104?v=4","gravatar_id":"","url":"https://api.github.com/users/deltabeard","html_url":"https://github.com/deltabeard","followers_url":"https://api.github.com/users/deltabeard/followers","following_url":"https://api.github.com/users/deltabeard/following{/other_user}","gists_url":"https://api.github.com/users/deltabeard/gists{/gist_id}","starred_url":"https://api.github.com/users/deltabeard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deltabeard/subscriptions","organizations_url":"https://api.github.com/users/deltabeard/orgs","repos_url":"https://api.github.com/users/deltabeard/repos","events_url":"https://api.github.com/users/deltabeard/events{/privacy}","received_events_url":"https://api.github.com/users/deltabeard/received_events","type":"User","site_admin":false},"created_at":"2017-12-27T09:24:44Z","updated_at":"2017-12-27T09:24:44Z","author_association":"NONE","body":"Hi. Have you had the opportunity to check out my code yet? Thanks."}}
{"actor":{"display_login":"deltabeard"}}