-
Notifications
You must be signed in to change notification settings - Fork 429
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
Support header-file-only library generation #52
Comments
I think this is a great idea. I never really want to put the glad-files in with the rest of my code, but the alternative for now is just a tad too complicated. I think that simplicity is the one features of glad that makes it stand above rest (like GLEW). Having just a header file to import would make it even more simple and better. However, I imagine compiling the whole file @raysan5 has made takes some time, especially if it's included in several files. Quite often I just want like a GLuint declared for my header file. Maybe a complimentary |
Hi @Shimmen, I'm using OpenGL 3.3 core profile glad version, originally, |
I'm considering making a pull request. Do you want it to be an option to only have a header file and should it be default? |
Hey, that's awesome! I am still thinking if that option makes sense, as previously pointed out the header file would be really large and slow down the compilation process by quite a bit. I am also not sure if splitting the header into multiple header files is a good idea. Then again, having the option probably doesn't hurt, the header-only option wouldn't be the default though. |
I used the web tool to just select the extensions I needed (basic OpenGL 3.3 Core) and then I created a header only file; it was around 5K LoC and it compiles in milliseconds (unnoticeable any delay). |
Just a heads up, the glad2 branch supports a header only option now!
|
Modern preprocessors are very fast so when |
Great addition @Dav1dde! Thank you very much for the update! :) |
Any news on when this functionality will be hitting the website or will that be when version 2 is officially launched? Thanks! |
I don't have an ETA. If you want to play around with it, the glad2 branch should produced working C-Code. API slightly changed: |
I was hoping we could get a status update on when this might make it to the website. I love the web service! I think it's great! Header-only support would make it perfect. Thanks! |
http://glad2.dav1d.de currently hosts the glad2 branch, it is functional but with no fixed API. The glad2 does support header only. If you find bugs, I am happy to fix them. |
I believe I found some issues with this:
|
Thanks, yeah the header only still needs some improvements. @elmindreda pointed me to (just so I don't forget): https://github.com/nothings/stb/blob/master/docs/stb_howto.txt#L9 |
Works in glad2. |
For the lazy: You have to #define GLAD_GL_IMPLEMENTATION before including gl.h when using header-only libraries. GLAD_IMPLEMENTATION does not work. Then again this took 15 seconds of looking at the header so whatever, anyone with CTRL+F should be fine :) |
Would it be possible to add support for header-file-only generation for GLAD? I mean, similar to the stb libraries.
It would be very useful to just drop glad.h into the project and avoid pipeline modification.
Here it is a sample I'm working on; I created the GLAD header-file-only myself manually.
The text was updated successfully, but these errors were encountered: