Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose glfwGetProcAddress in Context #234

Closed
kivutar opened this issue Dec 30, 2018 · 6 comments · Fixed by #238
Closed

Expose glfwGetProcAddress in Context #234

kivutar opened this issue Dec 30, 2018 · 6 comments · Fixed by #238

Comments

@kivutar
Copy link

kivutar commented Dec 30, 2018

See https://www.glfw.org/docs/latest/group__context.html#ga35f1837e6f666781842483937612f163

@tapir
Copy link
Member

tapir commented Dec 30, 2018

function pointers and cgo are very messy to implement. what use case do you have for it?
is go-gl/gl missing something?

@kivutar
Copy link
Author

kivutar commented Jan 2, 2019

I have a use case where I need to let a shared library call GetProcAddress. https://github.com/libretro/ludo/pull/91/files#diff-6a7f136db4c2e8bb2b91f3fa3b4079bdR374

This is a C version of this: https://github.com/heuripedes/sdlarch/blob/master/sdlarch.c#L582
That I'm trying to adapt to go.

@tapir
Copy link
Member

tapir commented Jan 2, 2019 via email

@kivutar
Copy link
Author

kivutar commented Jan 2, 2019

I need to avoid using glfw functions in my libretro package, because this package is a go binding for a C library and it has to remain agnostic. Some people may want to use it with SDL, some other with pure Windows or Apple rendering libs.

@GeertJohan
Copy link
Contributor

GeertJohan commented Feb 16, 2019

I believe the Drakirus/go-flutter-desktop-embedder project would benefit from a properly exported glfwGetProcAddress. Please see go-flutter-desktop/go-flutter#68 for more details.

The go code over there doesn't need to call the functions that are returned by glfwGetProcAddress, but it does need to provide a callback wrapper around glfwGetProcAddress so that the third party library (Flutter) may properly resolve GL functions via glfw.

@GeertJohan
Copy link
Contributor

Thanks @tapir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants