You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since OpenGL supports loading function pointers on demand, and this varies per platform, it seems reasonable to abstract this behavior in the Alien:: module. There is an entire separate project "GLEW" to deal with this problem, which we might or might not want to include. The main theme of GLEW is just to declare a lot of global pointer-to-function, and then lazy-load them on demand. I came up with a (greatly) simplified version of their loader for my OpenGL::Sandbox project, dealing with only the functions I needed, and named it "glducktape". I think the giant table of function pointers might be too much for the alien module (maybe best saved for a OpenGL::GLEW module), but wrapping the C loader function with a platform-neutral API would be small-ish and quite useful for the perl ecosystem.
Since OpenGL supports loading function pointers on demand, and this varies per platform, it seems reasonable to abstract this behavior in the Alien:: module. There is an entire separate project "GLEW" to deal with this problem, which we might or might not want to include. The main theme of GLEW is just to declare a lot of global pointer-to-function, and then lazy-load them on demand. I came up with a (greatly) simplified version of their loader for my OpenGL::Sandbox project, dealing with only the functions I needed, and named it "glducktape". I think the giant table of function pointers might be too much for the alien module (maybe best saved for a OpenGL::GLEW module), but wrapping the C loader function with a platform-neutral API would be small-ish and quite useful for the perl ecosystem.
The loader I wrote (linked above) is
and implemented for Linux, Mac, and Win32. It is just a wrapper around dlsym, GetProcAddress, or glXGetProcAccress.
The text was updated successfully, but these errors were encountered: