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

Is there an API to download platform specific headers and sources? #435

Closed
gruelingpine185 opened this issue Jul 30, 2023 · 2 comments
Closed
Labels

Comments

@gruelingpine185
Copy link

gruelingpine185 commented Jul 30, 2023

I ask only because it would be such a handy tool. GLAD is a platform specific dependency, so imagine if I add it to my cross-platform application. GLAD wont work unless each user of the application is running the same platform as I am. That isn't very convenient. Also, to the extent of my knowledge, the website that generates the the GLAD zip file does allow you to choose which platform you'd like to download GLAD for. That means that whoever wants to use my application will have to download GLAD for themselves and then build my app. Now, Imagine the said scenario, but with an API that I can tap into with wget, curl, or some other command that I can modify the URL to target a specific platform. Now, I can just place this in my Makefile with a couple ifeq (<platform>)s and the only thing my users would have to do is build the application with make. Simple.

But, if such functionality isn't available, am I missing something? Is there an alternative to achieve the results I'd like that I'm not aware of?

@Dav1dde
Copy link
Owner

Dav1dde commented Jul 30, 2023

Glad itself is not platform specific. You can freely choose the configuration you need (extensions, APIs, etc) and include the resulting C files in your repository.

This is also my recommended way of using glad, generate once, include the source and only manually re-generate when necessary, then update the sources (which does give nice git diffs).

The underlying OpenGL context is indeed highly platform specific, but glad already expects a fully setup context (from e.g. GLFW or SDL), so this part does not concern glad.

If you're talking about APIs like WGL and GLX, these are platform specific, but this can easily be managed by either your build tools or a simple #ifdef.

@gruelingpine185
Copy link
Author

Oh, ok. Thanks for your help. :)

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

No branches or pull requests

2 participants