Original Post
🔒 Locked
why include windows?
Advertisement
OpenGL is crossplatform. But window creation is not. For that you use OS specific code or use something like GLUT.
You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
Microsoft''s OpenGL implementation uses GDI macros in the GL/gl.h header and requires that they be defined before the header is included, hence the need to include windows.h before GL/gl.h. Since it''s only that OpenGL implementation that requires that, feel free to wrap the windows.h inclusion in a preprocessor test to only do it when necessary (less global-namespace-poluting solutions exist too, by avoiding the need for windows.h, but they''re more difficult).


Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement