cross platform function loader - #5
Conversation
|
Thanks for the PR, will look into testing this on Linux/Windows this later this week. And if I may ask, what are you using Winx for, and how did you find it? |
|
i wanted to make an experimental demo game project in opengl and zig (to learn opengl), and wanted to focus on the project rather than the windowing system and platform specific code but i also didn't want to use something too overkill for the project, i needed the least amount of dependencies |
|
Hi, sorry for the delay. I tested this on windows and found some problems - GLAD was not able to load the context using the new function as the loader, as well as that WINX apparently had an error in CMake - oops! I made all the required fixes here #6 myself. Merging this now, thanks. |
i was working on a project and wanted to load some openGL functions when i noticed that you already do that, except the functions you used are static.
so i thought it would be a nice addition to have a function that makes it easier for users to load openGL functions directly from the library rather than re-writing the platform specific code.
This PR adds a small public helper:
winxGetProcAddress(const char* name)The function wraps the existing platform-specific mechanisms:
glXGetProcAddresson Linux/GLXwglGetProcAddresson Windows/WGLnote: this was only tested locally for x11, I don't know if it works on windows yet or not.