-
Notifications
You must be signed in to change notification settings - Fork 450
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
Avoid #include "windows.h", just relevant parts (like GLFW3) #42
Comments
Should be possible. The main reason I can think of right now is only I'll be looking into it! So if you just want a quick fix until I have a proper solution, remove the |
Hi @Dav1dde, thanks for the answer. I tried the proposed solution and after dealing with some #defines, I get the following library compilation warnings (MinGW / gcc 4.7.2 / Windows 10 Home N 32bit):
And, consequently, the following linkage warnings on programs:
After some investigation on those functions I got:
I tried including just Hope this information could be useful. |
Thanks, that should only a problem if you use a glad version with loader. In your case you seem to use glfw anyways, so a loader is not necessary (just pass I will still be looking into removing |
Many thanks! It works! :D Program works great and executable is nearly 150KB smaller than GLEW alternative but I noticed a very weird issue when using GLAD. I use gDEBugger 5.8.1 profiler to test my library programs and when running a program using GLAD, textures are not detected at all, neither glBindTexture() calls or glDrawElements() calls... it's very weird because those calls are correctly detected when using GLEW... and in fact, program displays textures correctly in both cases! I know gDEBugger is a quite old tool, maybe it's a bug on the program... |
Awesome! I have no idea about the gDEBugger thing, but you could try apitrace, they are using glad in the testsuite, so I assume it works with glad! |
I know this is old, but maybe |
I haven't forgotten about the issue, unfortunately I simply don't have time to work on it. It should be possible to completely get rid of Windows.h. I will look into your suggestion when I get around to fix this, Thanks! |
I finally had time to look into it, I decided to still include Commit: 865dd12 |
If Windows.h is included before glad.h:
|
This error doesn't seem to come from glad, but from oaidl.h. What happens if you temporarily remove the include? |
Sorry! It seems the issue was caused by this compiler switch "/experimental:preprocessor" in VS2017. |
Anyway wouldn't it be better if glad doesn't use defines that are defined in Windows.h to avoid issues, e.g. use APIENTRY_GLAD instead of defining APIENTRY.
Also the webservice page could use some link, documentation to make it easier to understand for newcomers. Like for example what does " Generate a loader" do (I know now). And also thank you very much for this library! |
Initially I did it this way to be as close as possible to the original gl.h and the XML specification (which uses Hence the glad2 "rework", where I try to get rid of all these issues and bad decisions I made early on. Regarding documentation, yeah that's another thing where I want to get better at, it's currently in a very bad state and relies on tutorials linking to glad and explaining as well as experienced users that don't need the documentation. Also something I want to improve with glad2, unfortunately I don't have a lot of time to do this, but I'll get there. |
I want to use glad in my project (raylib) but some symbols defined by
windows.h
conflict with my symbols. If I comment#include "windows.h"
onglad.h
everything compiles fine but programs crash on init.Would it be possible to include only the required
windows.h
parts intoglad.h
?GLFW3 works this way.
The text was updated successfully, but these errors were encountered: