Skip to content

cross platform function loader - #5

Merged
magistermaks merged 1 commit into
dark-tree:masterfrom
Chilsem-115:master
Sep 23, 2026
Merged

magistermaks merged 1 commit into
dark-tree:masterfrom
Chilsem-115:master

Conversation

@Chilsem-115

Copy link
Copy Markdown

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:

  • glXGetProcAddress on Linux/GLX
  • wglGetProcAddress on Windows/WGL

note: this was only tested locally for x11, I don't know if it works on windows yet or not.

@magistermaks

Copy link
Copy Markdown
Member

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'm asking bc I surprised anyone found my little lib 😄

@Chilsem-115

Copy link
Copy Markdown
Author

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
so i just kept looking until i found this one, just right around 4000 lines of code small library seemed perfectly correct for my goals
keep up the good work ^^

@magistermaks

Copy link
Copy Markdown
Member

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.

@magistermaks
magistermaks merged commit fcd3c11 into dark-tree:master Sep 23, 2026
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 this pull request may close these issues.

2 participants