Jump to content
  • Advertisement
Sign in to follow this  
Boder

windows.h before gl.h

This topic is 4418 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is windows.h always supposed to be included before gl.h on the Windows platform? I ask because at least two libraries have failed to compile because they don't include windows.h before gl.h. I would expect these crossplatform libraries to do a check like #ifdef __WIN32__ #include <windows.h> #endif So it makes me suspect I am doing something wrong. It fails on this line in GL/gl.h:
WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value);
So I had to add an #include <windows.h> and I suppose I should also do the mean and lean thing, right?

Share this post


Link to post
Share on other sites
Advertisement
Yeah you need to do windows.h before OpenGL headers. As for the lean and mean you can use it or not its up to you. It just removes a bunch of code that you probably won't use for games... I have it called and haven't had any errors or any reason to not use it.

It is used to exclude rarely-used services from Windows headers. Also if you are using MFC its automatically used.

Share this post


Link to post
Share on other sites
Yeah, I'll add lean and mean to be defined in my project settings.

So my question: Should I modify gl.h to include windows.h or should I modify each file that includes gl.h? Moreover, why isn't windows.h automatically included from gl.h?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!